public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work
@ 2024-08-01 14:55 Arthur Cohen
  2024-08-01 14:55 ` [PATCH 002/125] gccrs: Fix false positive for top-level AltPattern Arthur Cohen
                   ` (123 more replies)
  0 siblings, 124 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <thomas@codesourcery.com>

'gcc/tree.h':

    #define main_identifier_node		global_trees[TI_MAIN_IDENTIFIER]
    #define MAIN_NAME_P(NODE) \
      (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)

..., which is not initialized by default, but has to be set up by every front
end individually.  'MAIN_NAME_P' enables certain code optimizations, but is
especially also relevant for back ends that emit additional program entry setup
code for 'main'.

	gcc/rust/
	* backend/rust-compile-base.cc (HIRCompileBase::compile_function):
	For 'main', initialize 'main_identifier_node'.
---
 gcc/rust/backend/rust-compile-base.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index 984492f6607..4d6f0275b00 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -657,6 +657,12 @@ HIRCompileBase::compile_function (
 
   // we don't mangle the main fn since we haven't implemented the main shim
   bool is_main_fn = fn_name.compare ("main") == 0;
+  if (is_main_fn)
+    {
+      rust_assert (!main_identifier_node);
+      /* So that 'MAIN_NAME_P' works.  */
+      main_identifier_node = get_identifier (ir_symbol_name.c_str ());
+    }
   std::string asm_name = fn_name;
 
   unsigned int flags = 0;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 002/125] gccrs: Fix false positive for top-level AltPattern
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
@ 2024-08-01 14:55 ` Arthur Cohen
  2024-08-01 14:55 ` [PATCH 003/125] gccrs: minor cleanup in langhook.type_for_mode Arthur Cohen
                   ` (122 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-pattern.cc
	(ASTLoweringPattern::visit):
	Reset is_let_top_level while visiting GroupedPattern.

gcc/testsuite/ChangeLog:

	* rust/compile/let_alt.rs: Check for false positive.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/hir/rust-ast-lower-pattern.cc | 1 +
 gcc/testsuite/rust/compile/let_alt.rs  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/gcc/rust/hir/rust-ast-lower-pattern.cc b/gcc/rust/hir/rust-ast-lower-pattern.cc
index a2228488ad2..d534b829517 100644
--- a/gcc/rust/hir/rust-ast-lower-pattern.cc
+++ b/gcc/rust/hir/rust-ast-lower-pattern.cc
@@ -276,6 +276,7 @@ ASTLoweringPattern::visit (AST::RangePattern &pattern)
 void
 ASTLoweringPattern::visit (AST::GroupedPattern &pattern)
 {
+  is_let_top_level = false;
   pattern.get_pattern_in_parens ()->accept_vis (*this);
 }
 
diff --git a/gcc/testsuite/rust/compile/let_alt.rs b/gcc/testsuite/rust/compile/let_alt.rs
index a2735bdbe77..ff16e6428ff 100644
--- a/gcc/testsuite/rust/compile/let_alt.rs
+++ b/gcc/testsuite/rust/compile/let_alt.rs
@@ -1,4 +1,5 @@
 fn main() {
     let _a | _a = 12;
     // { dg-error "top level or-patterns are not allowed for .let. bindings" "" { target *-*-* } .-1 }
+    let (_b | _b) = 12;
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 003/125] gccrs: minor cleanup in langhook.type_for_mode
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
  2024-08-01 14:55 ` [PATCH 002/125] gccrs: Fix false positive for top-level AltPattern Arthur Cohen
@ 2024-08-01 14:55 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 004/125] gccrs: fmt: Start working on format_args!() parser Arthur Cohen
                   ` (121 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Marc Poulhiès

From: Marc Poulhiès <dkm@kataplop.net>

gcc/rust/ChangeLog:

	* rust-lang.cc (grs_langhook_type_for_mode): simplify code for
	xImode. Add missing long_double_type_node.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
---
 gcc/rust/rust-lang.cc | 39 +++++++++++++++------------------------
 1 file changed, 15 insertions(+), 24 deletions(-)

diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc
index 4c2ef108bce..a1f5fe3978d 100644
--- a/gcc/rust/rust-lang.cc
+++ b/gcc/rust/rust-lang.cc
@@ -169,38 +169,29 @@ static tree
 grs_langhook_type_for_mode (machine_mode mode, int unsignedp)
 {
   // TODO: change all this later to match rustc types
-  if (mode == TYPE_MODE (float_type_node))
-    return float_type_node;
-
-  if (mode == TYPE_MODE (double_type_node))
-    return double_type_node;
-
-  if (mode == TYPE_MODE (intQI_type_node)) // quarter integer mode - single byte
-					   // treated as integer
+  if (mode == QImode)
     return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
-  if (mode
-      == TYPE_MODE (intHI_type_node)) // half integer mode - two-byte integer
+
+  if (mode == HImode)
     return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
-  if (mode
-      == TYPE_MODE (intSI_type_node)) // single integer mode - four-byte integer
+
+  if (mode == SImode)
     return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
-  if (mode
-      == TYPE_MODE (
-	intDI_type_node)) // double integer mode - eight-byte integer
+
+  if (mode == DImode)
     return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-  if (mode
-      == TYPE_MODE (intTI_type_node)) // tetra integer mode - 16-byte integer
+
+  if (mode == TYPE_MODE (intTI_type_node))
     return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
 
-  if (mode == TYPE_MODE (integer_type_node))
-    return unsignedp ? unsigned_type_node : integer_type_node;
+  if (mode == TYPE_MODE (float_type_node))
+    return float_type_node;
 
-  if (mode == TYPE_MODE (long_integer_type_node))
-    return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+  if (mode == TYPE_MODE (double_type_node))
+    return double_type_node;
 
-  if (mode == TYPE_MODE (long_long_integer_type_node))
-    return unsignedp ? long_long_unsigned_type_node
-		     : long_long_integer_type_node;
+  if (mode == TYPE_MODE (long_double_type_node))
+    return long_double_type_node;
 
   if (COMPLEX_MODE_P (mode))
     {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 004/125] gccrs: fmt: Start working on format_args!() parser
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
  2024-08-01 14:55 ` [PATCH 002/125] gccrs: Fix false positive for top-level AltPattern Arthur Cohen
  2024-08-01 14:55 ` [PATCH 003/125] gccrs: minor cleanup in langhook.type_for_mode Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 005/125] gccrs: libgrust: Add format_parser library Arthur Cohen
                   ` (120 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

This commit adds a base class for parsing the various constructs of a
Rust format string, according to the grammar in the reference:

https://doc.rust-lang.org/std/fmt/index.html#syntax

gcc/rust/ChangeLog:

	* Make-lang.in: Compile rust-fmt object
	* ast/rust-fmt.cc: New file.
	* ast/rust-fmt.h: New file.
---
 gcc/rust/Make-lang.in    |   1 +
 gcc/rust/ast/rust-fmt.cc |  96 ++++++++++++++++++++++++++++
 gcc/rust/ast/rust-fmt.h  | 133 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 230 insertions(+)
 create mode 100644 gcc/rust/ast/rust-fmt.cc
 create mode 100644 gcc/rust/ast/rust-fmt.h

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index e437c32e347..c0df49a7fee 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -100,6 +100,7 @@ GRS_OBJS = \
     rust/rust-proc-macro-invoc-lexer.o \
     rust/rust-macro-substitute-ctx.o \
     rust/rust-macro-builtins.o \
+	rust/rust-fmt.o \
     rust/rust-hir.o \
     rust/rust-hir-map.o \
     rust/rust-attributes.o \
diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
new file mode 100644
index 00000000000..9f9ba48f0c3
--- /dev/null
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -0,0 +1,96 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-fmt.h"
+
+namespace Rust {
+tl::expected<Fmt, Fmt::Error>
+Fmt::parse_fmt_string (Fmt::Input input)
+{
+  return Fmt ();
+}
+
+tl::expected<Fmt::Result<tl::optional<Fmt::Format>>, Fmt::Error>
+Fmt::maybe_format (Fmt::Input input)
+{
+  tl::optional<Fmt::Format> none = tl::nullopt;
+
+  return Fmt::Result (input, none);
+}
+
+tl::expected<Fmt::Result<Fmt::Format>, Fmt::Error>
+Fmt::format (Input input)
+{
+  return Fmt::Result (input, Format ());
+}
+
+tl::expected<Fmt::Result<Fmt::Argument>, Fmt::Error>
+Fmt::argument (Input input)
+{
+  return Fmt::Result (input, Argument ());
+}
+
+tl::expected<Fmt::Result<Fmt::FormatSpec>, Fmt::Error>
+Fmt::format_spec (Input input)
+{
+  return Fmt::Result (input, FormatSpec ());
+}
+
+tl::expected<Fmt::Result<Fmt::Fill>, Fmt::Error>
+Fmt::fill (Input input)
+{
+  return Fmt::Result (input, Fill ());
+}
+
+tl::expected<Fmt::Result<Fmt::Align>, Fmt::Error>
+Fmt::align (Input input)
+{
+  switch (input[0])
+    {
+    case '<':
+      return Fmt::Result (input.substr (1), Align::Left);
+    case '^':
+      return Fmt::Result (input.substr (1), Align::Top);
+    case '>':
+      return Fmt::Result (input.substr (1), Align::Right);
+    default:
+      // TODO: Store the character here
+      // TODO: Can we have proper error locations?
+      // TODO: Maybe we should use a Rust::Literal string instead of a string
+      return tl::make_unexpected (Error::Align);
+    }
+}
+
+tl::expected<Fmt::Result<Fmt::Sign>, Fmt::Error>
+Fmt::sign (Input input)
+{
+  switch (input[0])
+    {
+    case '+':
+      return Fmt::Result (input.substr (1), Sign::Plus);
+    case '-':
+      return Fmt::Result (input.substr (1), Sign::Minus);
+    default:
+      // TODO: Store the character here
+      // TODO: Can we have proper error locations?
+      // TODO: Maybe we should use a Rust::Literal string instead of a string
+      return tl::make_unexpected (Error::Sign);
+    }
+}
+
+} // namespace Rust
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
new file mode 100644
index 00000000000..f3dd53da979
--- /dev/null
+++ b/gcc/rust/ast/rust-fmt.h
@@ -0,0 +1,133 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_FMT_H
+#define RUST_FMT_H
+
+#include "expected.h"
+#include "optional.h"
+#include "rust-ast.h"
+#include "rust-system.h"
+
+namespace Rust {
+
+/**
+ * This class implements the parsing of Rust format strings according to the
+ * grammar here: https://doc.rust-lang.org/std/fmt/index.html#syntax
+ */
+// TODO: Are there features that are only present in specific Rust editions?
+class Fmt
+{
+public:
+  // TODO: Keep location information
+  // TODO: Switch to a Rust::AST::Literal here
+  using Input = std::string;
+
+  enum class Error
+  {
+    Align,
+    Sign,
+  };
+
+  template <typename T> class Result
+  {
+  public:
+    explicit Result (Input remaining_input, T result)
+      : remaining_input (remaining_input), result (result)
+    {}
+
+  private:
+    Input remaining_input;
+    T result;
+  };
+
+  // FIXME: Do not use an owned string here
+  static tl::expected<Fmt, Fmt::Error> parse_fmt_string (Input input);
+
+private:
+  // the parse functions should return the remaining input as well as the
+  // expected node let's look at nom
+  // TODO: no string view :( use an owned string for now?
+
+  template <typename T> struct ParseResult
+  {
+    tl::expected<Result<T>, Error> inner;
+
+    ParseResult (tl::expected<Result<T>, Error> inner) : inner (inner) {}
+    ParseResult operator= (tl::expected<Result<T>, Error> inner)
+    {
+      return ParseResult (inner);
+    }
+
+    Input remaining_input () { return inner->remaining_input; }
+    T value () { return inner->value; }
+  };
+
+  struct Format
+  {
+  };
+
+  struct Argument
+  {
+    enum struct Kind
+    {
+      Integer,
+      Identifier,
+    } kind;
+
+    int integer;
+    Identifier identifier;
+  };
+
+  struct FormatSpec
+  {
+  };
+
+  struct Fill
+  {
+    char to_fill;
+  };
+
+  enum class Align
+  {
+    Left,
+    Top,
+    Right
+  };
+
+  enum class Sign
+  {
+    Plus,
+    Minus
+  };
+
+  // let's do one function per rule in the BNF
+  static tl::expected<Result<std::string>, Error> text (Input input);
+  static tl::expected<Result<tl::optional<Format>>, Error>
+  maybe_format (Input input);
+  static tl::expected<Result<Format>, Error> format (Input input);
+  static tl::expected<Result<Argument>, Error> argument (Input input);
+  static tl::expected<Result<FormatSpec>, Error> format_spec (Input input);
+  static tl::expected<Result<Fill>, Error> fill (Input input);
+  static tl::expected<Result<Align>, Error> align (Input input);
+  static tl::expected<Result<Sign>, Error> sign (Input input);
+};
+
+} // namespace Rust
+
+#endif // ! RUST_FMT_H
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 005/125] gccrs: libgrust: Add format_parser library
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (2 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 004/125] gccrs: fmt: Start working on format_args!() parser Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-05  8:18   ` Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library) Thomas Schwinge
  2024-11-23 20:09   ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' " Thomas Schwinge
  2024-08-01 14:56 ` [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER' Arthur Cohen
                   ` (119 subsequent siblings)
  123 siblings, 2 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

Compile libformat_parser and link to it.

gcc/rust/ChangeLog:

	* Make-lang.in: Compile libformat_parser.
	* ast/rust-fmt.cc: New FFI definitions.
	* ast/rust-fmt.h: Likewise.
	* expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Call
	into libformat_parser.
	* expand/rust-macro-builtins.h: Define format_args!() handler proper.

libgrust/ChangeLog:

	* libformat_parser/Cargo.lock: New file.
	* libformat_parser/Cargo.toml: New file.
	* libformat_parser/generic_format_parser/Cargo.toml: New file.
	* libformat_parser/generic_format_parser/src/lib.rs: New file.
	* libformat_parser/src/bin.rs: New file.
	* libformat_parser/src/lib.rs: New file.
---
 gcc/rust/Make-lang.in                         |   11 +-
 gcc/rust/ast/rust-fmt.cc                      |   77 +-
 gcc/rust/ast/rust-fmt.h                       |  189 +--
 gcc/rust/expand/rust-macro-builtins.cc        |   12 +-
 gcc/rust/expand/rust-macro-builtins.h         |    3 +
 libgrust/libformat_parser/Cargo.lock          |   30 +
 libgrust/libformat_parser/Cargo.toml          |   21 +
 .../generic_format_parser/Cargo.toml          |    9 +
 .../generic_format_parser/src/lib.rs          | 1102 +++++++++++++++++
 libgrust/libformat_parser/src/bin.rs          |    7 +
 libgrust/libformat_parser/src/lib.rs          |   41 +
 11 files changed, 1349 insertions(+), 153 deletions(-)
 create mode 100644 libgrust/libformat_parser/Cargo.lock
 create mode 100644 libgrust/libformat_parser/Cargo.toml
 create mode 100644 libgrust/libformat_parser/generic_format_parser/Cargo.toml
 create mode 100644 libgrust/libformat_parser/generic_format_parser/src/lib.rs
 create mode 100644 libgrust/libformat_parser/src/bin.rs
 create mode 100644 libgrust/libformat_parser/src/lib.rs

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index c0df49a7fee..8ac0d1d1973 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -54,6 +54,8 @@ GCCRS_D_OBJS = \
    rust/rustspec.o \
    $(END)
 
+LIBS += -ldl -lpthread
+
 gccrs$(exeext): $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	  $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
@@ -218,7 +220,7 @@ RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
 crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev)
 	@$(call LINK_PROGRESS,$(INDEX.rust),start)
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(BACKENDLIBS)
+	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) rust/libformat_parser.a  $(BACKENDLIBS)
 	@$(call LINK_PROGRESS,$(INDEX.rust),end)
 
 # Build hooks.
@@ -406,6 +408,13 @@ rust/%.o: rust/lex/%.cc
 	$(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $<
 	$(POSTCOMPILE)
 
+%.toml: 
+	echo $@
+
+rust/libformat_parser.a: $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
+	cargo build --manifest-path $(srcdir)/../libgrust/libformat_parser/Cargo.toml --release # FIXME: Not always release, right?
+	cp $(srcdir)/../libgrust/libformat_parser/target/release/liblibformat_parser.a $@
+
 # build all rust/parse files in rust folder, add cross-folder includes
 rust/%.o: rust/parse/%.cc
 	$(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $<
diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index 9f9ba48f0c3..559b1c8b579 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -19,78 +19,23 @@
 #include "rust-fmt.h"
 
 namespace Rust {
-tl::expected<Fmt, Fmt::Error>
-Fmt::parse_fmt_string (Fmt::Input input)
-{
-  return Fmt ();
-}
+namespace Fmt {
 
-tl::expected<Fmt::Result<tl::optional<Fmt::Format>>, Fmt::Error>
-Fmt::maybe_format (Fmt::Input input)
+Pieces
+Pieces::collect (const std::string &to_parse)
 {
-  tl::optional<Fmt::Format> none = tl::nullopt;
+  auto piece_slice = collect_pieces (to_parse.c_str ());
 
-  return Fmt::Result (input, none);
-}
+  rust_debug ("[ARTHUR] %p, %lu", (void *) piece_slice.ptr, piece_slice.len);
 
-tl::expected<Fmt::Result<Fmt::Format>, Fmt::Error>
-Fmt::format (Input input)
-{
-  return Fmt::Result (input, Format ());
-}
+  // this performs multiple copies, can we avoid them maybe?
+  auto pieces
+    = std::vector (piece_slice.ptr, piece_slice.ptr + piece_slice.len);
 
-tl::expected<Fmt::Result<Fmt::Argument>, Fmt::Error>
-Fmt::argument (Input input)
-{
-  return Fmt::Result (input, Argument ());
-}
+  rust_debug ("[ARTHUR] %p, %lu", (void *) pieces.data (), pieces.size ());
 
-tl::expected<Fmt::Result<Fmt::FormatSpec>, Fmt::Error>
-Fmt::format_spec (Input input)
-{
-  return Fmt::Result (input, FormatSpec ());
-}
-
-tl::expected<Fmt::Result<Fmt::Fill>, Fmt::Error>
-Fmt::fill (Input input)
-{
-  return Fmt::Result (input, Fill ());
-}
-
-tl::expected<Fmt::Result<Fmt::Align>, Fmt::Error>
-Fmt::align (Input input)
-{
-  switch (input[0])
-    {
-    case '<':
-      return Fmt::Result (input.substr (1), Align::Left);
-    case '^':
-      return Fmt::Result (input.substr (1), Align::Top);
-    case '>':
-      return Fmt::Result (input.substr (1), Align::Right);
-    default:
-      // TODO: Store the character here
-      // TODO: Can we have proper error locations?
-      // TODO: Maybe we should use a Rust::Literal string instead of a string
-      return tl::make_unexpected (Error::Align);
-    }
-}
-
-tl::expected<Fmt::Result<Fmt::Sign>, Fmt::Error>
-Fmt::sign (Input input)
-{
-  switch (input[0])
-    {
-    case '+':
-      return Fmt::Result (input.substr (1), Sign::Plus);
-    case '-':
-      return Fmt::Result (input.substr (1), Sign::Minus);
-    default:
-      // TODO: Store the character here
-      // TODO: Can we have proper error locations?
-      // TODO: Maybe we should use a Rust::Literal string instead of a string
-      return tl::make_unexpected (Error::Sign);
-    }
+  return Pieces{};
 }
 
+} // namespace Fmt
 } // namespace Rust
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index f3dd53da979..0050977358f 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -19,115 +19,134 @@
 #ifndef RUST_FMT_H
 #define RUST_FMT_H
 
-#include "expected.h"
-#include "optional.h"
-#include "rust-ast.h"
+#include "rust-diagnostics.h"
 #include "rust-system.h"
 
 namespace Rust {
+namespace Fmt {
 
-/**
- * This class implements the parsing of Rust format strings according to the
- * grammar here: https://doc.rust-lang.org/std/fmt/index.html#syntax
- */
-// TODO: Are there features that are only present in specific Rust editions?
-class Fmt
+struct RustHamster
 {
-public:
-  // TODO: Keep location information
-  // TODO: Switch to a Rust::AST::Literal here
-  using Input = std::string;
+  // hehe
+};
 
-  enum class Error
-  {
-    Align,
-    Sign,
-  };
+struct InnerSpan
+{
+};
 
-  template <typename T> class Result
+struct Count
+{
+  enum class Kind
+  {
+    Is,
+    IsName,
+    IsParam,
+    IsStar,
+    Implied
+  } kind;
+
+  union
   {
-  public:
-    explicit Result (Input remaining_input, T result)
-      : remaining_input (remaining_input), result (result)
-    {}
+    size_t is;
+    std::pair<RustHamster, InnerSpan> is_name;
+    size_t is_param;
+    size_t is_star;
+  } data;
+};
 
-  private:
-    Input remaining_input;
-    T result;
-  };
+struct DebugHex
+{
+};
 
-  // FIXME: Do not use an owned string here
-  static tl::expected<Fmt, Fmt::Error> parse_fmt_string (Input input);
+struct Sign
+{
+};
 
-private:
-  // the parse functions should return the remaining input as well as the
-  // expected node let's look at nom
-  // TODO: no string view :( use an owned string for now?
+struct Alignment
+{
+};
 
-  template <typename T> struct ParseResult
-  {
-    tl::expected<Result<T>, Error> inner;
+struct RustString
+{
+  // hehe
+};
 
-    ParseResult (tl::expected<Result<T>, Error> inner) : inner (inner) {}
-    ParseResult operator= (tl::expected<Result<T>, Error> inner)
-    {
-      return ParseResult (inner);
-    }
+struct Position
+{
+};
 
-    Input remaining_input () { return inner->remaining_input; }
-    T value () { return inner->value; }
-  };
+struct FormatSpec
+{
+  /// Optionally specified character to fill alignment with.
+  tl::optional<char /* FIXME: This is a Rust char, not a C++ char - use an uint32_t instead?  */> fill;
+  /// Span of the optionally specified fill character.
+  tl::optional<InnerSpan> fill_span;
+  /// Optionally specified alignment.
+  Alignment align;
+  /// The `+` or `-` flag.
+  tl::optional<Sign> sign;
+  /// The `#` flag.
+  bool alternate;
+  /// The `0` flag.
+  bool zero_pad;
+  /// The `x` or `X` flag. (Only for `Debug`.)
+  tl::optional<DebugHex> debug_hex;
+  /// The integer precision to use.
+  // Count <'a> precision;
+  /// The span of the precision formatting flag (for diagnostics).
+  tl::optional<InnerSpan> precision_span;
+  /// The string width requested for the resulting format.
+  // Count <'a> width;
+  /// The span of the width formatting flag (for diagnostics).
+  tl::optional<InnerSpan> width_span;
+  /// The descriptor string representing the name of the format desired for
+  /// this argument, this can be empty or any number of characters, although
+  /// it is required to be one word.
+  RustHamster ty;
+  // &'a str ty;
+  /// The span of the descriptor string (for diagnostics).
+  tl::optional<InnerSpan> ty_span;
+};
 
-  struct Format
-  {
-  };
+struct Argument
+{
+  Position position;
+  InnerSpan inner_span;
+  FormatSpec format;
+};
 
-  struct Argument
+struct Piece
+{
+  enum class Kind
   {
-    enum struct Kind
-    {
-      Integer,
-      Identifier,
-    } kind;
+    String,
+    NextArgument
+  } kind;
 
-    int integer;
-    Identifier identifier;
-  };
-
-  struct FormatSpec
+  union
   {
-  };
+    RustString string;
+    Argument *next_argument;
+  } data;
+};
 
-  struct Fill
-  {
-    char to_fill;
-  };
+struct PieceSlice
+{
+  Piece *ptr;
+  size_t len;
+};
 
-  enum class Align
-  {
-    Left,
-    Top,
-    Right
-  };
+extern "C" {
+PieceSlice
+collect_pieces (const char *);
+}
 
-  enum class Sign
-  {
-    Plus,
-    Minus
-  };
-
-  // let's do one function per rule in the BNF
-  static tl::expected<Result<std::string>, Error> text (Input input);
-  static tl::expected<Result<tl::optional<Format>>, Error>
-  maybe_format (Input input);
-  static tl::expected<Result<Format>, Error> format (Input input);
-  static tl::expected<Result<Argument>, Error> argument (Input input);
-  static tl::expected<Result<FormatSpec>, Error> format_spec (Input input);
-  static tl::expected<Result<Fill>, Error> fill (Input input);
-  static tl::expected<Result<Align>, Error> align (Input input);
-  static tl::expected<Result<Sign>, Error> sign (Input input);
+struct Pieces
+{
+  static Pieces collect (const std::string &to_parse);
 };
 
+} // namespace Fmt
 } // namespace Rust
 
 #endif // ! RUST_FMT_H
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 71da575563d..0e57406f10f 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -30,6 +30,7 @@
 #include "rust-parse.h"
 #include "rust-session-manager.h"
 #include "rust-attribute-values.h"
+#include "rust-fmt.h"
 
 namespace Rust {
 
@@ -89,8 +90,8 @@ std::unordered_map<std::string, AST::MacroTranscriberFunc>
     {"env", MacroBuiltin::env_handler},
     {"cfg", MacroBuiltin::cfg_handler},
     {"include", MacroBuiltin::include_handler},
+    {"format_args", MacroBuiltin::format_args_handler},
     /* Unimplemented macro builtins */
-    {"format_args", MacroBuiltin::sorry},
     {"option_env", MacroBuiltin::sorry},
     {"format_args_nl", MacroBuiltin::sorry},
     {"concat_idents", MacroBuiltin::sorry},
@@ -942,6 +943,15 @@ MacroBuiltin::stringify_handler (location_t invoc_locus,
   return AST::Fragment ({node}, std::move (token));
 }
 
+tl::optional<AST::Fragment>
+MacroBuiltin::format_args_handler (location_t invoc_locus,
+				   AST::MacroInvocData &invoc)
+{
+  Fmt::Pieces::collect ("heyo this {is} what I {} want to {3}, {parse}");
+
+  return AST::Fragment::create_empty ();
+}
+
 tl::optional<AST::Fragment>
 MacroBuiltin::sorry (location_t invoc_locus, AST::MacroInvocData &invoc)
 {
diff --git a/gcc/rust/expand/rust-macro-builtins.h b/gcc/rust/expand/rust-macro-builtins.h
index 6a84a8b86f6..f9ab3fc3698 100644
--- a/gcc/rust/expand/rust-macro-builtins.h
+++ b/gcc/rust/expand/rust-macro-builtins.h
@@ -157,6 +157,9 @@ public:
   static tl::optional<AST::Fragment> line_handler (location_t invoc_locus,
 						   AST::MacroInvocData &invoc);
 
+  static tl::optional<AST::Fragment>
+  format_args_handler (location_t invoc_locus, AST::MacroInvocData &invoc);
+
   static tl::optional<AST::Fragment> sorry (location_t invoc_locus,
 					    AST::MacroInvocData &invoc);
 
diff --git a/libgrust/libformat_parser/Cargo.lock b/libgrust/libformat_parser/Cargo.lock
new file mode 100644
index 00000000000..65e48263c71
--- /dev/null
+++ b/libgrust/libformat_parser/Cargo.lock
@@ -0,0 +1,30 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "generic_format_parser"
+version = "0.1.0"
+dependencies = [
+ "unicode-xid",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.152"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
+
+[[package]]
+name = "libformat_parser"
+version = "0.1.0"
+dependencies = [
+ "generic_format_parser",
+ "libc",
+]
+
+[[package]]
+name = "unicode-xid"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
diff --git a/libgrust/libformat_parser/Cargo.toml b/libgrust/libformat_parser/Cargo.toml
new file mode 100644
index 00000000000..0fcfa3e89a4
--- /dev/null
+++ b/libgrust/libformat_parser/Cargo.toml
@@ -0,0 +1,21 @@
+[package]
+name = "libformat_parser"
+version = "0.1.0"
+edition = "2021"
+
+[workspace]
+
+members = [
+  "generic_format_parser",
+]
+
+[dependencies]
+libc = "0.2"
+generic_format_parser = { path = "generic_format_parser" }
+
+[lib]
+crate_type = ["staticlib", "rlib"]
+
+[[bin]]
+name = "format_parser_test"
+path = "src/bin.rs"
diff --git a/libgrust/libformat_parser/generic_format_parser/Cargo.toml b/libgrust/libformat_parser/generic_format_parser/Cargo.toml
new file mode 100644
index 00000000000..34577038cbe
--- /dev/null
+++ b/libgrust/libformat_parser/generic_format_parser/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "generic_format_parser"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+unicode-xid = "0.2.0"
diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
new file mode 100644
index 00000000000..f42c9d8dffb
--- /dev/null
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -0,0 +1,1102 @@
+//! Macro support for format strings
+//!
+//! These structures are used when parsing format strings for the compiler.
+//! Parsing does not happen at runtime: structures of `std::fmt::rt` are
+//! generated instead.
+
+#![doc(
+    html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
+    html_playground_url = "https://play.rust-lang.org/",
+    test(attr(deny(warnings)))
+)]
+#![deny(rustc::untranslatable_diagnostic)]
+#![deny(rustc::diagnostic_outside_of_impl)]
+// WARNING: We want to be able to build this crate with a stable compiler,
+//          so no `#![feature]` attributes should be added!
+
+#[deprecated(note = "Use a proper lexer function for this")]
+fn is_id_start(c: char) -> bool {
+    c == '_' || unicode_xid::UnicodeXID::is_xid_start(c)
+}
+
+#[deprecated(note = "Use a proper lexer function for this")]
+fn is_id_continue(c: char) -> bool {
+    unicode_xid::UnicodeXID::is_xid_continue(c)
+}
+
+// use rustc_lexer::unescape;
+pub use Alignment::*;
+pub use Count::*;
+pub use Piece::*;
+pub use Position::*;
+
+use std::iter;
+use std::str;
+use std::string;
+
+// Note: copied from rustc_span
+/// Range inside of a `Span` used for diagnostics when we only have access to relative positions.
+#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+pub struct InnerSpan {
+    pub start: usize,
+    pub end: usize,
+}
+
+impl InnerSpan {
+    pub fn new(start: usize, end: usize) -> InnerSpan {
+        InnerSpan { start, end }
+    }
+}
+
+/// The location and before/after width of a character whose width has changed from its source code
+/// representation
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct InnerWidthMapping {
+    /// Index of the character in the source
+    pub position: usize,
+    /// The inner width in characters
+    pub before: usize,
+    /// The transformed width in characters
+    pub after: usize,
+}
+
+impl InnerWidthMapping {
+    pub fn new(position: usize, before: usize, after: usize) -> InnerWidthMapping {
+        InnerWidthMapping {
+            position,
+            before,
+            after,
+        }
+    }
+}
+
+/// Whether the input string is a literal. If yes, it contains the inner width mappings.
+#[derive(Clone, PartialEq, Eq)]
+enum InputStringKind {
+    NotALiteral,
+    Literal {
+        width_mappings: Vec<InnerWidthMapping>,
+    },
+}
+
+/// The type of format string that we are parsing.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum ParseMode {
+    /// A normal format string as per `format_args!`.
+    Format,
+    /// An inline assembly template string for `asm!`.
+    InlineAsm,
+}
+
+#[derive(Copy, Clone)]
+struct InnerOffset(usize);
+
+impl InnerOffset {
+    fn to(self, end: InnerOffset) -> InnerSpan {
+        InnerSpan::new(self.0, end.0)
+    }
+}
+
+/// A piece is a portion of the format string which represents the next part
+/// to emit. These are emitted as a stream by the `Parser` class.
+#[derive(Clone, Debug, PartialEq)]
+pub enum Piece<'a> {
+    /// A literal string which should directly be emitted
+    String(&'a str),
+    /// This describes that formatting should process the next argument (as
+    /// specified inside) for emission.
+    NextArgument(Box<Argument<'a>>),
+}
+
+/// Representation of an argument specification.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub struct Argument<'a> {
+    /// Where to find this argument
+    pub position: Position<'a>,
+    /// The span of the position indicator. Includes any whitespace in implicit
+    /// positions (`{  }`).
+    pub position_span: InnerSpan,
+    /// How to format the argument
+    pub format: FormatSpec<'a>,
+}
+
+/// Specification for the formatting of an argument in the format string.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub struct FormatSpec<'a> {
+    /// Optionally specified character to fill alignment with.
+    pub fill: Option<char>,
+    /// Span of the optionally specified fill character.
+    pub fill_span: Option<InnerSpan>,
+    /// Optionally specified alignment.
+    pub align: Alignment,
+    /// The `+` or `-` flag.
+    pub sign: Option<Sign>,
+    /// The `#` flag.
+    pub alternate: bool,
+    /// The `0` flag.
+    pub zero_pad: bool,
+    /// The `x` or `X` flag. (Only for `Debug`.)
+    pub debug_hex: Option<DebugHex>,
+    /// The integer precision to use.
+    pub precision: Count<'a>,
+    /// The span of the precision formatting flag (for diagnostics).
+    pub precision_span: Option<InnerSpan>,
+    /// The string width requested for the resulting format.
+    pub width: Count<'a>,
+    /// The span of the width formatting flag (for diagnostics).
+    pub width_span: Option<InnerSpan>,
+    /// The descriptor string representing the name of the format desired for
+    /// this argument, this can be empty or any number of characters, although
+    /// it is required to be one word.
+    pub ty: &'a str,
+    /// The span of the descriptor string (for diagnostics).
+    pub ty_span: Option<InnerSpan>,
+}
+
+/// Enum describing where an argument for a format can be located.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum Position<'a> {
+    /// The argument is implied to be located at an index
+    ArgumentImplicitlyIs(usize),
+    /// The argument is located at a specific index given in the format,
+    ArgumentIs(usize),
+    /// The argument has a name.
+    ArgumentNamed(&'a str),
+}
+
+impl Position<'_> {
+    pub fn index(&self) -> Option<usize> {
+        match self {
+            ArgumentIs(i, ..) | ArgumentImplicitlyIs(i) => Some(*i),
+            _ => None,
+        }
+    }
+}
+
+/// Enum of alignments which are supported.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum Alignment {
+    /// The value will be aligned to the left.
+    AlignLeft,
+    /// The value will be aligned to the right.
+    AlignRight,
+    /// The value will be aligned in the center.
+    AlignCenter,
+    /// The value will take on a default alignment.
+    AlignUnknown,
+}
+
+/// Enum for the sign flags.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum Sign {
+    /// The `+` flag.
+    Plus,
+    /// The `-` flag.
+    Minus,
+}
+
+/// Enum for the debug hex flags.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum DebugHex {
+    /// The `x` flag in `{:x?}`.
+    Lower,
+    /// The `X` flag in `{:X?}`.
+    Upper,
+}
+
+/// A count is used for the precision and width parameters of an integer, and
+/// can reference either an argument or a literal integer.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum Count<'a> {
+    /// The count is specified explicitly.
+    CountIs(usize),
+    /// The count is specified by the argument with the given name.
+    CountIsName(&'a str, InnerSpan),
+    /// The count is specified by the argument at the given index.
+    CountIsParam(usize),
+    /// The count is specified by a star (like in `{:.*}`) that refers to the argument at the given index.
+    CountIsStar(usize),
+    /// The count is implied and cannot be explicitly specified.
+    CountImplied,
+}
+
+pub struct ParseError {
+    pub description: string::String,
+    pub note: Option<string::String>,
+    pub label: string::String,
+    pub span: InnerSpan,
+    pub secondary_label: Option<(string::String, InnerSpan)>,
+    pub suggestion: Suggestion,
+}
+
+pub enum Suggestion {
+    None,
+    /// Replace inline argument with positional argument:
+    /// `format!("{foo.bar}")` -> `format!("{}", foo.bar)`
+    UsePositional,
+    /// Remove `r#` from identifier:
+    /// `format!("{r#foo}")` -> `format!("{foo}")`
+    RemoveRawIdent(InnerSpan),
+}
+
+/// The parser structure for interpreting the input format string. This is
+/// modeled as an iterator over `Piece` structures to form a stream of tokens
+/// being output.
+///
+/// This is a recursive-descent parser for the sake of simplicity, and if
+/// necessary there's probably lots of room for improvement performance-wise.
+pub struct Parser<'a> {
+    mode: ParseMode,
+    input: &'a str,
+    cur: iter::Peekable<str::CharIndices<'a>>,
+    /// Error messages accumulated during parsing
+    pub errors: Vec<ParseError>,
+    /// Current position of implicit positional argument pointer
+    pub curarg: usize,
+    /// `Some(raw count)` when the string is "raw", used to position spans correctly
+    style: Option<usize>,
+    /// Start and end byte offset of every successfully parsed argument
+    pub arg_places: Vec<InnerSpan>,
+    /// Characters whose length has been changed from their in-code representation
+    width_map: Vec<InnerWidthMapping>,
+    /// Span of the last opening brace seen, used for error reporting
+    last_opening_brace: Option<InnerSpan>,
+    /// Whether the source string is comes from `println!` as opposed to `format!` or `print!`
+    append_newline: bool,
+    /// Whether this formatting string was written directly in the source. This controls whether we
+    /// can use spans to refer into it and give better error messages.
+    /// N.B: This does _not_ control whether implicit argument captures can be used.
+    pub is_source_literal: bool,
+    /// Start position of the current line.
+    cur_line_start: usize,
+    /// Start and end byte offset of every line of the format string. Excludes
+    /// newline characters and leading whitespace.
+    pub line_spans: Vec<InnerSpan>,
+}
+
+impl<'a> Iterator for Parser<'a> {
+    type Item = Piece<'a>;
+
+    fn next(&mut self) -> Option<Piece<'a>> {
+        if let Some(&(pos, c)) = self.cur.peek() {
+            match c {
+                '{' => {
+                    let curr_last_brace = self.last_opening_brace;
+                    let byte_pos = self.to_span_index(pos);
+                    let lbrace_end = InnerOffset(byte_pos.0 + self.to_span_width(pos));
+                    self.last_opening_brace = Some(byte_pos.to(lbrace_end));
+                    self.cur.next();
+                    if self.consume('{') {
+                        self.last_opening_brace = curr_last_brace;
+
+                        Some(String(self.string(pos + 1)))
+                    } else {
+                        let arg = self.argument(lbrace_end);
+                        if let Some(rbrace_pos) = self.consume_closing_brace(&arg) {
+                            if self.is_source_literal {
+                                let lbrace_byte_pos = self.to_span_index(pos);
+                                let rbrace_byte_pos = self.to_span_index(rbrace_pos);
+
+                                let width = self.to_span_width(rbrace_pos);
+
+                                self.arg_places.push(
+                                    lbrace_byte_pos.to(InnerOffset(rbrace_byte_pos.0 + width)),
+                                );
+                            }
+                        } else {
+                            if let Some(&(_, maybe)) = self.cur.peek() {
+                                if maybe == '?' {
+                                    self.suggest_format();
+                                } else {
+                                    self.suggest_positional_arg_instead_of_captured_arg(arg);
+                                }
+                            }
+                        }
+                        Some(NextArgument(Box::new(arg)))
+                    }
+                }
+                '}' => {
+                    self.cur.next();
+                    if self.consume('}') {
+                        Some(String(self.string(pos + 1)))
+                    } else {
+                        let err_pos = self.to_span_index(pos);
+                        self.err_with_note(
+                            "unmatched `}` found",
+                            "unmatched `}`",
+                            "if you intended to print `}`, you can escape it using `}}`",
+                            err_pos.to(err_pos),
+                        );
+                        None
+                    }
+                }
+                _ => Some(String(self.string(pos))),
+            }
+        } else {
+            if self.is_source_literal {
+                let span = self.span(self.cur_line_start, self.input.len());
+                if self.line_spans.last() != Some(&span) {
+                    self.line_spans.push(span);
+                }
+            }
+            None
+        }
+    }
+}
+
+impl<'a> Parser<'a> {
+    /// Creates a new parser for the given format string
+    pub fn new(
+        s: &'a str,
+        style: Option<usize>,
+        snippet: Option<string::String>,
+        append_newline: bool,
+        mode: ParseMode,
+    ) -> Parser<'a> {
+        let input_string_kind = find_width_map_from_snippet(s, snippet, style);
+        let (width_map, is_source_literal) = match input_string_kind {
+            InputStringKind::Literal { width_mappings } => (width_mappings, true),
+            InputStringKind::NotALiteral => (Vec::new(), false),
+        };
+
+        Parser {
+            mode,
+            input: s,
+            cur: s.char_indices().peekable(),
+            errors: vec![],
+            curarg: 0,
+            style,
+            arg_places: vec![],
+            width_map,
+            last_opening_brace: None,
+            append_newline,
+            is_source_literal,
+            cur_line_start: 0,
+            line_spans: vec![],
+        }
+    }
+
+    /// Notifies of an error. The message doesn't actually need to be of type
+    /// String, but I think it does when this eventually uses conditions so it
+    /// might as well start using it now.
+    fn err<S1: Into<string::String>, S2: Into<string::String>>(
+        &mut self,
+        description: S1,
+        label: S2,
+        span: InnerSpan,
+    ) {
+        self.errors.push(ParseError {
+            description: description.into(),
+            note: None,
+            label: label.into(),
+            span,
+            secondary_label: None,
+            suggestion: Suggestion::None,
+        });
+    }
+
+    /// Notifies of an error. The message doesn't actually need to be of type
+    /// String, but I think it does when this eventually uses conditions so it
+    /// might as well start using it now.
+    fn err_with_note<
+        S1: Into<string::String>,
+        S2: Into<string::String>,
+        S3: Into<string::String>,
+    >(
+        &mut self,
+        description: S1,
+        label: S2,
+        note: S3,
+        span: InnerSpan,
+    ) {
+        self.errors.push(ParseError {
+            description: description.into(),
+            note: Some(note.into()),
+            label: label.into(),
+            span,
+            secondary_label: None,
+            suggestion: Suggestion::None,
+        });
+    }
+
+    /// Optionally consumes the specified character. If the character is not at
+    /// the current position, then the current iterator isn't moved and `false` is
+    /// returned, otherwise the character is consumed and `true` is returned.
+    fn consume(&mut self, c: char) -> bool {
+        self.consume_pos(c).is_some()
+    }
+
+    /// Optionally consumes the specified character. If the character is not at
+    /// the current position, then the current iterator isn't moved and `None` is
+    /// returned, otherwise the character is consumed and the current position is
+    /// returned.
+    fn consume_pos(&mut self, c: char) -> Option<usize> {
+        if let Some(&(pos, maybe)) = self.cur.peek() {
+            if c == maybe {
+                self.cur.next();
+                return Some(pos);
+            }
+        }
+        None
+    }
+
+    fn remap_pos(&self, mut pos: usize) -> InnerOffset {
+        for width in &self.width_map {
+            if pos > width.position {
+                pos += width.before - width.after;
+            } else if pos == width.position && width.after == 0 {
+                pos += width.before;
+            } else {
+                break;
+            }
+        }
+
+        InnerOffset(pos)
+    }
+
+    fn to_span_index(&self, pos: usize) -> InnerOffset {
+        // This handles the raw string case, the raw argument is the number of #
+        // in r###"..."### (we need to add one because of the `r`).
+        let raw = self.style.map_or(0, |raw| raw + 1);
+        let pos = self.remap_pos(pos);
+        InnerOffset(raw + pos.0 + 1)
+    }
+
+    fn to_span_width(&self, pos: usize) -> usize {
+        let pos = self.remap_pos(pos);
+        match self.width_map.iter().find(|w| w.position == pos.0) {
+            Some(w) => w.before,
+            None => 1,
+        }
+    }
+
+    fn span(&self, start_pos: usize, end_pos: usize) -> InnerSpan {
+        let start = self.to_span_index(start_pos);
+        let end = self.to_span_index(end_pos);
+        start.to(end)
+    }
+
+    /// Forces consumption of the specified character. If the character is not
+    /// found, an error is emitted.
+    fn consume_closing_brace(&mut self, arg: &Argument<'_>) -> Option<usize> {
+        self.ws();
+
+        let pos;
+        let description;
+
+        if let Some(&(peek_pos, maybe)) = self.cur.peek() {
+            if maybe == '}' {
+                self.cur.next();
+                return Some(peek_pos);
+            }
+
+            pos = peek_pos;
+            description = format!("expected `'}}'`, found `{maybe:?}`");
+        } else {
+            description = "expected `'}'` but string was terminated".to_owned();
+            // point at closing `"`
+            pos = self.input.len() - if self.append_newline { 1 } else { 0 };
+        }
+
+        let pos = self.to_span_index(pos);
+
+        let label = "expected `'}'`".to_owned();
+        let (note, secondary_label) = if arg.format.fill == Some('}') {
+            (
+                Some("the character `'}'` is interpreted as a fill character because of the `:` that precedes it".to_owned()),
+                arg.format.fill_span.map(|sp| ("this is not interpreted as a formatting closing brace".to_owned(), sp)),
+            )
+        } else {
+            (
+                Some("if you intended to print `{`, you can escape it using `{{`".to_owned()),
+                self.last_opening_brace
+                    .map(|sp| ("because of this opening brace".to_owned(), sp)),
+            )
+        };
+
+        self.errors.push(ParseError {
+            description,
+            note,
+            label,
+            span: pos.to(pos),
+            secondary_label,
+            suggestion: Suggestion::None,
+        });
+
+        None
+    }
+
+    /// Consumes all whitespace characters until the first non-whitespace character
+    fn ws(&mut self) {
+        while let Some(&(_, c)) = self.cur.peek() {
+            if c.is_whitespace() {
+                self.cur.next();
+            } else {
+                break;
+            }
+        }
+    }
+
+    /// Parses all of a string which is to be considered a "raw literal" in a
+    /// format string. This is everything outside of the braces.
+    fn string(&mut self, start: usize) -> &'a str {
+        // we may not consume the character, peek the iterator
+        while let Some(&(pos, c)) = self.cur.peek() {
+            match c {
+                '{' | '}' => {
+                    return &self.input[start..pos];
+                }
+                '\n' if self.is_source_literal => {
+                    self.line_spans.push(self.span(self.cur_line_start, pos));
+                    self.cur_line_start = pos + 1;
+                    self.cur.next();
+                }
+                _ => {
+                    if self.is_source_literal && pos == self.cur_line_start && c.is_whitespace() {
+                        self.cur_line_start = pos + c.len_utf8();
+                    }
+                    self.cur.next();
+                }
+            }
+        }
+        &self.input[start..self.input.len()]
+    }
+
+    /// Parses an `Argument` structure, or what's contained within braces inside the format string.
+    fn argument(&mut self, start: InnerOffset) -> Argument<'a> {
+        let pos = self.position();
+
+        let end = self
+            .cur
+            .clone()
+            .find(|(_, ch)| !ch.is_whitespace())
+            .map_or(start, |(end, _)| self.to_span_index(end));
+        let position_span = start.to(end);
+
+        let format = match self.mode {
+            ParseMode::Format => self.format(),
+            ParseMode::InlineAsm => self.inline_asm(),
+        };
+
+        // Resolve position after parsing format spec.
+        let pos = match pos {
+            Some(position) => position,
+            None => {
+                let i = self.curarg;
+                self.curarg += 1;
+                ArgumentImplicitlyIs(i)
+            }
+        };
+
+        Argument {
+            position: pos,
+            position_span,
+            format,
+        }
+    }
+
+    /// Parses a positional argument for a format. This could either be an
+    /// integer index of an argument, a named argument, or a blank string.
+    /// Returns `Some(parsed_position)` if the position is not implicitly
+    /// consuming a macro argument, `None` if it's the case.
+    fn position(&mut self) -> Option<Position<'a>> {
+        if let Some(i) = self.integer() {
+            Some(ArgumentIs(i))
+        } else {
+            match self.cur.peek() {
+                Some(&(lo, c)) if is_id_start(c) => {
+                    let word = self.word();
+
+                    // Recover from `r#ident` in format strings.
+                    // FIXME: use a let chain
+                    if word == "r" {
+                        if let Some((pos, '#')) = self.cur.peek() {
+                            if self.input[pos + 1..]
+                                .chars()
+                                .next()
+                                .is_some_and(is_id_start)
+                            {
+                                self.cur.next();
+                                let word = self.word();
+                                let prefix_span = self.span(lo, lo + 2);
+                                let full_span = self.span(lo, lo + 2 + word.len());
+                                self.errors.insert(0, ParseError {
+                                    description: "raw identifiers are not supported".to_owned(),
+                                    note: Some("identifiers in format strings can be keywords and don't need to be prefixed with `r#`".to_string()),
+                                    label: "raw identifier used here".to_owned(),
+                                    span: full_span,
+                                    secondary_label: None,
+                                    suggestion: Suggestion::RemoveRawIdent(prefix_span),
+                                });
+                                return Some(ArgumentNamed(word));
+                            }
+                        }
+                    }
+
+                    Some(ArgumentNamed(word))
+                }
+
+                // This is an `ArgumentNext`.
+                // Record the fact and do the resolution after parsing the
+                // format spec, to make things like `{:.*}` work.
+                _ => None,
+            }
+        }
+    }
+
+    fn current_pos(&mut self) -> usize {
+        if let Some(&(pos, _)) = self.cur.peek() {
+            pos
+        } else {
+            self.input.len()
+        }
+    }
+
+    /// Parses a format specifier at the current position, returning all of the
+    /// relevant information in the `FormatSpec` struct.
+    fn format(&mut self) -> FormatSpec<'a> {
+        let mut spec = FormatSpec {
+            fill: None,
+            fill_span: None,
+            align: AlignUnknown,
+            sign: None,
+            alternate: false,
+            zero_pad: false,
+            debug_hex: None,
+            precision: CountImplied,
+            precision_span: None,
+            width: CountImplied,
+            width_span: None,
+            ty: &self.input[..0],
+            ty_span: None,
+        };
+        if !self.consume(':') {
+            return spec;
+        }
+
+        // fill character
+        if let Some(&(idx, c)) = self.cur.peek() {
+            if let Some((_, '>' | '<' | '^')) = self.cur.clone().nth(1) {
+                spec.fill = Some(c);
+                spec.fill_span = Some(self.span(idx, idx + 1));
+                self.cur.next();
+            }
+        }
+        // Alignment
+        if self.consume('<') {
+            spec.align = AlignLeft;
+        } else if self.consume('>') {
+            spec.align = AlignRight;
+        } else if self.consume('^') {
+            spec.align = AlignCenter;
+        }
+        // Sign flags
+        if self.consume('+') {
+            spec.sign = Some(Sign::Plus);
+        } else if self.consume('-') {
+            spec.sign = Some(Sign::Minus);
+        }
+        // Alternate marker
+        if self.consume('#') {
+            spec.alternate = true;
+        }
+        // Width and precision
+        let mut havewidth = false;
+
+        if self.consume('0') {
+            // small ambiguity with '0$' as a format string. In theory this is a
+            // '0' flag and then an ill-formatted format string with just a '$'
+            // and no count, but this is better if we instead interpret this as
+            // no '0' flag and '0$' as the width instead.
+            if let Some(end) = self.consume_pos('$') {
+                spec.width = CountIsParam(0);
+                spec.width_span = Some(self.span(end - 1, end + 1));
+                havewidth = true;
+            } else {
+                spec.zero_pad = true;
+            }
+        }
+
+        if !havewidth {
+            let start = self.current_pos();
+            spec.width = self.count(start);
+            if spec.width != CountImplied {
+                let end = self.current_pos();
+                spec.width_span = Some(self.span(start, end));
+            }
+        }
+
+        if let Some(start) = self.consume_pos('.') {
+            if self.consume('*') {
+                // Resolve `CountIsNextParam`.
+                // We can do this immediately as `position` is resolved later.
+                let i = self.curarg;
+                self.curarg += 1;
+                spec.precision = CountIsStar(i);
+            } else {
+                spec.precision = self.count(start + 1);
+            }
+            let end = self.current_pos();
+            spec.precision_span = Some(self.span(start, end));
+        }
+
+        let ty_span_start = self.current_pos();
+        // Optional radix followed by the actual format specifier
+        if self.consume('x') {
+            if self.consume('?') {
+                spec.debug_hex = Some(DebugHex::Lower);
+                spec.ty = "?";
+            } else {
+                spec.ty = "x";
+            }
+        } else if self.consume('X') {
+            if self.consume('?') {
+                spec.debug_hex = Some(DebugHex::Upper);
+                spec.ty = "?";
+            } else {
+                spec.ty = "X";
+            }
+        } else if self.consume('?') {
+            spec.ty = "?";
+        } else {
+            spec.ty = self.word();
+            if !spec.ty.is_empty() {
+                let ty_span_end = self.current_pos();
+                spec.ty_span = Some(self.span(ty_span_start, ty_span_end));
+            }
+        }
+        spec
+    }
+
+    /// Parses an inline assembly template modifier at the current position, returning the modifier
+    /// in the `ty` field of the `FormatSpec` struct.
+    fn inline_asm(&mut self) -> FormatSpec<'a> {
+        let mut spec = FormatSpec {
+            fill: None,
+            fill_span: None,
+            align: AlignUnknown,
+            sign: None,
+            alternate: false,
+            zero_pad: false,
+            debug_hex: None,
+            precision: CountImplied,
+            precision_span: None,
+            width: CountImplied,
+            width_span: None,
+            ty: &self.input[..0],
+            ty_span: None,
+        };
+        if !self.consume(':') {
+            return spec;
+        }
+
+        let ty_span_start = self.current_pos();
+        spec.ty = self.word();
+        if !spec.ty.is_empty() {
+            let ty_span_end = self.current_pos();
+            spec.ty_span = Some(self.span(ty_span_start, ty_span_end));
+        }
+
+        spec
+    }
+
+    /// Parses a `Count` parameter at the current position. This does not check
+    /// for 'CountIsNextParam' because that is only used in precision, not
+    /// width.
+    fn count(&mut self, start: usize) -> Count<'a> {
+        if let Some(i) = self.integer() {
+            if self.consume('$') {
+                CountIsParam(i)
+            } else {
+                CountIs(i)
+            }
+        } else {
+            let tmp = self.cur.clone();
+            let word = self.word();
+            if word.is_empty() {
+                self.cur = tmp;
+                CountImplied
+            } else if let Some(end) = self.consume_pos('$') {
+                let name_span = self.span(start, end);
+                CountIsName(word, name_span)
+            } else {
+                self.cur = tmp;
+                CountImplied
+            }
+        }
+    }
+
+    /// Parses a word starting at the current position. A word is the same as
+    /// Rust identifier, except that it can't start with `_` character.
+    fn word(&mut self) -> &'a str {
+        let start = match self.cur.peek() {
+            Some(&(pos, c)) if is_id_start(c) => {
+                self.cur.next();
+                pos
+            }
+            _ => {
+                return "";
+            }
+        };
+        let mut end = None;
+        while let Some(&(pos, c)) = self.cur.peek() {
+            if is_id_continue(c) {
+                self.cur.next();
+            } else {
+                end = Some(pos);
+                break;
+            }
+        }
+        let end = end.unwrap_or(self.input.len());
+        let word = &self.input[start..end];
+        if word == "_" {
+            self.err_with_note(
+                "invalid argument name `_`",
+                "invalid argument name",
+                "argument name cannot be a single underscore",
+                self.span(start, end),
+            );
+        }
+        word
+    }
+
+    fn integer(&mut self) -> Option<usize> {
+        let mut cur: usize = 0;
+        let mut found = false;
+        let mut overflow = false;
+        let start = self.current_pos();
+        while let Some(&(_, c)) = self.cur.peek() {
+            if let Some(i) = c.to_digit(10) {
+                let (tmp, mul_overflow) = cur.overflowing_mul(10);
+                let (tmp, add_overflow) = tmp.overflowing_add(i as usize);
+                if mul_overflow || add_overflow {
+                    overflow = true;
+                }
+                cur = tmp;
+                found = true;
+                self.cur.next();
+            } else {
+                break;
+            }
+        }
+
+        if overflow {
+            let end = self.current_pos();
+            let overflowed_int = &self.input[start..end];
+            self.err(
+                format!(
+                    "integer `{}` does not fit into the type `usize` whose range is `0..={}`",
+                    overflowed_int,
+                    usize::MAX
+                ),
+                "integer out of range for `usize`",
+                self.span(start, end),
+            );
+        }
+
+        found.then_some(cur)
+    }
+
+    fn suggest_format(&mut self) {
+        if let (Some(pos), Some(_)) = (self.consume_pos('?'), self.consume_pos(':')) {
+            let word = self.word();
+            let _end = self.current_pos();
+            let pos = self.to_span_index(pos);
+            self.errors.insert(
+                0,
+                ParseError {
+                    description: "expected format parameter to occur after `:`".to_owned(),
+                    note: Some(format!(
+                        "`?` comes after `:`, try `{}:{}` instead",
+                        word, "?"
+                    )),
+                    label: "expected `?` to occur after `:`".to_owned(),
+                    span: pos.to(pos),
+                    secondary_label: None,
+                    suggestion: Suggestion::None,
+                },
+            );
+        }
+    }
+
+    fn suggest_positional_arg_instead_of_captured_arg(&mut self, arg: Argument<'a>) {
+        if let Some(end) = self.consume_pos('.') {
+            let byte_pos = self.to_span_index(end);
+            let start = InnerOffset(byte_pos.0 + 1);
+            let field = self.argument(start);
+            // We can only parse `foo.bar` field access, any deeper nesting,
+            // or another type of expression, like method calls, are not supported
+            if !self.consume('}') {
+                return;
+            }
+            if let ArgumentNamed(_) = arg.position {
+                if let ArgumentNamed(_) = field.position {
+                    self.errors.insert(
+                        0,
+                        ParseError {
+                            description: "field access isn't supported".to_string(),
+                            note: None,
+                            label: "not supported".to_string(),
+                            span: InnerSpan::new(arg.position_span.start, field.position_span.end),
+                            secondary_label: None,
+                            suggestion: Suggestion::UsePositional,
+                        },
+                    );
+                }
+            }
+        }
+    }
+}
+
+/// Finds the indices of all characters that have been processed and differ between the actual
+/// written code (code snippet) and the `InternedString` that gets processed in the `Parser`
+/// in order to properly synthesise the intra-string `Span`s for error diagnostics.
+// TODO: Can we give an escaped string here? probably yes - and a valid one too
+fn find_width_map_from_snippet(
+    input: &str,
+    snippet: Option<string::String>,
+    str_style: Option<usize>,
+) -> InputStringKind {
+    let snippet = match snippet {
+        Some(ref s) if s.starts_with('"') || s.starts_with("r\"") || s.starts_with("r#") => s,
+        _ => return InputStringKind::NotALiteral,
+    };
+
+    if str_style.is_some() {
+        return InputStringKind::Literal {
+            width_mappings: Vec::new(),
+        };
+    }
+
+    // Strip quotes.
+    let snippet = &snippet[1..snippet.len() - 1];
+
+    // Macros like `println` add a newline at the end. That technically doesn't make them "literals" anymore, but it's fine
+    // since we will never need to point our spans there, so we lie about it here by ignoring it.
+    // Since there might actually be newlines in the source code, we need to normalize away all trailing newlines.
+    // If we only trimmed it off the input, `format!("\n")` would cause a mismatch as here we they actually match up.
+    // Alternatively, we could just count the trailing newlines and only trim one from the input if they don't match up.
+    let input_no_nl = input.trim_end_matches('\n');
+    let Some(unescaped) = unescape_string(snippet) else {
+        return InputStringKind::NotALiteral;
+    };
+
+    let unescaped_no_nl = unescaped.trim_end_matches('\n');
+
+    if unescaped_no_nl != input_no_nl {
+        // The source string that we're pointing at isn't our input, so spans pointing at it will be incorrect.
+        // This can for example happen with proc macros that respan generated literals.
+        return InputStringKind::NotALiteral;
+    }
+
+    let mut s = snippet.char_indices();
+    let mut width_mappings = vec![];
+    while let Some((pos, c)) = s.next() {
+        match (c, s.clone().next()) {
+            // skip whitespace and empty lines ending in '\\'
+            ('\\', Some((_, '\n'))) => {
+                let _ = s.next();
+                let mut width = 2;
+
+                while let Some((_, c)) = s.clone().next() {
+                    if matches!(c, ' ' | '\n' | '\t') {
+                        width += 1;
+                        let _ = s.next();
+                    } else {
+                        break;
+                    }
+                }
+
+                width_mappings.push(InnerWidthMapping::new(pos, width, 0));
+            }
+            ('\\', Some((_, 'n' | 't' | 'r' | '0' | '\\' | '\'' | '\"'))) => {
+                width_mappings.push(InnerWidthMapping::new(pos, 2, 1));
+                let _ = s.next();
+            }
+            ('\\', Some((_, 'x'))) => {
+                // consume `\xAB` literal
+                s.nth(2);
+                width_mappings.push(InnerWidthMapping::new(pos, 4, 1));
+            }
+            ('\\', Some((_, 'u'))) => {
+                let mut width = 2;
+                let _ = s.next();
+
+                if let Some((_, next_c)) = s.next() {
+                    if next_c == '{' {
+                        // consume up to 6 hexanumeric chars
+                        let digits_len = s
+                            .clone()
+                            .take(6)
+                            .take_while(|(_, c)| c.is_digit(16))
+                            .count();
+
+                        let len_utf8 = s
+                            .as_str()
+                            .get(..digits_len)
+                            .and_then(|digits| u32::from_str_radix(digits, 16).ok())
+                            .and_then(char::from_u32)
+                            .map_or(1, char::len_utf8);
+
+                        // Skip the digits, for chars that encode to more than 1 utf-8 byte
+                        // exclude as many digits as it is greater than 1 byte
+                        //
+                        // So for a 3 byte character, exclude 2 digits
+                        let required_skips = digits_len.saturating_sub(len_utf8.saturating_sub(1));
+
+                        // skip '{' and '}' also
+                        width += required_skips + 2;
+
+                        s.nth(digits_len);
+                    } else if next_c.is_digit(16) {
+                        width += 1;
+
+                        // We suggest adding `{` and `}` when appropriate, accept it here as if
+                        // it were correct
+                        let mut i = 0; // consume up to 6 hexanumeric chars
+                        while let (Some((_, c)), _) = (s.next(), i < 6) {
+                            if c.is_digit(16) {
+                                width += 1;
+                            } else {
+                                break;
+                            }
+                            i += 1;
+                        }
+                    }
+                }
+
+                width_mappings.push(InnerWidthMapping::new(pos, width, 1));
+            }
+            _ => {}
+        }
+    }
+
+    InputStringKind::Literal { width_mappings }
+}
+
+// TODO: I guess we can provide an `unescape_string` function to the parser... but how do we do that
+// Store it in the parser struct? we need to make it FFI-aware
+// SO this is not possible because we need `unescape_string` *before* we have a parser
+
+fn unescape_string(string: &str) -> Option<string::String> {
+    // let mut buf = string::String::new();
+    // let mut ok = true;
+    // unescape::unescape_literal(string, unescape::Mode::Str, &mut |_, unescaped_char| {
+    //     match unescaped_char {
+    //         Ok(c) => buf.push(c),
+    //         Err(_) => ok = false,
+    //     }
+    // });
+
+    let buf = string::String::from(string);
+    let ok = true;
+
+    ok.then_some(buf)
+}
+
+// Assert a reasonable size for `Piece`
+// #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+// rustc_index::static_assert_size!(Piece<'_>, 16);
+
+// #[cfg(test)]
+// mod tests;
\ No newline at end of file
diff --git a/libgrust/libformat_parser/src/bin.rs b/libgrust/libformat_parser/src/bin.rs
new file mode 100644
index 00000000000..4b1f903ad5f
--- /dev/null
+++ b/libgrust/libformat_parser/src/bin.rs
@@ -0,0 +1,7 @@
+use libformat_parser::rust;
+
+fn main() {
+    dbg!(rust::collect_pieces(
+        std::env::args().nth(1).unwrap().as_str()
+    ));
+}
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
new file mode 100644
index 00000000000..e6dc16eeb49
--- /dev/null
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -0,0 +1,41 @@
+//! FFI interface for `rustc_format_parser`
+
+// what's the plan? Have a function return something that can be constructed into a vector?
+// or an iterator?
+
+use std::ffi::CStr;
+
+// TODO: Use rustc's version here #3
+use generic_format_parser::Piece;
+
+// FIXME: Rename?
+pub mod rust {
+    use generic_format_parser::{ParseMode, Parser, Piece};
+
+    pub fn collect_pieces(input: &str) -> Vec<Piece<'_>> {
+        // let parser = Parser::new();
+        let parser = Parser::new(input, None, None, true, ParseMode::Format);
+
+        parser.into_iter().collect()
+    }
+}
+
+#[repr(C)]
+pub struct PieceSlice {
+    base_ptr: *const Piece<'static /* FIXME: That's wrong */>,
+    len: usize,
+}
+
+#[no_mangle]
+pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
+    // FIXME: Add comment
+    let str = unsafe { CStr::from_ptr(input) };
+
+    // FIXME: No unwrap
+    let pieces = rust::collect_pieces(str.to_str().unwrap());
+
+    PieceSlice {
+        base_ptr: pieces.as_ptr(),
+        len: pieces.len(),
+    }
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER'
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (3 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 005/125] gccrs: libgrust: Add format_parser library Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-05  8:45   ` Inline 'gcc/rust/Make-lang.in:RUST_LIBDEPS' (was: [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER') Thomas Schwinge
  2024-08-01 14:56 ` [PATCH 007/125] gccrs: libgrust: Vendor Rust dependencies Arthur Cohen
                   ` (118 subsequent siblings)
  123 siblings, 1 reply; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <tschwinge@baylibre.com>

... to avoid verbatim repetition.

	gcc/rust/
	* Make-lang.in (LIBPROC_MACRO_INTERNAL): New.
	(RUST_LIBDEPS, crab1$(exeext), rust/libformat_parser.a): Use it.
---
 gcc/rust/Make-lang.in | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 8ac0d1d1973..bcf424e6c18 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -212,6 +212,9 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
 rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
 
 LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
+LIBFORMAT_PARSER = rust/libformat_parser.a
+
+RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
 
 
 RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
@@ -220,7 +223,7 @@ RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
 crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev)
 	@$(call LINK_PROGRESS,$(INDEX.rust),start)
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) rust/libformat_parser.a  $(BACKENDLIBS)
+	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
 	@$(call LINK_PROGRESS,$(INDEX.rust),end)
 
 # Build hooks.
@@ -411,9 +414,10 @@ rust/%.o: rust/lex/%.cc
 %.toml: 
 	echo $@
 
-rust/libformat_parser.a: $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
-	cargo build --manifest-path $(srcdir)/../libgrust/libformat_parser/Cargo.toml --release # FIXME: Not always release, right?
-	cp $(srcdir)/../libgrust/libformat_parser/target/release/liblibformat_parser.a $@
+# TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
+$(LIBFORMAT_PARSER): $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
+	cd $(srcdir)/../libgrust/libformat_parser && cargo build --offline  # FIXME: Not always release, right?
+	cp $(srcdir)/../libgrust/libformat_parser/target/debug/liblibformat_parser.a $@
 
 # build all rust/parse files in rust folder, add cross-folder includes
 rust/%.o: rust/parse/%.cc
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 007/125] gccrs: libgrust: Vendor Rust dependencies
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (4 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER' Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 008/125] Rust: Don't cache 'libformat_parser.a' Arthur Cohen
                   ` (117 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

This commits vendors and locks our dependencies so that our Rust components
do not need internet access to be built anymore. Tested in a docker container
with no network access.

We can think about merging the vendor directory once we have more than one
Rust component, e.g. when we add polonius to the mix.

libgrust/ChangeLog:

	* libformat_parser/.cargo/config: New file.
	* libformat_parser/vendor.NOTES: New file.
	* libformat_parser/vendor/libc/.cargo-checksum.json: New file.
	* libformat_parser/vendor/libc/CONTRIBUTING.md: New file.
	* libformat_parser/vendor/libc/Cargo.toml: New file.
	* libformat_parser/vendor/libc/LICENSE-APACHE: New file.
	* libformat_parser/vendor/libc/LICENSE-MIT: New file.
	* libformat_parser/vendor/libc/README.md: New file.
	* libformat_parser/vendor/libc/build.rs: New file.
	* libformat_parser/vendor/libc/rustfmt.toml: New file.
	* libformat_parser/vendor/libc/src/fixed_width_ints.rs: New file.
	* libformat_parser/vendor/libc/src/fuchsia/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/fuchsia/align.rs: New file.
	* libformat_parser/vendor/libc/src/fuchsia/mod.rs: New file.
	* libformat_parser/vendor/libc/src/fuchsia/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/fuchsia/riscv64.rs: New file.
	* libformat_parser/vendor/libc/src/fuchsia/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/hermit/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/hermit/mod.rs: New file.
	* libformat_parser/vendor/libc/src/hermit/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/lib.rs: New file.
	* libformat_parser/vendor/libc/src/macros.rs: New file.
	* libformat_parser/vendor/libc/src/psp.rs: New file.
	* libformat_parser/vendor/libc/src/sgx.rs: New file.
	* libformat_parser/vendor/libc/src/solid/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/solid/arm.rs: New file.
	* libformat_parser/vendor/libc/src/solid/mod.rs: New file.
	* libformat_parser/vendor/libc/src/switch.rs: New file.
	* libformat_parser/vendor/libc/src/teeos/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/aix/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/aix/powerpc64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b32/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b32/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/long_array.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/apple/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs: New file.
	* libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/haiku/b32.rs: New file.
	* libformat_parser/vendor/libc/src/unix/haiku/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/haiku/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/haiku/native.rs: New file.
	* libformat_parser/vendor/libc/src/unix/haiku/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/hurd/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/hurd/b32.rs: New file.
	* libformat_parser/vendor/libc/src/unix/hurd/b64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/hurd/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/hurd/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b32/arm.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b32/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/android/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/emscripten/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/emscripten/lfs64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/emscripten/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/emscripten/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs:
	New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs: New file.
	* libformat_parser/vendor/libc/src/unix/linux_like/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/aarch64/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/arm/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/espidf/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/generic.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/horizon/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/powerpc/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/newlib/vita/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/no_align.rs: New file.
	* libformat_parser/vendor/libc/src/unix/nto/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/nto/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/nto/neutrino.rs: New file.
	* libformat_parser/vendor/libc/src/unix/nto/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/redox/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/compat.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/illumos.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/mod.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/solaris.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/x86.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/unix/solarish/x86_common.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/aarch64.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/arm.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/mod.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/powerpc.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/powerpc64.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/x86.rs: New file.
	* libformat_parser/vendor/libc/src/vxworks/x86_64.rs: New file.
	* libformat_parser/vendor/libc/src/wasi.rs: New file.
	* libformat_parser/vendor/libc/src/windows/gnu/align.rs: New file.
	* libformat_parser/vendor/libc/src/windows/gnu/mod.rs: New file.
	* libformat_parser/vendor/libc/src/windows/mod.rs: New file.
	* libformat_parser/vendor/libc/src/windows/msvc/mod.rs: New file.
	* libformat_parser/vendor/libc/src/xous.rs: New file.
	* libformat_parser/vendor/libc/tests/const_fn.rs: New file.
	* libformat_parser/vendor/unicode-xid/.cargo-checksum.json: New file.
	* libformat_parser/vendor/unicode-xid/COPYRIGHT: New file.
	* libformat_parser/vendor/unicode-xid/Cargo.toml: New file.
	* libformat_parser/vendor/unicode-xid/LICENSE-APACHE: New file.
	* libformat_parser/vendor/unicode-xid/LICENSE-MIT: New file.
	* libformat_parser/vendor/unicode-xid/README.md: New file.
	* libformat_parser/vendor/unicode-xid/benches/xid.rs: New file.
	* libformat_parser/vendor/unicode-xid/src/lib.rs: New file.
	* libformat_parser/vendor/unicode-xid/src/tables.rs: New file.
	* libformat_parser/vendor/unicode-xid/src/tests.rs: New file.
	* libformat_parser/vendor/unicode-xid/tests/exhaustive_tests.rs: New file.
---
 libgrust/libformat_parser/.cargo/config       |    5 +
 libgrust/libformat_parser/vendor.NOTES        |    5 +
 .../vendor/libc/.cargo-checksum.json          |    1 +
 .../vendor/libc/CONTRIBUTING.md               |  100 +
 .../libformat_parser/vendor/libc/Cargo.toml   |  175 +
 .../vendor/libc/LICENSE-APACHE                |  176 +
 .../libformat_parser/vendor/libc/LICENSE-MIT  |   25 +
 .../libformat_parser/vendor/libc/README.md    |  118 +
 .../libformat_parser/vendor/libc/build.rs     |  297 +
 .../libformat_parser/vendor/libc/rustfmt.toml |    1 +
 .../vendor/libc/src/fixed_width_ints.rs       |   99 +
 .../vendor/libc/src/fuchsia/aarch64.rs        |   67 +
 .../vendor/libc/src/fuchsia/align.rs          |  142 +
 .../vendor/libc/src/fuchsia/mod.rs            | 4393 +++++++++++
 .../vendor/libc/src/fuchsia/no_align.rs       |  129 +
 .../vendor/libc/src/fuchsia/riscv64.rs        |   44 +
 .../vendor/libc/src/fuchsia/x86_64.rs         |  152 +
 .../vendor/libc/src/hermit/aarch64.rs         |    2 +
 .../vendor/libc/src/hermit/mod.rs             |   61 +
 .../vendor/libc/src/hermit/x86_64.rs          |    2 +
 .../libformat_parser/vendor/libc/src/lib.rs   |  165 +
 .../vendor/libc/src/macros.rs                 |  349 +
 .../libformat_parser/vendor/libc/src/psp.rs   | 4177 +++++++++++
 .../libformat_parser/vendor/libc/src/sgx.rs   |   47 +
 .../vendor/libc/src/solid/aarch64.rs          |    4 +
 .../vendor/libc/src/solid/arm.rs              |    4 +
 .../vendor/libc/src/solid/mod.rs              |  904 +++
 .../vendor/libc/src/switch.rs                 |   49 +
 .../vendor/libc/src/teeos/mod.rs              | 1385 ++++
 .../vendor/libc/src/unix/aix/mod.rs           | 3362 +++++++++
 .../vendor/libc/src/unix/aix/powerpc64.rs     |  644 ++
 .../vendor/libc/src/unix/align.rs             |    6 +
 .../libc/src/unix/bsd/apple/b32/align.rs      |    7 +
 .../vendor/libc/src/unix/bsd/apple/b32/mod.rs |  119 +
 .../src/unix/bsd/apple/b64/aarch64/align.rs   |   55 +
 .../src/unix/bsd/apple/b64/aarch64/mod.rs     |   14 +
 .../libc/src/unix/bsd/apple/b64/align.rs      |    7 +
 .../vendor/libc/src/unix/bsd/apple/b64/mod.rs |  124 +
 .../src/unix/bsd/apple/b64/x86_64/align.rs    |    7 +
 .../libc/src/unix/bsd/apple/b64/x86_64/mod.rs |  180 +
 .../libc/src/unix/bsd/apple/long_array.rs     |    8 +
 .../vendor/libc/src/unix/bsd/apple/mod.rs     | 6528 +++++++++++++++++
 .../unix/bsd/freebsdlike/dragonfly/errno.rs   |   13 +
 .../src/unix/bsd/freebsdlike/dragonfly/mod.rs | 1732 +++++
 .../unix/bsd/freebsdlike/freebsd/aarch64.rs   |  146 +
 .../src/unix/bsd/freebsdlike/freebsd/arm.rs   |   50 +
 .../bsd/freebsdlike/freebsd/freebsd11/b64.rs  |   32 +
 .../bsd/freebsdlike/freebsd/freebsd11/mod.rs  |  488 ++
 .../bsd/freebsdlike/freebsd/freebsd12/b64.rs  |   34 +
 .../bsd/freebsdlike/freebsd/freebsd12/mod.rs  |  505 ++
 .../freebsdlike/freebsd/freebsd12/x86_64.rs   |    5 +
 .../bsd/freebsdlike/freebsd/freebsd13/b64.rs  |   34 +
 .../bsd/freebsdlike/freebsd/freebsd13/mod.rs  |  546 ++
 .../freebsdlike/freebsd/freebsd13/x86_64.rs   |    5 +
 .../bsd/freebsdlike/freebsd/freebsd14/b64.rs  |   34 +
 .../bsd/freebsdlike/freebsd/freebsd14/mod.rs  |  546 ++
 .../freebsdlike/freebsd/freebsd14/x86_64.rs   |   12 +
 .../bsd/freebsdlike/freebsd/freebsd15/b64.rs  |   34 +
 .../bsd/freebsdlike/freebsd/freebsd15/mod.rs  |  546 ++
 .../freebsdlike/freebsd/freebsd15/x86_64.rs   |   12 +
 .../src/unix/bsd/freebsdlike/freebsd/mod.rs   | 5758 +++++++++++++++
 .../unix/bsd/freebsdlike/freebsd/powerpc.rs   |   47 +
 .../unix/bsd/freebsdlike/freebsd/powerpc64.rs |   47 +
 .../unix/bsd/freebsdlike/freebsd/riscv64.rs   |  154 +
 .../src/unix/bsd/freebsdlike/freebsd/x86.rs   |  201 +
 .../bsd/freebsdlike/freebsd/x86_64/align.rs   |  197 +
 .../bsd/freebsdlike/freebsd/x86_64/mod.rs     |  334 +
 .../libc/src/unix/bsd/freebsdlike/mod.rs      | 1918 +++++
 .../vendor/libc/src/unix/bsd/mod.rs           |  932 +++
 .../libc/src/unix/bsd/netbsdlike/mod.rs       |  863 +++
 .../src/unix/bsd/netbsdlike/netbsd/aarch64.rs |  162 +
 .../src/unix/bsd/netbsdlike/netbsd/arm.rs     |   81 +
 .../src/unix/bsd/netbsdlike/netbsd/mips.rs    |   21 +
 .../src/unix/bsd/netbsdlike/netbsd/mod.rs     | 3148 ++++++++
 .../src/unix/bsd/netbsdlike/netbsd/powerpc.rs |   21 +
 .../src/unix/bsd/netbsdlike/netbsd/riscv64.rs |   21 +
 .../src/unix/bsd/netbsdlike/netbsd/sparc64.rs |    8 +
 .../src/unix/bsd/netbsdlike/netbsd/x86.rs     |   15 +
 .../src/unix/bsd/netbsdlike/netbsd/x86_64.rs  |   67 +
 .../unix/bsd/netbsdlike/openbsd/aarch64.rs    |   30 +
 .../src/unix/bsd/netbsdlike/openbsd/arm.rs    |   16 +
 .../src/unix/bsd/netbsdlike/openbsd/mips64.rs |    8 +
 .../src/unix/bsd/netbsdlike/openbsd/mod.rs    | 2209 ++++++
 .../unix/bsd/netbsdlike/openbsd/powerpc.rs    |   16 +
 .../unix/bsd/netbsdlike/openbsd/powerpc64.rs  |   16 +
 .../unix/bsd/netbsdlike/openbsd/riscv64.rs    |   35 +
 .../unix/bsd/netbsdlike/openbsd/sparc64.rs    |    8 +
 .../src/unix/bsd/netbsdlike/openbsd/x86.rs    |   16 +
 .../src/unix/bsd/netbsdlike/openbsd/x86_64.rs |  130 +
 .../vendor/libc/src/unix/haiku/b32.rs         |   20 +
 .../vendor/libc/src/unix/haiku/b64.rs         |   20 +
 .../vendor/libc/src/unix/haiku/mod.rs         | 2105 ++++++
 .../vendor/libc/src/unix/haiku/native.rs      | 1488 ++++
 .../vendor/libc/src/unix/haiku/x86_64.rs      |  264 +
 .../vendor/libc/src/unix/hurd/align.rs        |    1 +
 .../vendor/libc/src/unix/hurd/b32.rs          |   93 +
 .../vendor/libc/src/unix/hurd/b64.rs          |   95 +
 .../vendor/libc/src/unix/hurd/mod.rs          | 4687 ++++++++++++
 .../vendor/libc/src/unix/hurd/no_align.rs     |    1 +
 .../src/unix/linux_like/android/b32/arm.rs    |  550 ++
 .../src/unix/linux_like/android/b32/mod.rs    |  244 +
 .../unix/linux_like/android/b32/x86/align.rs  |    7 +
 .../unix/linux_like/android/b32/x86/mod.rs    |  622 ++
 .../linux_like/android/b64/aarch64/align.rs   |   29 +
 .../linux_like/android/b64/aarch64/int128.rs  |    7 +
 .../linux_like/android/b64/aarch64/mod.rs     |  430 ++
 .../src/unix/linux_like/android/b64/mod.rs    |  355 +
 .../linux_like/android/b64/riscv64/align.rs   |    7 +
 .../linux_like/android/b64/riscv64/mod.rs     |  353 +
 .../linux_like/android/b64/x86_64/align.rs    |    7 +
 .../unix/linux_like/android/b64/x86_64/mod.rs |  802 ++
 .../libc/src/unix/linux_like/android/mod.rs   | 4143 +++++++++++
 .../src/unix/linux_like/emscripten/align.rs   |   74 +
 .../src/unix/linux_like/emscripten/lfs64.rs   |  213 +
 .../src/unix/linux_like/emscripten/mod.rs     | 1794 +++++
 .../unix/linux_like/emscripten/no_align.rs    |   63 +
 .../libc/src/unix/linux_like/linux/align.rs   |  205 +
 .../unix/linux_like/linux/arch/generic/mod.rs |  329 +
 .../unix/linux_like/linux/arch/mips/mod.rs    |  323 +
 .../src/unix/linux_like/linux/arch/mod.rs     |   18 +
 .../unix/linux_like/linux/arch/powerpc/mod.rs |  277 +
 .../unix/linux_like/linux/arch/sparc/mod.rs   |  259 +
 .../src/unix/linux_like/linux/gnu/align.rs    |   13 +
 .../linux_like/linux/gnu/b32/arm/align.rs     |   53 +
 .../unix/linux_like/linux/gnu/b32/arm/mod.rs  |  864 +++
 .../linux_like/linux/gnu/b32/csky/align.rs    |    7 +
 .../unix/linux_like/linux/gnu/b32/csky/mod.rs |  741 ++
 .../linux_like/linux/gnu/b32/m68k/align.rs    |    7 +
 .../unix/linux_like/linux/gnu/b32/m68k/mod.rs |  850 +++
 .../linux_like/linux/gnu/b32/mips/align.rs    |    7 +
 .../unix/linux_like/linux/gnu/b32/mips/mod.rs |  819 +++
 .../src/unix/linux_like/linux/gnu/b32/mod.rs  |  361 +
 .../unix/linux_like/linux/gnu/b32/powerpc.rs  |  825 +++
 .../linux_like/linux/gnu/b32/riscv32/align.rs |   44 +
 .../linux_like/linux/gnu/b32/riscv32/mod.rs   |  813 ++
 .../linux_like/linux/gnu/b32/sparc/align.rs   |    7 +
 .../linux_like/linux/gnu/b32/sparc/mod.rs     |  857 +++
 .../linux_like/linux/gnu/b32/x86/align.rs     |    7 +
 .../unix/linux_like/linux/gnu/b32/x86/mod.rs  | 1100 +++
 .../linux_like/linux/gnu/b64/aarch64/align.rs |   51 +
 .../linux/gnu/b64/aarch64/fallback.rs         |    8 +
 .../linux_like/linux/gnu/b64/aarch64/ilp32.rs |   64 +
 .../linux/gnu/b64/aarch64/int128.rs           |    7 +
 .../linux_like/linux/gnu/b64/aarch64/lp64.rs  |   73 +
 .../linux_like/linux/gnu/b64/aarch64/mod.rs   |  937 +++
 .../linux/gnu/b64/loongarch64/align.rs        |   40 +
 .../linux/gnu/b64/loongarch64/mod.rs          |  900 +++
 .../linux_like/linux/gnu/b64/mips64/align.rs  |    7 +
 .../linux_like/linux/gnu/b64/mips64/mod.rs    |  934 +++
 .../src/unix/linux_like/linux/gnu/b64/mod.rs  |  128 +
 .../linux/gnu/b64/powerpc64/align.rs          |    7 +
 .../linux_like/linux/gnu/b64/powerpc64/mod.rs |  979 +++
 .../linux_like/linux/gnu/b64/riscv64/align.rs |   44 +
 .../linux_like/linux/gnu/b64/riscv64/mod.rs   |  852 +++
 .../unix/linux_like/linux/gnu/b64/s390x.rs    |  964 +++
 .../linux_like/linux/gnu/b64/sparc64/align.rs |    7 +
 .../linux_like/linux/gnu/b64/sparc64/mod.rs   |  931 +++
 .../linux_like/linux/gnu/b64/x86_64/align.rs  |   24 +
 .../linux_like/linux/gnu/b64/x86_64/mod.rs    |  824 +++
 .../linux/gnu/b64/x86_64/not_x32.rs           |  451 ++
 .../linux_like/linux/gnu/b64/x86_64/x32.rs    |  404 +
 .../libc/src/unix/linux_like/linux/gnu/mod.rs | 1593 ++++
 .../src/unix/linux_like/linux/gnu/no_align.rs |   10 +
 .../libc/src/unix/linux_like/linux/mod.rs     | 5687 ++++++++++++++
 .../linux_like/linux/musl/b32/arm/align.rs    |    7 +
 .../unix/linux_like/linux/musl/b32/arm/mod.rs |  853 +++
 .../unix/linux_like/linux/musl/b32/hexagon.rs |  667 ++
 .../linux_like/linux/musl/b32/mips/align.rs   |    7 +
 .../linux_like/linux/musl/b32/mips/mod.rs     |  788 ++
 .../src/unix/linux_like/linux/musl/b32/mod.rs |   65 +
 .../unix/linux_like/linux/musl/b32/powerpc.rs |  802 ++
 .../linux/musl/b32/riscv32/align.rs           |    7 +
 .../linux_like/linux/musl/b32/riscv32/mod.rs  |  798 ++
 .../linux_like/linux/musl/b32/x86/align.rs    |    7 +
 .../unix/linux_like/linux/musl/b32/x86/mod.rs |  968 +++
 .../linux/musl/b64/aarch64/align.rs           |   42 +
 .../linux/musl/b64/aarch64/int128.rs          |    7 +
 .../linux_like/linux/musl/b64/aarch64/mod.rs  |  658 ++
 .../unix/linux_like/linux/musl/b64/mips64.rs  |  688 ++
 .../src/unix/linux_like/linux/musl/b64/mod.rs |  163 +
 .../linux_like/linux/musl/b64/powerpc64.rs    |  695 ++
 .../linux/musl/b64/riscv64/align.rs           |   44 +
 .../linux_like/linux/musl/b64/riscv64/mod.rs  |  727 ++
 .../unix/linux_like/linux/musl/b64/s390x.rs   |  724 ++
 .../linux_like/linux/musl/b64/x86_64/align.rs |   25 +
 .../linux_like/linux/musl/b64/x86_64/mod.rs   |  915 +++
 .../src/unix/linux_like/linux/musl/lfs64.rs   |  241 +
 .../src/unix/linux_like/linux/musl/mod.rs     |  927 +++
 .../src/unix/linux_like/linux/no_align.rs     |  144 +
 .../unix/linux_like/linux/non_exhaustive.rs   |    9 +
 .../src/unix/linux_like/linux/uclibc/align.rs |   28 +
 .../unix/linux_like/linux/uclibc/arm/align.rs |   13 +
 .../unix/linux_like/linux/uclibc/arm/mod.rs   |  925 +++
 .../linux_like/linux/uclibc/arm/no_align.rs   |   10 +
 .../linux/uclibc/mips/mips32/align.rs         |   13 +
 .../linux/uclibc/mips/mips32/mod.rs           |  692 ++
 .../linux/uclibc/mips/mips32/no_align.rs      |   10 +
 .../linux/uclibc/mips/mips64/align.rs         |   10 +
 .../linux/uclibc/mips/mips64/mod.rs           |  207 +
 .../linux/uclibc/mips/mips64/no_align.rs      |    7 +
 .../unix/linux_like/linux/uclibc/mips/mod.rs  |  310 +
 .../src/unix/linux_like/linux/uclibc/mod.rs   |  392 +
 .../unix/linux_like/linux/uclibc/no_align.rs  |   53 +
 .../linux_like/linux/uclibc/x86_64/l4re.rs    |   53 +
 .../linux_like/linux/uclibc/x86_64/mod.rs     |  345 +
 .../linux_like/linux/uclibc/x86_64/other.rs   |    5 +
 .../vendor/libc/src/unix/linux_like/mod.rs    | 1899 +++++
 .../vendor/libc/src/unix/mod.rs               | 1616 ++++
 .../libc/src/unix/newlib/aarch64/mod.rs       |   54 +
 .../vendor/libc/src/unix/newlib/align.rs      |   61 +
 .../vendor/libc/src/unix/newlib/arm/mod.rs    |   56 +
 .../vendor/libc/src/unix/newlib/espidf/mod.rs |  110 +
 .../vendor/libc/src/unix/newlib/generic.rs    |   33 +
 .../libc/src/unix/newlib/horizon/mod.rs       |  270 +
 .../vendor/libc/src/unix/newlib/mod.rs        |  798 ++
 .../vendor/libc/src/unix/newlib/no_align.rs   |   51 +
 .../libc/src/unix/newlib/powerpc/mod.rs       |   16 +
 .../vendor/libc/src/unix/newlib/vita/mod.rs   |  234 +
 .../vendor/libc/src/unix/no_align.rs          |    6 +
 .../vendor/libc/src/unix/nto/aarch64.rs       |   36 +
 .../vendor/libc/src/unix/nto/mod.rs           | 3508 +++++++++
 .../vendor/libc/src/unix/nto/neutrino.rs      | 1288 ++++
 .../vendor/libc/src/unix/nto/x86_64.rs        |  132 +
 .../vendor/libc/src/unix/redox/mod.rs         | 1416 ++++
 .../vendor/libc/src/unix/solarish/compat.rs   |  220 +
 .../vendor/libc/src/unix/solarish/illumos.rs  |   88 +
 .../vendor/libc/src/unix/solarish/mod.rs      | 3309 +++++++++
 .../vendor/libc/src/unix/solarish/solaris.rs  |  101 +
 .../vendor/libc/src/unix/solarish/x86.rs      |   29 +
 .../vendor/libc/src/unix/solarish/x86_64.rs   |  190 +
 .../libc/src/unix/solarish/x86_common.rs      |   65 +
 .../vendor/libc/src/vxworks/aarch64.rs        |    4 +
 .../vendor/libc/src/vxworks/arm.rs            |    4 +
 .../vendor/libc/src/vxworks/mod.rs            | 1947 +++++
 .../vendor/libc/src/vxworks/powerpc.rs        |    4 +
 .../vendor/libc/src/vxworks/powerpc64.rs      |    4 +
 .../vendor/libc/src/vxworks/x86.rs            |    4 +
 .../vendor/libc/src/vxworks/x86_64.rs         |    4 +
 .../libformat_parser/vendor/libc/src/wasi.rs  |  831 +++
 .../vendor/libc/src/windows/gnu/align.rs      |   19 +
 .../vendor/libc/src/windows/gnu/mod.rs        |   23 +
 .../vendor/libc/src/windows/mod.rs            |  601 ++
 .../vendor/libc/src/windows/msvc/mod.rs       |   20 +
 .../libformat_parser/vendor/libc/src/xous.rs  |   49 +
 .../vendor/libc/tests/const_fn.rs             |    5 +
 .../vendor/unicode-xid/.cargo-checksum.json   |    1 +
 .../vendor/unicode-xid/COPYRIGHT              |    7 +
 .../vendor/unicode-xid/Cargo.toml             |   51 +
 .../vendor/unicode-xid/LICENSE-APACHE         |  201 +
 .../vendor/unicode-xid/LICENSE-MIT            |   25 +
 .../vendor/unicode-xid/README.md              |   53 +
 .../vendor/unicode-xid/benches/xid.rs         |   60 +
 .../vendor/unicode-xid/src/lib.rs             |   92 +
 .../vendor/unicode-xid/src/tables.rs          | 1494 ++++
 .../vendor/unicode-xid/src/tests.rs           |   95 +
 .../unicode-xid/tests/exhaustive_tests.rs     |   25 +
 256 files changed, 123838 insertions(+)
 create mode 100644 libgrust/libformat_parser/.cargo/config
 create mode 100644 libgrust/libformat_parser/vendor.NOTES
 create mode 100644 libgrust/libformat_parser/vendor/libc/.cargo-checksum.json
 create mode 100644 libgrust/libformat_parser/vendor/libc/CONTRIBUTING.md
 create mode 100644 libgrust/libformat_parser/vendor/libc/Cargo.toml
 create mode 100644 libgrust/libformat_parser/vendor/libc/LICENSE-APACHE
 create mode 100644 libgrust/libformat_parser/vendor/libc/LICENSE-MIT
 create mode 100644 libgrust/libformat_parser/vendor/libc/README.md
 create mode 100644 libgrust/libformat_parser/vendor/libc/build.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/rustfmt.toml
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fixed_width_ints.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fuchsia/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fuchsia/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fuchsia/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fuchsia/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fuchsia/riscv64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/fuchsia/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/hermit/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/hermit/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/hermit/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/lib.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/macros.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/psp.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/sgx.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/solid/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/solid/arm.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/solid/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/switch.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/teeos/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/aix/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/aix/powerpc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/long_array.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/haiku/b32.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/haiku/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/haiku/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/haiku/native.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/haiku/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/hurd/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/hurd/b32.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/hurd/b64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/hurd/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/hurd/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/arm.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/lfs64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/linux_like/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/aarch64/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/arm/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/espidf/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/generic.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/horizon/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/powerpc/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/newlib/vita/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/no_align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/nto/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/nto/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/nto/neutrino.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/nto/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/redox/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/compat.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/illumos.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/solaris.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_common.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/aarch64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/arm.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/x86.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/vxworks/x86_64.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/wasi.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/windows/gnu/align.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/windows/gnu/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/windows/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/windows/msvc/mod.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/src/xous.rs
 create mode 100644 libgrust/libformat_parser/vendor/libc/tests/const_fn.rs
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/.cargo-checksum.json
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/COPYRIGHT
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/Cargo.toml
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/LICENSE-APACHE
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/LICENSE-MIT
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/README.md
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/benches/xid.rs
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/src/lib.rs
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/src/tables.rs
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/src/tests.rs
 create mode 100644 libgrust/libformat_parser/vendor/unicode-xid/tests/exhaustive_tests.rs

diff --git a/libgrust/libformat_parser/.cargo/config b/libgrust/libformat_parser/.cargo/config
new file mode 100644
index 00000000000..02369289646
--- /dev/null
+++ b/libgrust/libformat_parser/.cargo/config
@@ -0,0 +1,5 @@
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "vendor"
diff --git a/libgrust/libformat_parser/vendor.NOTES b/libgrust/libformat_parser/vendor.NOTES
new file mode 100644
index 00000000000..371b132d93d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor.NOTES
@@ -0,0 +1,5 @@
+All of the Rust crates within libgrust should vendor their dependencies in order to allow cargo to build these crates without an internet connection.
+
+This can be achieved with the `cargo vendor` subcommand, available by default on modern version of `cargo`.
+
+If you update a dependency, remember to re-run `cargo vendor` in order to download the updated version of this library. This should be checked by `cargo build --offline` in our CI anyway, so there isn't much risk.
diff --git a/libgrust/libformat_parser/vendor/libc/.cargo-checksum.json b/libgrust/libformat_parser/vendor/libc/.cargo-checksum.json
new file mode 100644
index 00000000000..2ff314778c7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"CONTRIBUTING.md":"a93fcda0a76e1975fcfb0aa2ba00c9b1864f9ae6062704a294d81a3688898e10","Cargo.toml":"0d743c123c9c30b09413dce51344d4dfaf958e8eef3e1f4e7682931a8d781ec3","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"4da2919bb509f3f06163778478494f780ca6627cb79ccab5d2c828c8d88dc133","build.rs":"01bc1b8934bb80982a36f46c61508f32cb05c4deab15cb9afb5bf9da285d5c1b","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"893fcec48142d273063ffd814dca33fbec92205fd39ada97075f85201d803996","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"07410f511835da540e5bdc55f7384c71cd7836fe63bbca6be547de825f823c03","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/riscv64.rs":"617cd75e79e0e20f664db764a4dc2a396d9fd11a4d95371acd91ed4811293b11","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"2d04cfa0d55dc0a2e36fdc4a45819b9d3722af19bb1932778b44feb4c2f81036","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"9d7030ba3e21064a0f3a8e79927c70d5a95a0026be61be084f3ab021e243e503","src/macros.rs":"5f985b3de7b18833f866bf832b8ffb0430f0f70aa9a468b6a2c855c1bf9d33e4","src/psp.rs":"0a7d5121a8cc2903009f586c00e4ae2d6126d24eb90531dafaba6f59823aa6b2","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/teeos/mod.rs":"eb664b3e94bcd44d8c8147b56c2187139d01bf8402ee0bb81967a5a50a3e927f","src/unix/aix/mod.rs":"d4ed2a4eff43c60a251bba150868d0249bf79dd6fb835d5287c352577452712b","src/unix/aix/powerpc64.rs":"cf374d81139d45f9d77c6a764f640bfbf7e0a5903689652c8296f8e10d55169b","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"2eaf0f561a32bdcbf4e0477c8895d5e7bcb5cdebd5fef7b4df2ca8e38e144d94","src/unix/bsd/apple/b64/aarch64/mod.rs":"44c217a4f263afe7a97435de9323d20a96c37836f899ca0925306d4b7e073c27","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/long_array.rs":"3cf1f19b812e6d093c819dc65ce55b13491963e0780eda0d0bd1577603e81948","src/unix/bsd/apple/mod.rs":"1da404688e9d67171403f2486456aac9d36a2db31ee7ebc308f14d6277754eef","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"2777f94909a798df1b8030fb86d02e2118d0ac3e49e9a542df54a569ca5ae2f9","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"6c8e216385f53a4bf5f171749b57602fc34a4e4b160a44ca31c058cb0c8a2126","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"e243ae0e89623d4fa9f85afe14369cc5fd5f2028ea715773dbec722ba80dac1f","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"bef9fae288a4f29e941ea369be1cd20b170040e60665a4d49a4a9e79009b72d8","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"88be47524b28b6635ccb1e85ea511bf17337be0af7e9baa740c341ac9e83a6f7","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"6ddc6abf6d5ccaea0d8cccf521e8ca6457efcad3086af4155628d5d06d672346","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs":"93115c1a9faa43ebf58b7dee3582aed5a54291b284764e370e7f649b2e6a9565","src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs":"e7b5863e222d6cc416b6b0fbe71690fad909e899b4c4ae810bbca117e4fcb650","src/unix/bsd/freebsdlike/freebsd/mod.rs":"5669c341804bccf27eb03965f11bd640a762a9898a5baa18b5a319fb1d8abddf","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"fa4bed4c58cad24ba3395941c7fa6b11e089551a04714f9561078e400f5b2b62","src/unix/bsd/freebsdlike/freebsd/x86.rs":"6766e2ce85e187b306cd3b0b8d7e15b8f4042c5cff81d89b3af69ecc99c70ab0","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"29f5ae7c8bcd64219e77f99ba9b26527299cf4908b20f7d1ec4f625b5194a44c","src/unix/bsd/mod.rs":"f5974098ef3d1a29774bc0bde27dc9c89c3880f9ed7b4d7ea334b595dc39ff94","src/unix/bsd/netbsdlike/mod.rs":"ea60540aa4edd4e43136749d5df497b1dc072b9912b6030dd1ab794a6d1c3c3c","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"057ee877db7193ba0dc10801b9a6563ac6dbdb78376d6851a84cb12b30841759","src/unix/bsd/netbsdlike/netbsd/arm.rs":"949b55e4dee1c8c511f4f061a6a57ac876a6c0eabfaf5cc20e9ab40d8f41b2e0","src/unix/bsd/netbsdlike/netbsd/mips.rs":"88be18ac43ba224c77e78e4179b6761debc5e6c30a258fac56263809c7af4fbc","src/unix/bsd/netbsdlike/netbsd/mod.rs":"b8d6f089fc8eb2cb59e45335a26c9ce871b846216c9859b553c6b91982f8de33","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/riscv64.rs":"1cbe2e5ed681cb1054b699da37daaf6c714267df7d332c90fc2a589b11579625","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"532b76199d6c71ff996eade9f906c55a72c9aff489595d25a21e21878cfd740b","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"7b93b5b24b3c72a79b2de19b47ac2f56b29d87e9fc8f4c721a63d1e87ec83fcc","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1fe3332dc705a13e6242219970f5449d6d7a73e2e6c8537ab8e421d8a6f2e3ff","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"ad70cc42ed83ac38664941418b0b9bfe1ead7a0ff82b121ea8df65483e3b7e1c","src/unix/haiku/native.rs":"3bbf42c3e3e437e8b626be67c72b6adcec60646eb5dd4bf8471a603cbbb5e5a4","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hurd/align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/hurd/b32.rs":"2ba90ed973f90366c36a6387833a3df42abfee9622d4a0352635937d4a89eaf4","src/unix/hurd/b64.rs":"d919b4aec9b3080ad24c125c57b2c8b2e483d72045f1554c429d14560355846f","src/unix/hurd/mod.rs":"6a2f0db80a3cd34b55ef82e357da4d453d5d190a2dd4501bfa5d0bb9bca0de4f","src/unix/hurd/no_align.rs":"03c79b2cd8270ebd0cf93cb475a8f1ff85b28175ea0de007ede17cad94a89b03","src/unix/linux_like/android/b32/arm.rs":"ce582de7e983a33d3bfad13075c53aac9016cee35f06ad8653ee9072c3ec2564","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"e6d107efbcd37b5b85dfa18f683300cbf768ffa0237997a9fa52b184a53323ac","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"10e963e29ff209703de6336c99cca96fd79789438d34c82a693eae56e8916c3c","src/unix/linux_like/android/b64/mod.rs":"71e4fcbe952bfa4a5f9022f3972e906917b38f729b9d8ef57cd5d179104894ac","src/unix/linux_like/android/b64/riscv64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/android/b64/riscv64/mod.rs":"19d4bf2237c47127eba9144e0b82e995bc079315e719179a91813b0ae7b0e49d","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"4ec2de11a9b65c4325b7b991f0b99a414975e0e61ba8668caca5d921e9b314d1","src/unix/linux_like/android/mod.rs":"e7e87cb2aa2665a7113e3cbcad58c6b4c8a04c9989a6773895b5ecc806348258","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/lfs64.rs":"3776af30a758d765a88920ec4fde442ab89040da13d3b3625c7fbcb8a958559f","src/unix/linux_like/emscripten/mod.rs":"70d4591730a731ee32788a9d8d2de379592844ec36b7d1723514179605587713","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"bc5abcd38e2320171e0981e773c9c5fe3e0d5a66fdff049228f6a1acad80ef8b","src/unix/linux_like/linux/arch/generic/mod.rs":"ebb6a0a96bcbfbe3432bf67d88ea5d006ccb47f345dab33562bb052d110a6946","src/unix/linux_like/linux/arch/mips/mod.rs":"18dade308bf04717630fd6467b92c23560c83ac5274a8469569f260aa4671239","src/unix/linux_like/linux/arch/mod.rs":"5bd5361f8a6ab4e18bbba6da9f92c164ae252b15a0ed10064812544aa1fdf198","src/unix/linux_like/linux/arch/powerpc/mod.rs":"0bc2d2667a00eca81f4abeb6d613a90848a947f51224103f83268928b8197629","src/unix/linux_like/linux/arch/sparc/mod.rs":"5e6777863e74a9e2aa9dc487f1059783dd211babc2b32d6bf676f311e49c55d6","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"f68ec59b6407f9d4e326f3e71a41ec21f19ecfc703edf9a93e496f661fed5506","src/unix/linux_like/linux/gnu/b32/csky/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/csky/mod.rs":"8729b68e433e94c2128e51a7db4fd555938e4be4dc64584c352b24a20d9c8e91","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"80956d3fef163ecf248828a6f38782dd8ae856d86b1bb5aac2de36032dbd8ea0","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"96e22350d5d132d917c743d6560464500652c67b52c3d0e8474494487df3365d","src/unix/linux_like/linux/gnu/b32/mod.rs":"b56625dd20dd48a8699034d349ef089c540c0ddcbf8a3481d598d101f8b40b78","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"20fc3cc4fe1ef6617b63b61b897f782ceb9c2842fc718f504a1840537229bf47","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"887288a0a1cfff319d0e15edcdc4fcb31fd643ff41715ec5244c8f2413624169","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"cc4342b949e4d796f304acd9dfe3f721a1c2f37fec16b42d3bb27dc94723af37","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"06d4db4ee8352f62a0a5ead0c4d6ea0a78feff522f19b9bc5772f6dd920ffd80","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"fdf1c72375a2167699157e0dd825422690bb6719f7bc69515a2e5846d0431d7c","src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs":"832e7487249c1c0bb6e9911ce3f7d32ca22378e42392ab83c56915cbc59d8be3","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"bf4611b737813deef6787babf6c01698605f3b75482269b8546318667bc68e29","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"11a950697fdda0258c6e37c6b13993348c8de4134105ed4faa79358e53175072","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"8202614484da36c388d2ffdd2554c56bb4f9db8e5bd621f8c36114cdcfeec644","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"060aa33cc737966c691aab8511c5c5729e551458ce18d0e284e0d45f39beeb60","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"dc29dfdadd754ec355b82a7ca6636de7ed97f7ba98f132b71cb49f39d6bd8e3f","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"73532be4b5775acf9524c77feeefe1f6d1936ceffef908d01dd2586986520f2d","src/unix/linux_like/linux/gnu/b64/mod.rs":"6a160ef25439c4fecdb0e3bd0b818742263c791364da874d4febd3aa644ec8e2","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"a90c2641616c620e9d1fea87695ce046e14f9da2282bb93f761eeb4077c74741","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"68a2a20fa4ef92cdf382d8095168eb88875b7aa8c9c47ee5f1e527393b6c16fa","src/unix/linux_like/linux/gnu/b64/s390x.rs":"1ea9e39432ce6bf68779d33546dacd7d39477a9f8fc3da4f4f339e4538cb74c3","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"bed381c44cec2a5b50125f7e548ab487d4c829006c971d152a611b7141760052","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"62e822478356db4a73b6bbd1b36d825b893939ab4b308ec11b0578bcc4b49769","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"332846e4a5920d7e6b05df0448a2333c5dd00fb27cb33654648f507ee89dbec5","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"38f74ce15d9662ce4818815a2b87be1618d5e45f190f7e4db84ff3285b4421fb","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"b20218a11364a6dec87f96d6c0d8b19e660697ab09ad5ee0e9b3a9dafedaaebb","src/unix/linux_like/linux/gnu/mod.rs":"583d04f92435da76fd3f87182ab67b5e6dd8c35a63b240d8c4555fb1ab70f3f8","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"e5000a0746c354b26e3c469ed7802a86a7bcca67446047c4e2d5526ea80c4d32","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"af10147d7c3661751750a58ffad089d5d18d180cd18303c653aef126c07ccd91","src/unix/linux_like/linux/musl/b32/hexagon.rs":"d079cab42529f7dab699334d43168c74ff4aa0282f11040a8b7d274b65767a7a","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"e44043766f7cd26de7ffa4232654afb6feb03e58dbd5890717970887bd003151","src/unix/linux_like/linux/musl/b32/mod.rs":"31677597fd9544c4b1ec1477628288f6273fabbc06e38f33da862ad55f019ce1","src/unix/linux_like/linux/musl/b32/powerpc.rs":"3dae56a4e7789bcc5314e419fea5e4b2495367b4f1a49d1c9477c60225d65eef","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"3ee845d272f91a1908d5f421d7c353e1f14681bbdfef64410e408f4c14365a91","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"f2b53ae0034c833244b7cdb8c670349bf8272a03abf04152eba65cf62810484d","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"6ba32725d24d7d8e6aa111f3b57aafa318f83b606abe96561329151829821133","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"45ce6897afcc960267bb7505702b639daf94dc69428a213bf1aefd367ca32adc","src/unix/linux_like/linux/musl/b64/mips64.rs":"a968ef9c54fa22293085f318c8472c1754482df92cc500568dc33bd807d71ea6","src/unix/linux_like/linux/musl/b64/mod.rs":"1a8391febf3e750185ffc5c69c9f9e411f4e8c53b5d994cb231df24480169686","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"140e579800a67315f4cb8a42b22aa8157eae34ffe626e77e421b43c53c23b34d","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"c5944526d7e19cd43e9d14d119a1d98f8780db7ecbcc79e69d7b9348e596b520","src/unix/linux_like/linux/musl/b64/s390x.rs":"8557b3477ca8cefef7fce764a3c25441929a54e50ead4091f6f7823c427cd728","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"77309276ad7a42cbe59ca381f23590b7a143aded05555b34a5b307b808cbca6e","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"a91c4f18027c9958037f78ae48f6352d23cb4e6f2995b2cc8de7dce0e5759470","src/unix/linux_like/linux/musl/lfs64.rs":"3e4fb381f3a0756520bde0f1692d4fa45e4ae8133bf7d7c64b0e3fdd512f235f","src/unix/linux_like/linux/musl/mod.rs":"f0a23b77e5465c05a5dd95c3c6b7959c597010416226503ff3719796367ba98e","src/unix/linux_like/linux/no_align.rs":"62cdca0e011937aaf09a51ca86d9f0ee0fdb05f61ec3c058e6a5d5fa6357d784","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"50288ff9e411ab0966da24838f2c2a5618021bc19c422a04f577b2979ef4081e","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"d0c4434e2bf813372c418a8f516c706cdccc9f7be2f0921b2207b0afdb66fe81","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"3f38ee6a4690b9d7594be20d216467a34d955f7653c2c8ce1e6147daeb53f1e0","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"a048fce1c2d9b1ad57305642e8ad05ca0f0c7e4753267a2e2d6b4fee5db3b072","src/unix/linux_like/linux/uclibc/mod.rs":"193a03fa4aa5345394e39d2115c9427e806c9f28b0fde685719119e1c90ca08a","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"8485b9182b7c67f7344fab377e7cc2a72afefd9ab63837c860514abba9728d76","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"196d03affbefb85716937c15904831e731eb222ee906e05e42102d639a8152ea","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"86dbbd81484df25ad7c6a82d2d3b5eab2f8e7751853c1dd4308b7eee57b5fbca","src/unix/mod.rs":"923a32e8fd9e462eda4e90ae7ee501da1d12aaadc1bf2e9722f02581a5d3fc6c","src/unix/newlib/aarch64/mod.rs":"964c096288da836b53c0c71d7f3a97048d177da220a69314c5ce93ba330d72af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cf754f8b1197489fca01e881a4b4b146e814998e4b365f116fa1a102c00e6a4e","src/unix/newlib/espidf/mod.rs":"29969da41f0042197b21cfa7c0ad2244b4519ecab0fb7de3d0a7655b4f3937e1","src/unix/newlib/generic.rs":"5f0b5d07ddb5a5d60580f9561fdb05e9218d9751d4068c4aadad2ba6b950aabf","src/unix/newlib/horizon/mod.rs":"3a521d22bf932fc01c1d26d1f9bff20f11b1855b03c8236a8eb18310f6cab5a8","src/unix/newlib/mod.rs":"e5d5faf27a6336b9f1c02b8726427801d906a14dae766852b4e85c1a92df06c8","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"cc9e188711b9bf614323ad6c48e0d2e1a1ecc5d3bc64961ba451f29c6c22d2d8","src/unix/newlib/vita/mod.rs":"d849a01841744ea5e04635c8f69c9e2b44791320eb9d629b9d0fee0a4c5d502a","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/nto/aarch64.rs":"4709c9afdc8d583be876598e7c238499ee3e8da5bd2baa614d9c7dd414851555","src/unix/nto/mod.rs":"07268897fc8810f2fed22ab56f87757f71c73ba401abd848bccca6b183a13b02","src/unix/nto/neutrino.rs":"799bff4ab01a6424db6c5a2b76aa5679826d41495f9d13c63485bf13bc80026b","src/unix/nto/x86_64.rs":"a3e18e93c2999da1cd7a6f748a4b60c07aefb73d8ea2aafec19a84cfb040bc8e","src/unix/redox/mod.rs":"a9f54687307883beb4a410216dc8e36b85d72b0463bc6b1520bd91edf3947d23","src/unix/solarish/compat.rs":"00f1ee3faec9da69204e42f025f6735dd13d894071a154425dcc43ecbdd06e7f","src/unix/solarish/illumos.rs":"cd93c2d84722bbf9933a92842a8998eb0b2afc962f50bc2546ad127b82809fa7","src/unix/solarish/mod.rs":"10b2369edc027fcb2e41e5342f24946aa01ee1549a6d7f06b9a3956ff84518bc","src/unix/solarish/solaris.rs":"41b350a89ddf01cd12a10f93640f92be53be0b0d976021cdc08da17bf3e72edf","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"ec2b01f194eb8a6a27133c57681da195a949e03098f3ea1e847227a9c09ef5fc","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"4105a2e6a6c9908fc1f2a770ede052bb0d6a5d9d49e32d815f557081efc49860","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"d4147353537d7556076ff1a1c4cb96cc2dae9416a5d176ba8a077ad55ab7ec18","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"9fdc5e1c62c441abef7bc62a7343efb2041edc24db9ac0efc0f74df55b69e249","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","src/xous.rs":"eb0675f25ba01f73072d2b70907fb8abb1148facefe5a20756c49250f3d65fae","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"}
\ No newline at end of file
diff --git a/libgrust/libformat_parser/vendor/libc/CONTRIBUTING.md b/libgrust/libformat_parser/vendor/libc/CONTRIBUTING.md
new file mode 100644
index 00000000000..b6f41cc6de8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/CONTRIBUTING.md
@@ -0,0 +1,100 @@
+# Contributing to `libc`
+
+Welcome! If you are reading this document, it means you are interested in contributing
+to the `libc` crate.
+
+## v0.2 changes
+
+If you want to add your changes to v0.2, please submit them to the `libc-0.2` branch.
+If you want to add any breaking changes, it should be submitted to the main branch,
+which has changes for v0.3.
+We will support and make a new release for v0.2 until we make the first release of v0.3.
+
+## 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` list<sup>1</sup>,
+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!
+
+<sup>1</sup>: Note that this list has nothing to do with any Unix or Posix
+standard, it's just a list shared between 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
+  - [`sh 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 anytime.
+
+## Releasing your change to crates.io
+
+Now that you've done the amazing job of landing your new API or your new
+platform in this crate, the next step is to get that sweet, sweet usage from
+crates.io! The only next step is to bump the version of libc and then publish
+it. If you'd like to get a release out ASAP you can follow these steps:
+
+1. Increment the patch version number in `Cargo.toml` and `libc-test/Cargo.toml`.
+1. Send a PR to this repository. It should [look like this][example-pr], but it'd
+   also be nice to fill out the description with a small rationale for the
+   release (any rationale is ok though!).
+1. Once merged, the release will be tagged and published by one of the libc crate
+   maintainers.
+
+[example-pr]: https://github.com/rust-lang/libc/pull/2120
diff --git a/libgrust/libformat_parser/vendor/libc/Cargo.toml b/libgrust/libformat_parser/vendor/libc/Cargo.toml
new file mode 100644
index 00000000000..266fb56093b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/Cargo.toml
@@ -0,0 +1,175 @@
+# 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]
+name = "libc"
+version = "0.2.152"
+authors = ["The Rust Project Developers"]
+build = "build.rs"
+exclude = [
+    "/ci/*",
+    "/.github/*",
+    "/.cirrus.yml",
+    "/triagebot.toml",
+]
+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 = [
+    "const-extern-fn",
+    "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",
+    "hexagon-unknown-linux-musl",
+    "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",
+    "riscv64gc-unknown-freebsd",
+    "riscv64gc-unknown-hermit",
+    "riscv64gc-unknown-linux-gnu",
+    "riscv64gc-unknown-linux-musl",
+    "riscv64gc-unknown-none-elf",
+    "riscv64imac-unknown-none-elf",
+    "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",
+    "wasm32-wasi",
+    "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",
+]
+
+[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 --git a/libgrust/libformat_parser/vendor/libc/LICENSE-APACHE b/libgrust/libformat_parser/vendor/libc/LICENSE-APACHE
new file mode 100644
index 00000000000..1b5ec8b78e2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/LICENSE-APACHE
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/LICENSE-MIT b/libgrust/libformat_parser/vendor/libc/LICENSE-MIT
new file mode 100644
index 00000000000..78061811c33
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/LICENSE-MIT
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/README.md b/libgrust/libformat_parser/vendor/libc/README.md
new file mode 100644
index 00000000000..395b94ce0c8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/README.md
@@ -0,0 +1,118 @@
+# 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.
+
+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
+
+## v0.3 Roadmap
+
+The main branch is now for v0.3 which has some breaking changes.
+
+For v0.2, please submit PRs to the `libc-0.2` branch instead.
+We will stop making new v0.2 releases once we release v0.3 on crates.io.
+
+See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for 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`.
+
+* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s.
+  If you use Rust >= 1.62, this feature is implicitly enabled.
+  Otherwise it requires a nightly rustc.
+
+* **deprecated**: `use_std` is deprecated, and is equivalent to `std`.
+
+## Rust version support
+
+The minimum supported Rust toolchain version is currently **Rust 1.13.0**.
+(libc does not currently have any policy regarding changes to the minimum
+supported Rust version; such policy is a work in progress.) APIs requiring
+newer Rust features are only available on newer Rust toolchains:
+
+| Feature              | Version |
+|----------------------|---------|
+| `union`              |  1.19.0 |
+| `const mem::size_of` |  1.24.0 |
+| `repr(align)`        |  1.25.0 |
+| `extra_traits`       |  1.25.0 |
+| `core::ffi::c_void`  |  1.30.0 |
+| `repr(packed(N))`    |  1.33.0 |
+| `cfg(target_vendor)` |  1.33.0 |
+| `const-extern-fn`    |  1.62.0 |
+
+## Platform support
+
+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.
+
+<div class="platform_docs"></div>
+
+## 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 --git a/libgrust/libformat_parser/vendor/libc/build.rs b/libgrust/libformat_parser/vendor/libc/build.rs
new file mode 100644
index 00000000000..ec932007ae6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/build.rs
@@ -0,0 +1,297 @@
+use std::env;
+use std::process::Command;
+use std::str;
+use std::string::String;
+
+// 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",
+    "freebsd10",
+    "freebsd11",
+    "freebsd12",
+    "freebsd13",
+    "freebsd14",
+    "freebsd15",
+    "libc_align",
+    "libc_cfg_target_vendor",
+    "libc_const_extern_fn",
+    "libc_const_extern_fn_unstable",
+    "libc_const_size_of",
+    "libc_core_cvoid",
+    "libc_deny_warnings",
+    "libc_int128",
+    "libc_long_array",
+    "libc_non_exhaustive",
+    "libc_packedN",
+    "libc_priv_mod_use",
+    "libc_ptr_addr_of",
+    "libc_thread_local",
+    "libc_underscore_const_names",
+    "libc_union",
+];
+
+// Extra values to allow for check-cfg.
+const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
+    ("target_os", &["switch", "aix", "ohos", "hurd"]),
+    ("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 align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
+    let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
+    let libc_ci = env::var("LIBC_CI").is_ok();
+    let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok();
+
+    if env::var("CARGO_FEATURE_USE_STD").is_ok() {
+        println!(
+            "cargo:warning=\"libc's use_std cargo feature is deprecated since libc 0.2.55; \
+             please consider using the `std` cargo feature instead\""
+        );
+    }
+
+    // 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.
+    match which_freebsd() {
+        Some(10) if libc_ci => set_cfg("freebsd10"),
+        Some(11) if libc_ci => set_cfg("freebsd11"),
+        Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
+        Some(13) if libc_ci => set_cfg("freebsd13"),
+        Some(14) if libc_ci => set_cfg("freebsd14"),
+        Some(15) if libc_ci => set_cfg("freebsd15"),
+        Some(_) | None => set_cfg("freebsd11"),
+    }
+
+    match emcc_version_code() {
+        Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
+        // Non-Emscripten or version < 3.1.42.
+        Some(_) | None => (),
+    }
+
+    // On CI: deny all warnings
+    if libc_ci {
+        set_cfg("libc_deny_warnings");
+    }
+
+    // Rust >= 1.15 supports private module use:
+    if rustc_minor_ver >= 15 || rustc_dep_of_std {
+        set_cfg("libc_priv_mod_use");
+    }
+
+    // Rust >= 1.19 supports unions:
+    if rustc_minor_ver >= 19 || rustc_dep_of_std {
+        set_cfg("libc_union");
+    }
+
+    // Rust >= 1.24 supports const mem::size_of:
+    if rustc_minor_ver >= 24 || rustc_dep_of_std {
+        set_cfg("libc_const_size_of");
+    }
+
+    // Rust >= 1.25 supports repr(align):
+    if rustc_minor_ver >= 25 || rustc_dep_of_std || align_cargo_feature {
+        set_cfg("libc_align");
+    }
+
+    // Rust >= 1.26 supports i128 and u128:
+    if rustc_minor_ver >= 26 || rustc_dep_of_std {
+        set_cfg("libc_int128");
+    }
+
+    // Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
+    // Otherwise, it defines an incompatible type to retaining
+    // backwards-compatibility.
+    if rustc_minor_ver >= 30 || rustc_dep_of_std {
+        set_cfg("libc_core_cvoid");
+    }
+
+    // Rust >= 1.33 supports repr(packed(N)) and cfg(target_vendor).
+    if rustc_minor_ver >= 33 || rustc_dep_of_std {
+        set_cfg("libc_packedN");
+        set_cfg("libc_cfg_target_vendor");
+    }
+
+    // Rust >= 1.40 supports #[non_exhaustive].
+    if rustc_minor_ver >= 40 || rustc_dep_of_std {
+        set_cfg("libc_non_exhaustive");
+    }
+
+    // Rust >= 1.47 supports long array:
+    if rustc_minor_ver >= 47 || rustc_dep_of_std {
+        set_cfg("libc_long_array");
+    }
+
+    if rustc_minor_ver >= 51 || rustc_dep_of_std {
+        set_cfg("libc_ptr_addr_of");
+    }
+
+    // Rust >= 1.37.0 allows underscores as anonymous constant names.
+    if rustc_minor_ver >= 37 || rustc_dep_of_std {
+        set_cfg("libc_underscore_const_names");
+    }
+
+    // #[thread_local] is currently unstable
+    if rustc_dep_of_std {
+        set_cfg("libc_thread_local");
+    }
+
+    // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C".
+    if rustc_minor_ver >= 62 {
+        set_cfg("libc_const_extern_fn");
+    } else {
+        // Rust < 1.62.0 requires a crate feature and feature gate.
+        if const_extern_fn_cargo_feature {
+            if !is_nightly || rustc_minor_ver < 40 {
+                panic!("const-extern-fn requires a nightly compiler >= 1.40");
+            }
+            set_cfg("libc_const_extern_fn_unstable");
+            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);
+            }
+        }
+    }
+}
+
+fn rustc_minor_nightly() -> (u32, bool) {
+    macro_rules! otry {
+        ($e:expr) => {
+            match $e {
+                Some(e) => e,
+                None => panic!("Failed to get rustc version"),
+            }
+        };
+    }
+
+    let rustc = otry!(env::var_os("RUSTC"));
+    let output = Command::new(rustc)
+        .arg("--version")
+        .output()
+        .ok()
+        .expect("Failed to get rustc version");
+    if !output.status.success() {
+        panic!(
+            "failed to run rustc: {}",
+            String::from_utf8_lossy(output.stderr.as_slice())
+        );
+    }
+
+    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<i32> {
+    let output = std::process::Command::new("freebsd-version").output().ok();
+    if output.is_none() {
+        return None;
+    }
+    let output = output.unwrap();
+    if !output.status.success() {
+        return None;
+    }
+
+    let stdout = String::from_utf8(output.stdout).ok();
+    if stdout.is_none() {
+        return None;
+    }
+    let stdout = stdout.unwrap();
+
+    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<u64> {
+    let output = std::process::Command::new("emcc")
+        .arg("-dumpversion")
+        .output()
+        .ok();
+    if output.is_none() {
+        return None;
+    }
+    let output = output.unwrap();
+    if !output.status.success() {
+        return None;
+    }
+
+    let stdout = String::from_utf8(output.stdout).ok();
+    if stdout.is_none() {
+        return None;
+    }
+    let version = stdout.unwrap();
+
+    // Some Emscripten versions come with `-git` attached, so split the
+    // version string also on the `-` char.
+    let mut pieces = version.trim().split(|c| c == '.' || c == '-');
+
+    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);
+}
diff --git a/libgrust/libformat_parser/vendor/libc/rustfmt.toml b/libgrust/libformat_parser/vendor/libc/rustfmt.toml
new file mode 100644
index 00000000000..dc85c99467f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/rustfmt.toml
@@ -0,0 +1 @@
+error_on_line_overflow = true
diff --git a/libgrust/libformat_parser/vendor/libc/src/fixed_width_ints.rs b/libgrust/libformat_parser/vendor/libc/src/fixed_width_ints.rs
new file mode 100644
index 00000000000..999de8f54f1
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fixed_width_ints.rs
@@ -0,0 +1,99 @@
+//! 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(libc_int128, 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;
+
+        cfg_if! {
+            if #[cfg(libc_underscore_const_names)] {
+                macro_rules! static_assert_eq {
+                    ($a:expr, $b:expr) => {
+                        const _: [(); $a] = [(); $b];
+                    };
+                }
+
+                // 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;
+
+                // 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 --git a/libgrust/libformat_parser/vendor/libc/src/fuchsia/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/fuchsia/aarch64.rs
new file mode 100644
index 00000000000..33e3934d661
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fuchsia/aarch64.rs
@@ -0,0 +1,67 @@
+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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_uint; 2],
+    }
+
+    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_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_uint; 2],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/fuchsia/align.rs b/libgrust/libformat_parser/vendor/libc/src/fuchsia/align.rs
new file mode 100644
index 00000000000..3409bf0c619
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fuchsia/align.rs
@@ -0,0 +1,142 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[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; ::__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; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            #[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; ::__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; ::__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; ::__SIZEOF_PTHREAD_COND_T],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/fuchsia/mod.rs b/libgrust/libformat_parser/vendor/libc/src/fuchsia/mod.rs
new file mode 100644
index 00000000000..4e028ff6cc4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fuchsia/mod.rs
@@ -0,0 +1,4393 @@
+//! 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.
+
+// 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: ::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
+    }
+
+    // <sys/time.h>
+    pub struct itimerval {
+        pub it_interval: ::timeval,
+        pub it_value: ::timeval,
+    }
+
+    // <sys/times.h>
+    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 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: ::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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    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_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub __c_ispeed: ::speed_t,
+        pub __c_ospeed: ::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: ::pid_t,
+    }
+
+    pub struct ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::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: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        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 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 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 / 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: ::timespec,
+        pub sched_ss_init_budget: ::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 ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_ifu: *mut ::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: ::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 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,
+        #[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: ::timespec,
+        pub it_value: ::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: ::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: ::timeval,
+        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: ::__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 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: ::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_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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_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: ::socklen_t,
+        pub msg_iov: *mut ::iovec,
+        pub msg_iovlen: ::c_int,
+        __pad1: ::c_int,
+        pub msg_control: *mut ::c_void,
+        pub msg_controllen: ::socklen_t,
+        __pad2: ::socklen_t,
+        pub msg_flags: ::c_int,
+    }
+
+    pub struct cmsghdr {
+        pub cmsg_len: ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+}
+
+s_no_extra_traits! {
+    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: ::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: ::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: ::sa_family_t,
+        nl_pad: ::c_ushort,
+        pub nl_pid: u32,
+        pub nl_groups: u32
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        pub sigev_notify_function: fn(::sigval),
+        pub sigev_notify_attributes: *mut pthread_attr_t,
+        pub __pad: [::c_char; 56 - 3 * 8 /* 8 == sizeof(long) */],
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.nl_family.hash(state);
+                self.nl_pid.hash(state);
+                self.nl_groups.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_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<H: ::hash::Hasher>(&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);
+            }
+        }
+    }
+}
+
+// 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: ::c_int = 0x800;
+pub const S_ISGID: ::c_int = 0x400;
+pub const S_ISVTX: ::c_int = 0x200;
+
+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: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
+pub const CLOCK_BOOTTIME: ::clockid_t = 7;
+pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
+pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
+pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
+pub const CLOCK_TAI: ::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: ::mode_t = 4096;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IRWXG: ::mode_t = 56;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IRWXO: ::mode_t = 7;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IROTH: ::mode_t = 4;
+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: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x1;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CRTSCTS: ::tcflag_t = 0x80000000;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0o000010;
+pub const ONOCR: ::tcflag_t = 0o000020;
+pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o000100;
+pub const OFDEL: ::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: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::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: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::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 = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+
+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;
+
+align_const! {
+    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: ::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 ::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: ::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 = ::ENODATA;
+
+pub const SO_ORIGINAL_DST: ::c_int = 80;
+pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const CMSPAR: ::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: ::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: ::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 = ::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 = ::O_NONBLOCK;
+
+pub const SFD_NONBLOCK: ::c_int = ::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 = ::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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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 __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: ::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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::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: ::dev_t) -> ::c_uint {
+        let mut major = 0;
+        major |= (dev & 0x00000000000fff00) >> 8;
+        major |= (dev & 0xfffff00000000000) >> 32;
+        major as ::c_uint
+    }
+
+    pub fn minor(dev: ::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::<cmsghdr>() {
+            0 as *mut cmsghdr
+        } else if __CMSG_NEXT(cmsg).add(::mem::size_of::<cmsghdr>())
+            >= __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::<cmsghdr>() {
+            (*mhdr).msg_control.cast()
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub {const} fn CMSG_ALIGN(len: ::size_t) -> ::size_t {
+        (len + ::mem::size_of::<::size_t>() - 1)
+            & !(::mem::size_of::<::size_t>() - 1)
+    }
+
+    pub {const} fn CMSG_SPACE(len: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + 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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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::<::c_long>() - 1)
+        & !(::mem::size_of::<::c_long>() - 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: ::uid_t) -> *mut passwd;
+
+    pub fn fprintf(stream: *mut ::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 ::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 ::FILE) -> ::c_int;
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    pub fn fileno(stream: *mut ::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 ::DIR;
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+        -> ::c_int;
+    pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
+    pub fn rewinddir(dirp: *mut ::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: ::mode_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
+    pub fn fchownat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        owner: ::uid_t,
+        group: ::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: ::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;
+    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: ::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 ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn times(buf: *mut ::tms) -> ::clock_t;
+
+    pub fn pthread_self() -> ::pthread_t;
+    pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::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_getstacksize(
+        attr: *const ::pthread_attr_t,
+        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_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
+    pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
+    pub fn sched_yield() -> ::c_int;
+    pub fn pthread_key_create(
+        key: *mut pthread_key_t,
+        dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
+    ) -> ::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 ::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: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::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 ::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 ::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: ::mode_t, dev: ::dev_t) -> ::c_int;
+    pub fn uname(buf: *mut ::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 ::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 ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::FILE) -> ::off_t;
+    pub fn tcdrain(fd: ::c_int) -> ::c_int;
+    pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfmakeraw(termios: *mut ::termios);
+    pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
+    pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::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) -> ::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: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+
+    pub fn pthread_getattr_np(native: ::pthread_t, 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 memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::size_t, ptr: *const ::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 ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
+
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::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: ::clockid_t,
+    ) -> ::c_int;
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::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 ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
+    pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const termios,
+        winp: *const ::winsize,
+    ) -> ::c_int;
+    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 ::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: ::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 ::shmid_ds) -> ::c_int;
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn semget(key: ::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 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: ::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 ::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 ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    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 reboot(how_to: ::c_int) -> ::c_int;
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+
+    // Not available now on Android
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::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 ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::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 ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::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 ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn sync();
+    pub fn syscall(num: ::c_long, ...) -> ::c_long;
+    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;
+    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 ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn splice(
+        fd_in: ::c_int,
+        off_in: *mut ::loff_t,
+        fd_out: ::c_int,
+        off_out: *mut ::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: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+    pub fn vmsplice(
+        fd: ::c_int,
+        iov: *const ::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: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::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: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::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 ::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: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::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 ::group;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::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: ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::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 ::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 dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut ::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
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/fuchsia/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/fuchsia/no_align.rs
new file mode 100644
index 00000000000..7ca90e0e48a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fuchsia/no_align.rs
@@ -0,0 +1,129 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutexattr_t {
+                #[cfg(target_arch = "x86_64")]
+                __align: [::c_int; 0],
+                #[cfg(not(target_arch = "x86_64"))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_rwlockattr_t {
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            pub struct pthread_mutex_t {
+                #[cfg(any(target_arch = "arm",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "arm",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                __align: [::c_long; 0],
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_cond_t {
+                __align: [*const ::c_void; 0],
+                #[cfg(not(target_env = "musl"))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                impl PartialEq for pthread_cond_t {
+                    fn eq(&self, other: &pthread_cond_t) -> bool {
+                        // Ignore __align field
+                        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")
+                            // Ignore __align field
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_cond_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        // Ignore __align field
+                        self.size.hash(state);
+                    }
+                }
+
+                impl PartialEq for pthread_mutex_t {
+                    fn eq(&self, other: &pthread_mutex_t) -> bool {
+                        // Ignore __align field
+                        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")
+                            // Ignore __align field
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_mutex_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        // Ignore __align field
+                        self.size.hash(state);
+                    }
+                }
+
+                impl PartialEq for pthread_rwlock_t {
+                    fn eq(&self, other: &pthread_rwlock_t) -> bool {
+                        // Ignore __align field
+                        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")
+                            // Ignore __align field
+                            // FIXME: .field("size", &self.size)
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for pthread_rwlock_t {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        // Ignore __align field
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/fuchsia/riscv64.rs b/libgrust/libformat_parser/vendor/libc/src/fuchsia/riscv64.rs
new file mode 100644
index 00000000000..de2b7197d75
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fuchsia/riscv64.rs
@@ -0,0 +1,44 @@
+// 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: ::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_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 3],
+    }
+
+    // Not actually used, IPC calls just return ENOSYS
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/fuchsia/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/fuchsia/x86_64.rs
new file mode 100644
index 00000000000..dca3c247d8b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/fuchsia/x86_64.rs
@@ -0,0 +1,152 @@
+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: ::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_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct mcontext_t {
+        __private: [u64; 32],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::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<H: ::hash::Hasher>(&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 --git a/libgrust/libformat_parser/vendor/libc/src/hermit/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/hermit/aarch64.rs
new file mode 100644
index 00000000000..1a92e3b4fa3
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/hermit/aarch64.rs
@@ -0,0 +1,2 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
diff --git a/libgrust/libformat_parser/vendor/libc/src/hermit/mod.rs b/libgrust/libformat_parser/vendor/libc/src/hermit/mod.rs
new file mode 100644
index 00000000000..7543c825782
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/hermit/mod.rs
@@ -0,0 +1,61 @@
+//! Hermit 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_long = i64;
+pub type c_ulong = u64;
+
+pub type wint_t = u32;
+pub type wctype_t = i64;
+
+pub type regoff_t = size_t;
+pub type off_t = c_long;
+
+cfg_if! {
+    if #[cfg(target_arch = "aarch64")] {
+        mod aarch64;
+        pub use self::aarch64::*;
+    } else if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    } else {
+        // Unknown target_arch
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/hermit/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/hermit/x86_64.rs
new file mode 100644
index 00000000000..76ec3ce823e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/hermit/x86_64.rs
@@ -0,0 +1,2 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
diff --git a/libgrust/libformat_parser/vendor/libc/src/lib.rs b/libgrust/libformat_parser/vendor/libc/src/lib.rs
new file mode 100644
index 00000000000..1b6f0c077ab
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/lib.rs
@@ -0,0 +1,165 @@
+//! 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,
+)]
+#![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))]
+// 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)]
+#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]
+
+#[macro_use]
+mod macros;
+
+cfg_if! {
+    if #[cfg(feature = "rustc-dep-of-std")] {
+        extern crate rustc_std_workspace_core as core;
+        #[allow(unused_imports)]
+        use core::iter;
+        #[allow(unused_imports)]
+        use core::ops;
+        #[allow(unused_imports)]
+        use core::option;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_priv_mod_use)] {
+        #[cfg(libc_core_cvoid)]
+        #[allow(unused_imports)]
+        use core::ffi;
+        #[allow(unused_imports)]
+        use core::fmt;
+        #[allow(unused_imports)]
+        use core::hash;
+        #[allow(unused_imports)]
+        use core::num;
+        #[allow(unused_imports)]
+        use core::mem;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        use core::clone::Clone;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        use core::marker::{Copy, Send, Sync};
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        use core::option::Option;
+    } else {
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::fmt;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::hash;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::num;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::mem;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::clone::Clone;
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::marker::{Copy, Send, Sync};
+        #[doc(hidden)]
+        #[allow(unused_imports)]
+        pub use core::option::Option;
+    }
+}
+
+cfg_if! {
+    if #[cfg(windows)] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod windows;
+        pub use windows::*;
+    } else if #[cfg(target_os = "fuchsia")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod fuchsia;
+        pub use fuchsia::*;
+    } else if #[cfg(target_os = "switch")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod switch;
+        pub use switch::*;
+    } else if #[cfg(target_os = "psp")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod psp;
+        pub use psp::*;
+    } else if #[cfg(target_os = "vxworks")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod vxworks;
+        pub use vxworks::*;
+    } else if #[cfg(target_os = "solid_asp3")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod solid;
+        pub use solid::*;
+    } else if #[cfg(unix)] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod unix;
+        pub use unix::*;
+    } else if #[cfg(target_os = "hermit")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod hermit;
+        pub use hermit::*;
+    } else if #[cfg(target_os = "teeos")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod teeos;
+        pub use teeos::*;
+    } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod sgx;
+        pub use sgx::*;
+    } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod wasi;
+        pub use wasi::*;
+    } else if #[cfg(target_os = "xous")] {
+        mod fixed_width_ints;
+        pub use fixed_width_ints::*;
+
+        mod xous;
+        pub use xous::*;
+    } else {
+        // non-supported targets: empty...
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/macros.rs b/libgrust/libformat_parser/vendor/libc/src/macros.rs
new file mode 100644
index 00000000000..beb80024dbf
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/macros.rs
@@ -0,0 +1,349 @@
+/// 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)*
+    };
+}
+
+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", derive(Debug, Eq, Hash, PartialEq))]
+            #[allow(deprecated)]
+            $(#[$attr])*
+            pub struct $i { $($field)* }
+        }
+        #[allow(deprecated)]
+        impl ::Copy for $i {}
+        #[allow(deprecated)]
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    );
+}
+
+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)* }) => (
+        cfg_if! {
+            if #[cfg(libc_union)] {
+                __item! {
+                    #[repr(C)]
+                    $(#[$attr])*
+                    pub union $i { $($field)* }
+                }
+
+                impl ::Copy for $i {}
+                impl ::Clone for $i {
+                    fn clone(&self) -> $i { *self }
+                }
+            }
+        }
+    );
+    (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
+        __item! {
+            #[repr(C)]
+            $(#[$attr])*
+            pub struct $i { $($field)* }
+        }
+        #[allow(deprecated)]
+        impl ::Copy for $i {}
+        #[allow(deprecated)]
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    );
+}
+
+macro_rules! missing {
+    ($($(#[$attr:meta])* pub enum $i:ident {})*) => ($(
+        $(#[$attr])* #[allow(missing_copy_implementations)] pub enum $i { }
+    )*);
+}
+
+macro_rules! e {
+    ($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($(
+        __item! {
+            #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+            $(#[$attr])*
+            pub enum $i { $($field)* }
+        }
+        impl ::Copy for $i {}
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    )*);
+}
+
+macro_rules! s_paren {
+    ($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($(
+        __item! {
+            #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+            $(#[$attr])*
+            pub struct $i ( $($field)* );
+        }
+        impl ::Copy for $i {}
+        impl ::Clone for $i {
+            fn clone(&self) -> $i { *self }
+        }
+    )*);
+}
+
+// This is a pretty horrible hack to allow us to conditionally mark
+// some functions as 'const', without requiring users of this macro
+// to care about the "const-extern-fn" feature.
+//
+// When 'const-extern-fn' is enabled, we emit the captured 'const' keyword
+// in the expanded function.
+//
+// When '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 '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 'const-extern-fn'.
+//
+// Specifically, moving the 'cfg_if' into the macro body will *not* work.
+// Doing so would cause the '#[cfg(feature = "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 'const-extern-fn' feature is disabled
+//
+// Note that users of this macro need to place 'const' in a weird position
+// (after the closing ')' for the arguments, but before the return type).
+// This was the only way I could satisfy the following two requirements:
+// 1. Avoid ambiguity errors from 'macro_rules!' (which happen when writing '$foo:ident fn'
+// 2. Allow users of this macro to mix 'pub fn foo' and 'pub const fn bar' within the same
+// 'f!' block
+cfg_if! {
+    if #[cfg(libc_const_extern_fn)] {
+        macro_rules! f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub $($constness)* unsafe extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! safe_f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub $($constness)* extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! const_fn {
+            ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                $($constness)* fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+    } else {
+        macro_rules! f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub unsafe extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! safe_f {
+            ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                pub extern fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+
+        macro_rules! const_fn {
+            ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
+                        $($arg:ident: $argty:ty),*
+            ) -> $ret:ty {
+                $($body:stmt);*
+            })*) => ($(
+                #[inline]
+                $(#[$attr])*
+                fn $i($($arg: $argty),*
+                ) -> $ret {
+                    $($body);*
+                }
+            )*)
+        }
+    }
+}
+
+macro_rules! __item {
+    ($i:item) => {
+        $i
+    };
+}
+
+macro_rules! align_const {
+    ($($(#[$attr:meta])*
+       pub const $name:ident : $t1:ty
+       = $t2:ident { $($field:tt)* };)*) => ($(
+        #[cfg(libc_align)]
+        $(#[$attr])*
+        pub const $name : $t1 = $t2 {
+            $($field)*
+        };
+        #[cfg(not(libc_align))]
+        $(#[$attr])*
+        pub const $name : $t1 = $t2 {
+            $($field)*
+            __align: [],
+        };
+    )*)
+}
+
+// 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;
+            );
+        )*
+    }
+}
+
+#[cfg(not(libc_ptr_addr_of))]
+macro_rules! ptr_addr_of {
+    ($place:expr) => {
+        &$place
+    };
+}
+
+#[cfg(libc_ptr_addr_of)]
+macro_rules! ptr_addr_of {
+    ($place:expr) => {
+        ::core::ptr::addr_of!($place)
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/psp.rs b/libgrust/libformat_parser/vendor/libc/src/psp.rs
new file mode 100644
index 00000000000..a4ca029b6e0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/psp.rs
@@ -0,0 +1,4177 @@
+//! 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.
+
+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;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+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<unsafe extern "C" fn(data: *mut c_void, num_packets: i32, param: *mut c_void) -> i32>;
+
+pub type GuCallback = ::Option<extern "C" fn(id: i32, arg: *mut c_void)>;
+pub type GuSwapBuffersCallback =
+    ::Option<extern "C" fn(display: *mut *mut c_void, render: *mut *mut c_void)>;
+
+pub type SceNetAdhocctlHandler =
+    ::Option<unsafe extern "C" fn(flag: i32, error: i32, unknown: *mut c_void)>;
+
+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<unsafe extern "C" fn(size: usize) -> *mut c_void>;
+pub type HttpReallocFunction =
+    ::Option<unsafe extern "C" fn(p: *mut c_void, size: usize) -> *mut c_void>;
+pub type HttpFreeFunction = ::Option<unsafe extern "C" fn(p: *mut c_void)>;
+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<extern "C" fn(id: i32, arg: *mut c_void)>,
+        pub signal_arg: *mut c_void,
+        pub finish_func: ::Option<extern "C" fn(id: i32, arg: *mut c_void)>,
+        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 --git a/libgrust/libformat_parser/vendor/libc/src/sgx.rs b/libgrust/libformat_parser/vendor/libc/src/sgx.rs
new file mode 100644
index 00000000000..7da6269399d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/sgx.rs
@@ -0,0 +1,47 @@
+//! 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;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/solid/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/solid/aarch64.rs
new file mode 100644
index 00000000000..ceabea397b8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/solid/aarch64.rs
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i64;
+pub type c_ulong = u64;
diff --git a/libgrust/libformat_parser/vendor/libc/src/solid/arm.rs b/libgrust/libformat_parser/vendor/libc/src/solid/arm.rs
new file mode 100644
index 00000000000..04cc1542dea
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/solid/arm.rs
@@ -0,0 +1,4 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type c_long = i32;
+pub type c_ulong = u32;
diff --git a/libgrust/libformat_parser/vendor/libc/src/solid/mod.rs b/libgrust/libformat_parser/vendor/libc/src/solid/mod.rs
new file mode 100644
index 00000000000..f0f2ae89bde
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/solid/mod.rs
@@ -0,0 +1,904 @@
+//! Interface to the [SOLID] C library
+//!
+//! [SOLID]: https://solid.kmckk.com/
+
+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 = ::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 = 0x0040;
+pub const S_IWRITE: c_short = 0x0080;
+pub const S_IREAD: c_short = 0x0100;
+pub const S_IFCHR: c_short = 0x2000;
+pub const S_IFDIR: c_short = 0x4000;
+pub const S_IFMT: c_short = 0o160000;
+pub const S_IFIFO: c_short = 0o0010000;
+pub const S_IFBLK: c_short = 0o0060000;
+pub const S_IFREG: c_short = 0o0100000;
+
+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<unsafe extern "C" fn()>) -> 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<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> 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<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> 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<unsafe extern "C" fn()>) -> 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<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> c_int>,
+    ) -> c_int;
+    pub fn mergesort(
+        arg1: *mut c_void,
+        arg2: size_t,
+        arg3: size_t,
+        arg4: ::Option<unsafe extern "C" fn(arg1: *const c_void, arg2: *const c_void) -> 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: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::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(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/switch.rs b/libgrust/libformat_parser/vendor/libc/src/switch.rs
new file mode 100644
index 00000000000..030ab20d7bd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/switch.rs
@@ -0,0 +1,49 @@
+//! 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;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/teeos/mod.rs b/libgrust/libformat_parser/vendor/libc/src/teeos/mod.rs
new file mode 100644
index 00000000000..25e06ffaa3b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/teeos/mod.rs
@@ -0,0 +1,1385 @@
+//! 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)]
+
+// only supported on Rust > 1.59, so we can directly reexport c_void from core.
+pub use core::ffi::c_void;
+
+use Option;
+
+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 specifc
+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 really 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 couse 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::<c_ulong>()],
+}
+
+#[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::<c_long>() / core::mem::size_of::<c_int>()],
+}
+
+#[repr(C)]
+pub struct div_t {
+    pub quot: c_int,
+    pub rem: c_int,
+}
+
+// fcntl
+pub const O_CREAT: u32 = 0100;
+
+pub const O_EXCL: u32 = 0200;
+
+pub const O_NOCTTY: u32 = 0400;
+
+pub const O_TRUNC: u32 = 01000;
+
+pub const O_APPEND: u32 = 02000;
+
+pub const O_NONBLOCK: u32 = 04000;
+
+pub const O_DSYNC: u32 = 010000;
+
+pub const O_SYNC: u32 = 04010000;
+
+pub const O_RSYNC: u32 = 04010000;
+
+pub const O_DIRECTORY: u32 = 0200000;
+
+pub const O_NOFOLLOW: u32 = 0400000;
+
+pub const O_CLOEXEC: u32 = 02000000;
+
+pub const O_ASYNC: u32 = 020000;
+
+pub const O_DIRECT: u32 = 040000;
+
+pub const O_LARGEFILE: u32 = 0100000;
+
+pub const O_NOATIME: u32 = 01000000;
+
+pub const O_PATH: u32 = 010000000;
+
+pub const O_TMPFILE: u32 = 020200000;
+
+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<unsafe extern "C" fn(*mut c_void)>,
+    ) -> 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<once_fn>) -> 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::<cpu_set_t>(), cpuset)
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/aix/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/aix/mod.rs
new file mode 100644
index 00000000000..0fc923d6072
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/aix/mod.rs
@@ -0,0 +1,3362 @@
+pub type c_char = i8;
+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 = ::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 = ::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! {
+    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: [::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: ::ino_t,
+        pub d_reclen: ::c_ushort,
+        pub d_namlen: ::c_ushort,
+        pub d_name: [::c_char; 256]
+    }
+
+    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; ::NCCS]
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_sysid: ::c_uint,
+        pub l_pid: ::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: ::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 statvfs64 {
+        pub f_bsize: ::blksize64_t,
+        pub f_frsize: ::blksize64_t,
+        pub f_blocks: ::blkcnt64_t,
+        pub f_bfree: ::blkcnt64_t,
+        pub f_bavail: ::blkcnt64_t,
+        pub f_files: ::blkcnt64_t,
+        pub f_ffree: ::blkcnt64_t,
+        pub f_favail: ::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 ::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: ::uint16_t,
+        pub sin6_flowinfo: ::uint32_t,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: ::uint32_t
+    }
+
+    pub struct sockaddr_storage {
+        pub __ss_len: ::c_uchar,
+        pub ss_family: sa_family_t,
+        __ss_pad1: [::c_char; 6],
+        __ss_align: ::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: ::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: ::uint64_t,
+        pub f_ffree: ::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: ::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 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: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::sigval,
+        pub sigev_signo: ::c_int,
+        pub sigev_notify: ::c_int,
+        pub sigev_notify_function: extern fn(val: ::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: ::uint64_t,
+        pub file_offset: ::uint64_t,
+        pub file_bytes: ::int64_t,
+        pub trailer_data: *mut ::c_void,
+        pub trailer_length: ::c_uint,
+        pub bytes_sent: ::uint64_t,
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::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: ::pid_t,
+        pub posix_attr_sigmask: ::sigset_t,
+        pub posix_attr_sigdefault: ::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: ::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: [::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: ::pid_t,
+        pub shm_cpid: ::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: ::uint32_t,
+        pub shm_extshm: ::c_int,
+        pub shm_pagesize: ::int64_t,
+        pub shm_lba: ::uint64_t,
+        pub shm_reserved: ::int64_t,
+        pub shm_reserved1: ::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: ::uid_t,
+        pub st_gid: ::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: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::timespec,
+        pub it_value: ::timespec,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    pub union __sigaction_sa_union {
+        pub __su_handler: extern fn(c: ::c_int),
+        pub __su_sigaction: extern fn(c: ::c_int, info: *mut siginfo_t, ptr: *mut ::c_void),
+    }
+
+    pub struct sigaction {
+        #[cfg(libc_union)]
+        pub sa_union: __sigaction_sa_union,
+        pub sa_mask: sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    #[cfg(libc_union)]
+    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,
+        #[cfg(libc_union)]
+        pub u: __poll_ctl_ext_u,
+        pub reversed64: [u64; 6],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __sigaction_sa_union {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __sigaction_sa_union {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__sigaction_sa_union")
+                    .field("__su_handler", unsafe { &self.__su_handler })
+                    .field("__su_sigaction", unsafe { &self.__su_sigaction })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __sigaction_sa_union {
+            fn hash<H: ::hash::Hasher>(&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 {
+                #[cfg(libc_union)]
+                let union_eq = self.sa_union == other.sa_union;
+                #[cfg(not(libc_union))]
+                let union_eq = true;
+                self.sa_mask == other.sa_mask
+                    && self.sa_flags == other.sa_flags
+                    && union_eq
+            }
+        }
+        impl Eq for sigaction {}
+        impl ::fmt::Debug for sigaction {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("sigaction");
+                #[cfg(libc_union)]
+                struct_formatter.field("sa_union", &self.sa_union);
+                struct_formatter.field("sa_mask", &self.sa_mask);
+                struct_formatter.field("sa_flags", &self.sa_flags);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for sigaction {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                #[cfg(libc_union)]
+                self.sa_union.hash(state);
+                self.sa_mask.hash(state);
+                self.sa_flags.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __poll_ctl_ext_u {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __poll_ctl_ext_u {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__poll_ctl_ext_u")
+                    .field("addr", unsafe { &self.addr })
+                    .field("data32", unsafe { &self.data32 })
+                    .field("data", unsafe { &self.data })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __poll_ctl_ext_u {
+            fn hash<H: ::hash::Hasher>(&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 {
+                #[cfg(libc_union)]
+                let union_eq = self.u == other.u;
+                #[cfg(not(libc_union))]
+                let union_eq = true;
+                self.version == other.version
+                    && self.command == other.command
+                    && self.events == other.events
+                    && self.fd == other.fd
+                    && self.reversed64 == other.reversed64
+                    && union_eq
+            }
+        }
+        impl Eq for poll_ctl_ext {}
+        impl ::fmt::Debug for poll_ctl_ext {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("poll_ctl_ext");
+                struct_formatter.field("version", &self.version);
+                struct_formatter.field("command", &self.command);
+                struct_formatter.field("events", &self.events);
+                struct_formatter.field("fd", &self.fd);
+                #[cfg(libc_union)]
+                struct_formatter.field("u", &self.u);
+                struct_formatter.field("reversed64", &self.reversed64);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for poll_ctl_ext {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.version.hash(state);
+                self.command.hash(state);
+                self.events.hash(state);
+                self.fd.hash(state);
+                #[cfg(libc_union)]
+                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_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: ::nl_item = 13;
+pub const DAY_2: ::nl_item = 14;
+pub const DAY_3: ::nl_item = 15;
+pub const DAY_4: ::nl_item = 16;
+pub const DAY_5: ::nl_item = 17;
+pub const DAY_6: ::nl_item = 18;
+pub const DAY_7: ::nl_item = 19;
+pub const ABDAY_1: ::nl_item = 6;
+pub const ABDAY_2: ::nl_item = 7;
+pub const ABDAY_3: ::nl_item = 8;
+pub const ABDAY_4: ::nl_item = 9;
+pub const ABDAY_5: ::nl_item = 10;
+pub const ABDAY_6: ::nl_item = 11;
+pub const ABDAY_7: ::nl_item = 12;
+pub const MON_1: ::nl_item = 32;
+pub const MON_2: ::nl_item = 33;
+pub const MON_3: ::nl_item = 34;
+pub const MON_4: ::nl_item = 35;
+pub const MON_5: ::nl_item = 36;
+pub const MON_6: ::nl_item = 37;
+pub const MON_7: ::nl_item = 38;
+pub const MON_8: ::nl_item = 39;
+pub const MON_9: ::nl_item = 40;
+pub const MON_10: ::nl_item = 41;
+pub const MON_11: ::nl_item = 42;
+pub const MON_12: ::nl_item = 43;
+pub const ABMON_1: ::nl_item = 20;
+pub const ABMON_2: ::nl_item = 21;
+pub const ABMON_3: ::nl_item = 22;
+pub const ABMON_4: ::nl_item = 23;
+pub const ABMON_5: ::nl_item = 24;
+pub const ABMON_6: ::nl_item = 25;
+pub const ABMON_7: ::nl_item = 26;
+pub const ABMON_8: ::nl_item = 27;
+pub const ABMON_9: ::nl_item = 28;
+pub const ABMON_10: ::nl_item = 29;
+pub const ABMON_11: ::nl_item = 30;
+pub const ABMON_12: ::nl_item = 31;
+pub const RADIXCHAR: ::nl_item = 44;
+pub const THOUSEP: ::nl_item = 45;
+pub const YESSTR: ::nl_item = 46;
+pub const NOSTR: ::nl_item = 47;
+pub const CRNCYSTR: ::nl_item = 48;
+pub const D_T_FMT: ::nl_item = 1;
+pub const D_FMT: ::nl_item = 2;
+pub const T_FMT: ::nl_item = 3;
+pub const AM_STR: ::nl_item = 4;
+pub const PM_STR: ::nl_item = 5;
+pub const CODESET: ::nl_item = 49;
+pub const T_FMT_AMPM: ::nl_item = 55;
+pub const ERA: ::nl_item = 56;
+pub const ERA_D_FMT: ::nl_item = 57;
+pub const ERA_D_T_FMT: ::nl_item = 58;
+pub const ERA_T_FMT: ::nl_item = 59;
+pub const ALT_DIGITS: ::nl_item = 60;
+pub const YESEXPR: ::nl_item = 61;
+pub const NOEXPR: ::nl_item = 62;
+
+// locale.h
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::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: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::socklen_t = 32;
+pub const NI_NOFQDN: ::socklen_t = 0x1;
+pub const NI_NUMERICHOST: ::socklen_t = 0x2;
+pub const NI_NAMEREQD: ::socklen_t = 0x4;
+pub const NI_NUMERICSERV: ::socklen_t = 0x8;
+pub const NI_DGRAM: ::socklen_t = 0x10;
+pub const NI_NUMERICSCOPE: ::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 IF_NAMESIZE: ::c_int = 16;
+pub const IFNAMSIZ: ::c_int = 16;
+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;
+pub const ARPOP_REQUEST: ::c_int = 1;
+pub const ARPOP_REPLY: ::c_int = 2;
+
+// 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_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 ::sem_t;
+
+// spawn.h
+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: ::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 = 0o170000;
+pub const S_IFREG: mode_t = 0o100000;
+pub const S_IFDIR: mode_t = 0o40000;
+pub const S_IFBLK: mode_t = 0o60000;
+pub const S_IFCHR: mode_t = 0o20000;
+pub const S_IFIFO: mode_t = 0o10000;
+pub const S_IRWXU: mode_t = 0o700;
+pub const S_IRUSR: mode_t = 0o400;
+pub const S_IWUSR: mode_t = 0o200;
+pub const S_IXUSR: mode_t = 0o100;
+pub const S_IRWXG: mode_t = 0o70;
+pub const S_IRGRP: mode_t = 0o40;
+pub const S_IWGRP: mode_t = 0o20;
+pub const S_IXGRP: mode_t = 0o10;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IROTH: mode_t = 4;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IFLNK: mode_t = 0o120000;
+pub const S_IFSOCK: mode_t = 0o140000;
+pub const S_IEXEC: mode_t = 0o100;
+pub const S_IWRITE: mode_t = 0o200;
+pub const S_IREAD: mode_t = 0o400;
+
+// 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: ::clockid_t = TIMEOFDAY as clockid_t;
+pub const CLOCK_MONOTONIC: ::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: ::tcflag_t = 0o21;
+pub const CSTOP: ::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: ::tcflag_t = 2;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const ECHO: ::tcflag_t = 0x20000;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOCTL: ::tcflag_t = 0x00020000;
+pub const ECHOPRT: ::tcflag_t = 0x00040000;
+pub const ECHOKE: ::tcflag_t = 0x00080000;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXON: ::tcflag_t = 0x0001;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const IXANY: ::tcflag_t = 0x00001000;
+pub const IMAXBEL: ::tcflag_t = 0x00010000;
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const IEXTEN: ::tcflag_t = 0x00200000;
+pub const TOSTOP: ::tcflag_t = 0x00010000;
+pub const FLUSHO: ::tcflag_t = 0x00100000;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::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: ::speed_t = 0x0;
+pub const B50: ::speed_t = 0x1;
+pub const B75: ::speed_t = 0x2;
+pub const B110: ::speed_t = 0x3;
+pub const B134: ::speed_t = 0x4;
+pub const B150: ::speed_t = 0x5;
+pub const B200: ::speed_t = 0x6;
+pub const B300: ::speed_t = 0x7;
+pub const B600: ::speed_t = 0x8;
+pub const B1200: ::speed_t = 0x9;
+pub const B1800: ::speed_t = 0xa;
+pub const B2400: ::speed_t = 0xb;
+pub const B4800: ::speed_t = 0xc;
+pub const B9600: ::speed_t = 0xd;
+pub const B19200: ::speed_t = 0xe;
+pub const B38400: ::speed_t = 0xf;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const IUCLC: ::tcflag_t = 0x00000800;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+pub const CRDLY: ::tcflag_t = 0x00000300;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00000100;
+pub const CR2: ::tcflag_t = 0x00000200;
+pub const CR3: ::tcflag_t = 0x00000300;
+pub const TABDLY: ::tcflag_t = 0x00000c00;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000400;
+pub const TAB2: ::tcflag_t = 0x00000800;
+pub const TAB3: ::tcflag_t = 0x00000c00;
+pub const BSDLY: ::tcflag_t = 0x00001000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00001000;
+pub const FFDLY: ::tcflag_t = 0x00002000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00002000;
+pub const NLDLY: ::tcflag_t = 0x00004000;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00004000;
+pub const VTDLY: ::tcflag_t = 0x00008000;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00008000;
+pub const OXTABS: ::tcflag_t = 0x00040000;
+pub const ONOEOT: ::tcflag_t = 0x00080000;
+pub const CBAUD: ::tcflag_t = 0x0000000f;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const CIBAUD: ::tcflag_t = 0x000f0000;
+pub const IBSHIFT: ::tcflag_t = 16;
+pub const PAREXT: ::tcflag_t = 0x00100000;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const ALTWERASE: ::tcflag_t = 0x00400000;
+
+// time.h
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 11;
+pub const CLOCK_THREAD_CPUTIME_ID: ::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::<cmsghdr>() {
+            (*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::<::cmsghdr>()) >
+                ((*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::<::cmsghdr>() as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        ::mem::size_of::<::cmsghdr>() as ::c_uint + length
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        ::mem::size_of::<::cmsghdr>() 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::<::c_long>() * 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::<::c_long>() * 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::<::c_long>() * 8;
+        let fd = fd as usize;
+        return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        let x = dev >> 16;
+        x as ::c_uint
+    }
+
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
+        let y = dev & 0xFFFF;
+        y as ::c_uint
+    }
+
+    pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::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 ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::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_setschedparam(
+        attr: *mut ::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 ::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 ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_cancel(thread: ::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: ::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 ::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_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn pthread_getschedparam(
+        thread: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::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 ::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 ::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 ::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: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_setschedprio(native: ::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 ::aiocb) -> ::c_int;
+    pub fn aio_error(aiocbp: *mut ::aiocb) -> ::c_int;
+    #[link_name = "_posix_aio_fsync"]
+    pub fn aio_fsync(op: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_read(aiocbp: *mut ::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 ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
+    pub fn clearenv() -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::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 ::DIR) -> ::c_int;
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn drand48() -> ::c_double;
+    pub fn duplocale(arg1: ::locale_t) -> ::locale_t;
+    pub fn endgrent();
+    pub fn endmntent(streamp: *mut ::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;
+    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 ::FILE) -> *mut ::group;
+    pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
+    pub fn fgetpwent(file: *mut ::FILE) -> *mut ::passwd;
+    pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn freopen64(
+        filename: *const c_char,
+        mode: *const c_char,
+        file: *mut ::FILE,
+    ) -> *mut ::FILE;
+    pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+    pub fn fsetpos64(stream: *mut ::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 ::FILE) -> ::off64_t;
+    pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
+    pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::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 ::group;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrset(user: *mut ::c_char) -> *mut ::c_char;
+    pub fn gethostid() -> ::c_long;
+    pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+    pub fn getnameinfo(
+        sa: *const ::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 ::uid_t, egid: *mut ::gid_t) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn getpwent() -> *mut ::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: ::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 ::rlimit) -> ::c_int;
+    pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn getitimer(which: ::c_int, curr_value: *mut ::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<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+    pub fn hasmntopt(mnt: *const ::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: ::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<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::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<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::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 ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+    pub fn mallinfo() -> ::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: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::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: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::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: ::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: ::locale_t) -> ::locale_t;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, loc: ::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 ::pollfd,
+        array_length: ::c_int,
+        timeout: ::c_int,
+    ) -> ::c_int;
+    pub fn pollset_query(ps: pollset_t, pollfd_query: *mut ::pollfd) -> ::c_int;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::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 ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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: ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getschedparam(
+        attr: *const posix_spawnattr_t,
+        param: *mut ::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: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::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 ::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 ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_int,
+        timeout: *mut ::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 ::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: ::pid_t, param: *mut sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::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: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sctp_opt_info(
+        sd: ::c_int,
+        id: ::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: ::sctp_assoc_t) -> ::c_int;
+    pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+    pub fn seekdir(dirp: *mut ::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 ::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: ::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 ::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 ::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 ::rlimit) -> ::c_int;
+    pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn setitimer(
+        which: ::c_int,
+        new_value: *const ::itimerval,
+        old_value: *mut ::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 ::sigset_t) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::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 ::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: ::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: ::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: ::locale_t,
+    ) -> ::c_int;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::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 ::DIR) -> ::c_long;
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *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,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::itimerspec,
+    ) -> ::c_int;
+    pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+    pub fn updwtmp(file: *const ::c_char, u: *mut utmp);
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn utmpname(file: *const ::c_char) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn writev(fd: ::c_int, iov: *const ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/aix/powerpc64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/aix/powerpc64.rs
new file mode 100644
index 00000000000..2cacf29f6b4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/aix/powerpc64.rs
@@ -0,0 +1,644 @@
+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: ::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: ::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_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: ::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: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_ssize: ::c_int,
+        pub st_atime: ::st_timespec,
+        pub st_mtime: ::st_timespec,
+        pub st_ctime: ::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; 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: ::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: ::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: ::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: ::sigset_t,
+        pub __sc_uerror: ::c_int,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::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: [::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: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_tv: ::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: ::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: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::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: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        pub si_band: ::c_long,
+        pub si_value: ::sigval,
+        pub __si_flags: ::c_int,
+        pub __pad: [::c_int; 3],
+    }
+
+    #[cfg(libc_union)]
+    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 fn(file: *mut file, rw: ::uio_rw, io: *mut ::c_void, ext: ::c_long,
+                             secattr: *mut ::c_void) -> ::c_int,
+        pub fo_ioctl: extern fn(file: *mut file, a: ::c_long, b: ::caddr_t, c: ::c_long,
+                                d: ::c_long) -> ::c_int,
+        pub fo_select: extern fn(file: *mut file, a: ::c_int, b: *mut ::c_ushort,
+                                 c: extern fn()) -> ::c_int,
+        pub fo_close: extern fn(file: *mut file) -> ::c_int,
+        pub fo_fstat: extern fn(file: *mut file, sstat: *mut ::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,
+        #[cfg(libc_union)]
+        pub f_lock: _kernel_simple_lock,
+        #[cfg(libc_union)]
+        pub f_offset_lock: _kernel_simple_lock,
+        pub f_vinfo: ::caddr_t,
+        pub f_ops: *mut fileops_t,
+        pub f_parentp: ::caddr_t,
+        pub f_fnamep: ::caddr_t,
+        pub f_fdata: [::c_char; 160],
+    }
+
+    #[cfg(libc_union)]
+    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,
+        #[cfg(libc_union)]
+        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],
+    }
+
+    #[cfg(libc_union)]
+    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,
+        #[cfg(libc_union)]
+        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) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::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 {
+                #[cfg(libc_union)]
+                let value_eq = self.si_value == other.si_value;
+                #[cfg(not(libc_union))]
+                let value_eq = true;
+                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
+                    && value_eq
+            }
+        }
+        impl Eq for siginfo_t {}
+        impl ::fmt::Debug for siginfo_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("siginfo_t");
+                struct_formatter.field("si_signo", &self.si_signo);
+                struct_formatter.field("si_errno", &self.si_errno);
+                struct_formatter.field("si_code", &self.si_code);
+                struct_formatter.field("si_pid", &self.si_pid);
+                struct_formatter.field("si_uid", &self.si_uid);
+                struct_formatter.field("si_status", &self.si_status);
+                struct_formatter.field("si_addr", &self.si_addr);
+                struct_formatter.field("si_band", &self.si_band);
+                #[cfg(libc_union)]
+                struct_formatter.field("si_value", &self.si_value);
+                struct_formatter.field("__si_flags", &self.__si_flags);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for siginfo_t {
+            fn hash<H: ::hash::Hasher>(&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);
+                #[cfg(libc_union)]
+                self.si_value.hash(state);
+                self.__si_flags.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for _kernel_simple_lock {
+            fn eq(&self, other: &_kernel_simple_lock) -> bool {
+                unsafe {
+                    self._slock == other._slock
+                        && self._slockp == other._slockp
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for _kernel_simple_lock {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for _kernel_simple_lock {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("_kernel_simple_lock")
+                    .field("_slock", unsafe { &self._slock })
+                    .field("_slockp", unsafe { &self._slockp })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for _kernel_simple_lock {
+            fn hash<H: ::hash::Hasher>(&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 {
+                let mut struct_formatter = f.debug_struct("fileops_t");
+                struct_formatter.field("fo_rw", &self.fo_rw);
+                struct_formatter.field("fo_ioctl", &self.fo_ioctl);
+                struct_formatter.field("fo_select", &self.fo_select);
+                struct_formatter.field("fo_close", &self.fo_close);
+                struct_formatter.field("fo_fstat", &self.fo_fstat);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for fileops_t {
+            fn hash<H: ::hash::Hasher>(&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 {
+                #[cfg(libc_union)]
+                let lock_eq = self.f_lock == other.f_lock
+                    && self.f_offset_lock == other.f_offset_lock;
+                #[cfg(not(libc_union))]
+                let lock_eq = true;
+                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
+                    && lock_eq
+            }
+        }
+        impl Eq for file {}
+        impl ::fmt::Debug for file {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("file");
+                struct_formatter.field("f_flag", &self.f_flag);
+                struct_formatter.field("f_count", &self.f_count);
+                struct_formatter.field("f_options", &self.f_options);
+                struct_formatter.field("f_type", &self.f_type);
+                struct_formatter.field("f_data", &self.f_data);
+                struct_formatter.field("f_offset", &self.f_offset);
+                struct_formatter.field("f_dir_off", &self.f_dir_off);
+                struct_formatter.field("f_cred", &self.f_cred);
+                #[cfg(libc_union)]
+                struct_formatter.field("f_lock", &self.f_lock);
+                #[cfg(libc_union)]
+                struct_formatter.field("f_offset_lock", &self.f_offset_lock);
+                struct_formatter.field("f_vinfo", &self.f_vinfo);
+                struct_formatter.field("f_ops", &self.f_ops);
+                struct_formatter.field("f_parentp", &self.f_parentp);
+                struct_formatter.field("f_fnamep", &self.f_fnamep);
+                struct_formatter.field("f_fdata", &self.f_fdata);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for file {
+            fn hash<H: ::hash::Hasher>(&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);
+                #[cfg(libc_union)]
+                self.f_lock.hash(state);
+                #[cfg(libc_union)]
+                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);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __ld_info_file {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __ld_info_file {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__ld_info_file")
+                    .field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
+                    .field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
+                    .field("_core_offset", unsafe { &self._core_offset })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __ld_info_file {
+            fn hash<H: ::hash::Hasher>(&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 {
+                #[cfg(libc_union)]
+                let file_eq = self._file == other._file;
+                #[cfg(not(libc_union))]
+                let file_eq = true;
+                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
+                    && file_eq
+            }
+        }
+        impl Eq for ld_info {}
+        impl ::fmt::Debug for ld_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("ld_info");
+                struct_formatter.field("ldinfo_next", &self.ldinfo_next);
+                struct_formatter.field("ldinfo_flags", &self.ldinfo_flags);
+                struct_formatter.field("ldinfo_textorg", &self.ldinfo_textorg);
+                struct_formatter.field("ldinfo_textsize", &self.ldinfo_textsize);
+                struct_formatter.field("ldinfo_dataorg", &self.ldinfo_dataorg);
+                struct_formatter.field("ldinfo_datasize", &self.ldinfo_datasize);
+                struct_formatter.field("ldinfo_filename", &self.ldinfo_filename);
+                #[cfg(libc_union)]
+                struct_formatter.field("_file", &self._file);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for ld_info {
+            fn hash<H: ::hash::Hasher>(&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);
+                #[cfg(libc_union)]
+                self._file.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __pollfd_ext_u {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __pollfd_ext_u {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__pollfd_ext_u")
+                    .field("addr", unsafe { &self.addr })
+                    .field("data32", unsafe { &self.data32 })
+                    .field("data", unsafe { &self.data })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __pollfd_ext_u {
+            fn hash<H: ::hash::Hasher>(&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 {
+                #[cfg(libc_union)]
+                let data_eq = self.data == other.data;
+                #[cfg(not(libc_union))]
+                let data_eq = true;
+                self.fd == other.fd
+                    && self.events == other.events
+                    && self.revents == other.revents
+                    && data_eq
+            }
+        }
+        impl Eq for pollfd_ext {}
+        impl ::fmt::Debug for pollfd_ext {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("pollfd_ext");
+                struct_formatter.field("fd", &self.fd);
+                struct_formatter.field("events", &self.events);
+                struct_formatter.field("revents", &self.revents);
+                #[cfg(libc_union)]
+                struct_formatter.field("data", &self.data);
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for pollfd_ext {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fd.hash(state);
+                self.events.hash(state);
+                self.revents.hash(state);
+                #[cfg(libc_union)]
+                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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/align.rs
new file mode 100644
index 00000000000..4fdba9a6aba
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/align.rs
@@ -0,0 +1,6 @@
+s! {
+    #[repr(align(4))]
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/align.rs
new file mode 100644
index 00000000000..ca1fe1ce299
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/mod.rs
new file mode 100644
index 00000000000..0f1722f9757
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b32/mod.rs
@@ -0,0 +1,119 @@
+//! 32-bit specific Apple (ios/darwin) definitions
+
+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: ::timeval,
+        pub ifi_unused2: u32,
+        pub ifi_hwassist: u32,
+        pub ifi_reserved1: u32,
+        pub ifi_reserved2: u32,
+    }
+
+    pub struct bpf_hdr {
+        pub bh_tstamp: ::timeval,
+        pub bh_caplen: u32,
+        pub bh_datalen: u32,
+        pub bh_hdrlen: ::c_ushort,
+    }
+
+    pub struct malloc_zone_t {
+        __private: [::uintptr_t; 18], // FIXME: keeping private for now
+    }
+}
+
+s_no_extra_traits! {
+    pub struct pthread_attr_t {
+        __sig: c_long,
+        __opaque: [::c_char; 36]
+    }
+}
+
+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<H: ::hash::Hasher>(&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_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;
+
+extern "C" {
+    pub fn exchangedata(
+        path1: *const ::c_char,
+        path2: *const ::c_char,
+        options: ::c_ulong,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs
new file mode 100644
index 00000000000..131e15b69ad
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs
@@ -0,0 +1,55 @@
+pub type mcontext_t = *mut __darwin_mcontext64;
+
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    pub struct max_align_t {
+        priv_: f64
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_onstack: ::c_int,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_link: *mut ::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,
+    }
+
+    // This type natively uses a uint128, but for a while we hacked
+    // it in with repr(align) and `[u64; 2]`. uint128 isn't available
+    // all the way back to our earliest supported versions so we
+    // preserver the old shim.
+    #[cfg_attr(not(libc_int128), repr(align(16)))]
+    pub struct __darwin_arm_neon_state64 {
+        #[cfg(libc_int128)]
+        pub __v: [::__uint128_t; 32],
+        #[cfg(not(libc_int128))]
+        pub __v: [[u64; 2]; 32],
+        pub __fpsr: u32,
+        pub __fpcr: u32,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs
new file mode 100644
index 00000000000..79e9ac842f9
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs
@@ -0,0 +1,14 @@
+pub type boolean_t = ::c_int;
+
+s! {
+    pub struct malloc_zone_t {
+        __private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/align.rs
new file mode 100644
index 00000000000..ca1fe1ce299
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/mod.rs
new file mode 100644
index 00000000000..48d94bcd6bf
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/mod.rs
@@ -0,0 +1,124 @@
+//! 64-bit specific Apple (ios/darwin) definitions
+
+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: ::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]
+    }
+}
+
+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<H: ::hash::Hasher>(&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_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;
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs
new file mode 100644
index 00000000000..ca1fe1ce299
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs
new file mode 100644
index 00000000000..653650c2628
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs
@@ -0,0 +1,180 @@
+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: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_link: *mut ::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: [::uintptr_t; 16], // FIXME: keeping private for now
+    }
+
+    pub struct malloc_zone_t {
+        _reserved1: *mut ::c_void,
+        _reserved2: *mut ::c_void,
+        pub size: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *const ::c_void,
+        ) -> ::size_t>,
+        pub malloc: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            size: ::size_t,
+        ) -> *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<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            size: ::size_t
+        ) -> *mut ::c_void>,
+        pub free: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void
+        )>,
+        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<unsafe extern "C" fn(zone: *mut malloc_zone_t)>,
+        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<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void,
+            size: ::size_t
+        )>,
+        pub pressure_relief: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            goal: ::size_t,
+        ) -> ::size_t>,
+        pub claimed_address: ::Option<unsafe extern "C" fn(
+            zone: *mut malloc_zone_t,
+            ptr: *mut ::c_void,
+        ) -> ::boolean_t>,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/long_array.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/long_array.rs
new file mode 100644
index 00000000000..4c56a275ab3
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/long_array.rs
@@ -0,0 +1,8 @@
+s! {
+    pub struct ctl_info {
+        pub ctl_id: u32,
+        pub ctl_name: [::c_char; MAX_KCTL_NAME],
+    }
+}
+
+pub const MAX_KCTL_NAME: usize = 96;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/mod.rs
new file mode 100644
index 00000000000..2e7827231e6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/apple/mod.rs
@@ -0,0 +1,6528 @@
+//! Apple (ios/darwin)-specific definitions
+//!
+//! This covers *-apple-* triples currently
+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 = ::uintptr_t;
+pub type vm_size_t = ::uintptr_t;
+pub type vm_address_t = vm_offset_t;
+
+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 = ::mach_port_t;
+pub type thread_act_t = ::mach_port_t;
+pub type thread_act_array_t = *mut ::thread_act_t;
+pub type policy_t = ::c_int;
+pub type mach_vm_address_t = u64;
+pub type mach_vm_offset_t = u64;
+pub type mach_vm_size_t = u64;
+pub type vm_map_t = ::mach_port_t;
+pub type mem_entry_name_port_t = ::mach_port_t;
+pub type memory_object_t = ::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 = ::mach_port_t;
+pub type ledger_array_t = *mut ::ledger_t;
+
+pub type iconv_t = *mut ::c_void;
+
+pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
+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 = ::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: ::pthread_t, addr: *mut ::c_void, size: ::size_t);
+pub type pthread_jit_write_callback_t = ::Option<extern "C" fn(ctx: *mut ::c_void) -> ::c_int>;
+
+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 = ::mach_port_t;
+pub type task_inspect_t = ::mach_port_t;
+
+pub type sysdir_search_path_enumeration_state = ::c_uint;
+
+pub type CCStatus = i32;
+pub type CCCryptorStatus = i32;
+pub type CCRNGStatus = ::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: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::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: ::uid_t,
+        pub st_gid: ::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: ::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: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        //Requires it to be union for tests
+        //pub si_value: ::sigval,
+        _pad: [usize; 9],
+    }
+
+    pub struct sigaction {
+        // FIXME: this field is actually a union
+        pub sa_sigaction: ::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: ::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 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: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::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,
+        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: ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::pid_t,
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+    }
+
+    pub struct sf_hdtr {
+        pub headers: *mut ::iovec,
+        pub hdr_cnt: ::c_int,
+        pub trailers: *mut ::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: ::uid_t,
+        pub pbi_gid: ::gid_t,
+        pub pbi_ruid: ::uid_t,
+        pub pbi_rgid: ::gid_t,
+        pub pbi_svuid: ::uid_t,
+        pub pbi_svgid: ::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: ::boolean_t,
+    }
+
+    pub struct xucred {
+        pub cr_version: ::c_uint,
+        pub cr_uid: ::uid_t,
+        pub cr_ngroups: ::c_short,
+        pub cr_groups: [::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: ::in_addr,
+        pub sin_srcaddr: ::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: ::in_addr,
+        pub ipi_addr: ::in_addr,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    // sys/ipc.h:
+
+    pub struct ipc_perm {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub _seq: ::c_ushort,
+        pub _key: ::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: ::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; ::IFNAMSIZ],
+    }
+
+    // sys/socket.h
+
+    pub struct sa_endpoints_t {
+        pub sae_srcif: ::c_uint, // optional source interface
+        pub sae_srcaddr: *const ::sockaddr, // optional source address
+        pub sae_srcaddrlen: ::socklen_t, // size of source address
+        pub sae_dstaddr: *const ::sockaddr, // destination address
+        pub sae_dstaddrlen: ::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: ::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: ::vm_address_t,
+        pub size: ::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: ::uid_t,
+        pub vst_gid: ::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: ::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: ::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,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct ifconf {
+        pub ifc_len: ::c_int,
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ifreq,
+    }
+
+    #[cfg_attr(libc_align, 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,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct kevent {
+        pub ident: ::uintptr_t,
+        pub filter: i16,
+        pub flags: u16,
+        pub fflags: u32,
+        pub data: ::intptr_t,
+        pub udata: *mut ::c_void,
+    }
+
+    #[cfg_attr(libc_packedN, 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: ::time_t,
+        pub sem_pad1: i32,
+        pub sem_ctime: ::time_t,
+        pub sem_pad2: i32,
+        pub sem_pad3: [i32; 4],
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct shmid_ds {
+        pub shm_perm: ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
+        pub shm_dtime: ::time_t,  // FIXME: 64-bit wrong align => wrong offset
+        pub shm_ctime: ::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: ::fsid_t,
+        pub f_owner: ::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: ::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: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_tv: ::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: ::sigval,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut ::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: ::boolean_t,
+        pub slot_num: ::c_int,
+        pub is_master: ::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: ::integer_t,
+        pub policy: ::policy_t,
+        pub run_state: ::integer_t,
+        pub flags: ::integer_t,
+        pub suspend_count: ::integer_t,
+        pub sleep_time: ::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],
+    }
+
+    #[cfg_attr(libc_packedN, 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: ::timeval,
+        #[cfg(not(target_pointer_width = "32"))]
+        pub ifi_lastchange: timeval32,
+    }
+
+    #[cfg_attr(libc_packedN, 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,
+    }
+
+    #[cfg_attr(libc_packedN, 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,
+    }
+
+    #[cfg_attr(libc_packedN, 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: ::policy_t,
+        pub suspend_count: integer_t,
+    }
+
+    #[cfg_attr(libc_packedN, 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,
+    }
+
+   #[cfg_attr(libc_packedN, repr(packed(1)))]
+    pub struct sockaddr_vm {
+        pub svm_len: ::c_uchar,
+        pub svm_family: ::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,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifk_data {
+        pub ifk_ptr: *mut ::c_void,
+        pub ifk_value: ::c_int,
+    }
+
+    #[cfg_attr(libc_packedN, repr(packed(4)))]
+    pub struct ifkpi {
+        pub ifk_module_id: ::c_uint,
+        pub ifk_type: ::c_uint,
+        #[cfg(libc_union)]
+        pub ifk_data: __c_anonymous_ifk_data,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::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; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_char,
+        pub ifcu_req: *mut ifreq,
+    }
+}
+
+impl siginfo_t {
+    pub unsafe fn si_addr(&self) -> *mut ::c_void {
+        self.si_addr
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            _si_pid: ::pid_t,
+            _si_uid: ::uid_t,
+            _si_status: ::c_int,
+            _si_addr: *mut ::c_void,
+            si_value: ::sigval,
+        }
+
+        (*(self as *const siginfo_t as *const siginfo_timer)).si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        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 ::fmt::Debug for semun {
+                    fn fmt(&self, f: &mut ::fmt::Formatter)
+                           -> ::fmt::Result {
+                        f.debug_struct("semun")
+                            .field("val", unsafe { &self.val })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for semun {
+                    fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                        unsafe { self.val.hash(state) };
+                    }
+                }
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifdm_current.hash(state);
+                self.ifdm_min.hash(state);
+                self.ifdm_max.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifk_data {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifk_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifk_data")
+                    .field("ifk_ptr", unsafe { &self.ifk_ptr })
+                    .field("ifk_value", unsafe { &self.ifk_value })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifk_data {
+            fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifk_module_id.hash(state);
+                self.ifk_type.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifr_ifru {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_metrics", unsafe { &self.ifru_metrics })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_phys", unsafe { &self.ifru_phys })
+                    .field("ifru_media", unsafe { &self.ifru_media })
+                    .field("ifru_intval", unsafe { &self.ifru_intval })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .field("ifru_devmtu", unsafe { &self.ifru_devmtu })
+                    .field("ifru_kpi", unsafe { &self.ifru_kpi })
+                    .field("ifru_wake_flags", unsafe { &self.ifru_wake_flags })
+                    .field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt })
+                    .field("ifru_cap", unsafe { &self.ifru_cap })
+                    .field("ifru_functional_type", unsafe { &self.ifru_functional_type })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifr_ifru {
+            fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifr_name.hash(state);
+                self.ifr_ifru.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifc_ifcu {}
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifc_ifcu")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.ifcu_buf.hash(state) };
+                unsafe { self.ifcu_req.hash(state) };
+            }
+        }
+    }
+}
+
+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: ::nl_item = 0;
+pub const D_T_FMT: ::nl_item = 1;
+pub const D_FMT: ::nl_item = 2;
+pub const T_FMT: ::nl_item = 3;
+pub const T_FMT_AMPM: ::nl_item = 4;
+pub const AM_STR: ::nl_item = 5;
+pub const PM_STR: ::nl_item = 6;
+
+pub const DAY_1: ::nl_item = 7;
+pub const DAY_2: ::nl_item = 8;
+pub const DAY_3: ::nl_item = 9;
+pub const DAY_4: ::nl_item = 10;
+pub const DAY_5: ::nl_item = 11;
+pub const DAY_6: ::nl_item = 12;
+pub const DAY_7: ::nl_item = 13;
+
+pub const ABDAY_1: ::nl_item = 14;
+pub const ABDAY_2: ::nl_item = 15;
+pub const ABDAY_3: ::nl_item = 16;
+pub const ABDAY_4: ::nl_item = 17;
+pub const ABDAY_5: ::nl_item = 18;
+pub const ABDAY_6: ::nl_item = 19;
+pub const ABDAY_7: ::nl_item = 20;
+
+pub const MON_1: ::nl_item = 21;
+pub const MON_2: ::nl_item = 22;
+pub const MON_3: ::nl_item = 23;
+pub const MON_4: ::nl_item = 24;
+pub const MON_5: ::nl_item = 25;
+pub const MON_6: ::nl_item = 26;
+pub const MON_7: ::nl_item = 27;
+pub const MON_8: ::nl_item = 28;
+pub const MON_9: ::nl_item = 29;
+pub const MON_10: ::nl_item = 30;
+pub const MON_11: ::nl_item = 31;
+pub const MON_12: ::nl_item = 32;
+
+pub const ABMON_1: ::nl_item = 33;
+pub const ABMON_2: ::nl_item = 34;
+pub const ABMON_3: ::nl_item = 35;
+pub const ABMON_4: ::nl_item = 36;
+pub const ABMON_5: ::nl_item = 37;
+pub const ABMON_6: ::nl_item = 38;
+pub const ABMON_7: ::nl_item = 39;
+pub const ABMON_8: ::nl_item = 40;
+pub const ABMON_9: ::nl_item = 41;
+pub const ABMON_10: ::nl_item = 42;
+pub const ABMON_11: ::nl_item = 43;
+pub const ABMON_12: ::nl_item = 44;
+
+pub const CLOCK_REALTIME: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_MONOTONIC_RAW_APPROX: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC: ::clockid_t = 6;
+pub const CLOCK_UPTIME_RAW: ::clockid_t = 8;
+pub const CLOCK_UPTIME_RAW_APPROX: ::clockid_t = 9;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
+
+pub const ERA: ::nl_item = 45;
+pub const ERA_D_FMT: ::nl_item = 46;
+pub const ERA_D_T_FMT: ::nl_item = 47;
+pub const ERA_T_FMT: ::nl_item = 48;
+pub const ALT_DIGITS: ::nl_item = 49;
+
+pub const RADIXCHAR: ::nl_item = 50;
+pub const THOUSEP: ::nl_item = 51;
+
+pub const YESEXPR: ::nl_item = 52;
+pub const NOEXPR: ::nl_item = 53;
+
+pub const YESSTR: ::nl_item = 54;
+pub const NOSTR: ::nl_item = 55;
+
+pub const CRNCYSTR: ::nl_item = 56;
+
+pub const D_MD_ORDER: ::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 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 S_IFIFO: mode_t = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+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;
+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_ALLOCATECONTIG: ::c_uint = 0x02;
+pub const F_ALLOCATEALL: ::c_uint = 0x04;
+
+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;
+#[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;
+/// gateway<sup>2</sup> (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 IPV6_DONTFRAG: ::c_int = 62;
+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;
+
+pub const LOCAL_PEERCRED: ::c_int = 0x001;
+pub const LOCAL_PEERPID: ::c_int = 0x002;
+pub const LOCAL_PEEREPID: ::c_int = 0x003;
+pub const LOCAL_PEERUUID: ::c_int = 0x004;
+pub const LOCAL_PEEREUUID: ::c_int = 0x005;
+
+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 SHUT_RD: ::c_int = 0;
+pub const SHUT_WR: ::c_int = 1;
+pub const SHUT_RDWR: ::c_int = 2;
+
+pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0;
+/// ((sae_associd_t)(-1ULL))
+pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff;
+
+pub const SAE_CONNID_ANY: ::sae_connid_t = 0;
+/// ((sae_connid_t)(-1ULL))
+pub const SAE_CONNID_ALL: ::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: ::os_log_type_t = 0x00;
+pub const OS_LOG_TYPE_INFO: ::os_log_type_t = 0x01;
+pub const OS_LOG_TYPE_DEBUG: ::os_log_type_t = 0x02;
+pub const OS_LOG_TYPE_ERROR: ::os_log_type_t = 0x10;
+pub const OS_LOG_TYPE_FAULT: ::os_log_type_t = 0x11;
+
+pub const OS_SIGNPOST_EVENT: ::os_signpost_type_t = 0x00;
+pub const OS_SIGNPOST_INTERVAL_BEGIN: ::os_signpost_type_t = 0x01;
+pub const OS_SIGNPOST_INTERVAL_END: ::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_TRACK: u32 = 0x00000001;
+pub const NOTE_TRACKERR: u32 = 0x00000002;
+pub const NOTE_CHILD: u32 = 0x00000004;
+
+pub const OCRNL: ::tcflag_t = 0x00000010;
+pub const ONOCR: ::tcflag_t = 0x00000020;
+pub const ONLRET: ::tcflag_t = 0x00000040;
+pub const OFILL: ::tcflag_t = 0x00000080;
+pub const NLDLY: ::tcflag_t = 0x00000300;
+pub const TABDLY: ::tcflag_t = 0x00000c04;
+pub const CRDLY: ::tcflag_t = 0x00003000;
+pub const FFDLY: ::tcflag_t = 0x00004000;
+pub const BSDLY: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0x00010000;
+pub const OFDEL: ::tcflag_t = 0x00020000;
+
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000400;
+pub const TAB2: ::tcflag_t = 0x00000800;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00001000;
+pub const CR2: ::tcflag_t = 0x00002000;
+pub const CR3: ::tcflag_t = 0x00003000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00004000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00008000;
+pub const TAB3: ::tcflag_t = 0x00000004;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00010000;
+pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const CRTSCTS: ::tcflag_t = 0x00030000;
+
+pub const NI_MAXHOST: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::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: ::vm_prot_t = 0x00;
+pub const VM_PROT_READ: ::vm_prot_t = 0x01;
+pub const VM_PROT_WRITE: ::vm_prot_t = 0x02;
+pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04;
+pub const MEMORY_OBJECT_NULL: ::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 ::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_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_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_STATIC: ::c_int = 0x800;
+pub const RTF_BLACKHOLE: ::c_int = 0x1000;
+pub const RTF_NOIFREF: ::c_int = 0x2000;
+pub const RTF_PROTO2: ::c_int = 0x4000;
+pub const RTF_PROTO1: ::c_int = 0x8000;
+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_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_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;
+
+// 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;
+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:
+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;
+
+//<sys/timex.h>
+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;
+
+// <sys/mount.h>
+pub const MNT_WAIT: ::c_int = 1;
+pub const MNT_NOWAIT: ::c_int = 2;
+
+// <mach/thread_policy.h>
+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;
+
+// <mach/thread_info.h>
+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: ::copyfile_flags_t = 1 << 0;
+pub const COPYFILE_STAT: ::copyfile_flags_t = 1 << 1;
+pub const COPYFILE_XATTR: ::copyfile_flags_t = 1 << 2;
+pub const COPYFILE_DATA: ::copyfile_flags_t = 1 << 3;
+pub const COPYFILE_SECURITY: ::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL;
+pub const COPYFILE_METADATA: ::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR;
+pub const COPYFILE_RECURSIVE: ::copyfile_flags_t = 1 << 15;
+pub const COPYFILE_CHECK: ::copyfile_flags_t = 1 << 16;
+pub const COPYFILE_EXCL: ::copyfile_flags_t = 1 << 17;
+pub const COPYFILE_NOFOLLOW_SRC: ::copyfile_flags_t = 1 << 18;
+pub const COPYFILE_NOFOLLOW_DST: ::copyfile_flags_t = 1 << 19;
+pub const COPYFILE_MOVE: ::copyfile_flags_t = 1 << 20;
+pub const COPYFILE_UNLINK: ::copyfile_flags_t = 1 << 21;
+pub const COPYFILE_NOFOLLOW: ::copyfile_flags_t = COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST;
+pub const COPYFILE_PACK: ::copyfile_flags_t = 1 << 22;
+pub const COPYFILE_UNPACK: ::copyfile_flags_t = 1 << 23;
+pub const COPYFILE_CLONE: ::copyfile_flags_t = 1 << 24;
+pub const COPYFILE_CLONE_FORCE: ::copyfile_flags_t = 1 << 25;
+pub const COPYFILE_RUN_IN_PLACE: ::copyfile_flags_t = 1 << 26;
+pub const COPYFILE_DATA_SPARSE: ::copyfile_flags_t = 1 << 27;
+pub const COPYFILE_PRESERVE_DST_TRACKED: ::copyfile_flags_t = 1 << 28;
+pub const COPYFILE_VERBOSE: ::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;
+
+// <sys/attr.h>
+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;
+
+// <proc.h>
+/// 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;
+
+cfg_if! {
+    if #[cfg(libc_const_extern_fn)] {
+        const fn __DARWIN_ALIGN32(p: usize) -> usize {
+            const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
+            p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
+        }
+    } else if #[cfg(libc_const_size_of)] {
+        fn __DARWIN_ALIGN32(p: usize) -> usize {
+            const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
+            p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
+        }
+    } else {
+        fn __DARWIN_ALIGN32(p: usize) -> usize {
+            let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
+            p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_extended_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_time_constraint_policy_data_t>() /
+             ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
+        pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_precedence_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_affinity_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_background_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_latency_qos_policy_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_throughput_qos_policy_data_t>() /
+             ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
+        pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_basic_info_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_identifier_info_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+        pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<thread_extended_info_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+
+        pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
+            (::mem::size_of::<task_thread_times_info_data_t>()
+            / ::mem::size_of::<natural_t>()) as u32;
+        pub const MACH_TASK_BASIC_INFO_COUNT: u32 = (::mem::size_of::<mach_task_basic_info_data_t>()
+            / ::mem::size_of::<natural_t>()) as u32;
+        pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t =
+            (::mem::size_of::<vm_statistics64_data_t>() / ::mem::size_of::<integer_t>())
+            as mach_msg_type_number_t;
+    } else {
+        pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4;
+        pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
+        pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10;
+        pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6;
+        pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28;
+        pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = 4;
+        pub const MACH_TASK_BASIC_INFO_COUNT: u32 = 12;
+        pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = 38;
+    }
+}
+
+f! {
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr,
+                       cmsg: *const ::cmsghdr) -> *mut ::cmsghdr {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let cmsg_len = (*cmsg).cmsg_len as usize;
+        let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
+        let max = (*mhdr).msg_control as usize
+                    + (*mhdr).msg_controllen as usize;
+        if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
+            0 as *mut ::cmsghdr
+        } else {
+            next as *mut ::cmsghdr
+        }
+    }
+
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>())
+            + __DARWIN_ALIGN32(length as usize))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + 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 ::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: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "confstr$UNIX2003"
+    )]
+    pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
+    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 ::DIR) -> ::c_int;
+
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::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 ::tm) -> *mut ::c_char;
+    pub fn ctime(clock: *const time_t) -> *mut ::c_char;
+    pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
+    pub fn strptime(
+        buf: *const ::c_char,
+        format: *const ::c_char,
+        timeptr: *mut ::tm,
+    ) -> *mut ::c_char;
+    pub fn asctime_r(tm: *const ::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 ::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 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 ::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 ::mach_timebase_info) -> ::c_int;
+    pub fn mach_host_self() -> mach_port_t;
+    pub fn mach_thread_self() -> mach_port_t;
+    pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
+    pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
+    pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
+    pub fn pthread_create_from_mach_thread(
+        thread: *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_stack_frame_decode_np(
+        frame_addr: ::uintptr_t,
+        return_addr: *mut ::uintptr_t,
+    ) -> ::uintptr_t;
+    pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
+    pub fn pthread_get_stacksize_np(thread: ::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: ::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: ::pthread_t,
+        class: *mut qos_class_t,
+        priority: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        thread: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn pthread_setschedparam(
+        thread: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+
+    // Available from Big Sur
+    pub fn pthread_introspection_hook_install(
+        hook: ::pthread_introspection_hook_t,
+    ) -> ::pthread_introspection_hook_t;
+    pub fn pthread_introspection_setspecific_np(
+        thread: ::pthread_t,
+        key: ::pthread_key_t,
+        value: *const ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_introspection_getspecific_np(
+        thread: ::pthread_t,
+        key: ::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::<libc::pthread_jit_write_callback_t>(std::ptr::null())];
+    // (a handy PTHREAD_JIT_WRITE_CALLBACK_NP macro for other languages).
+    pub fn pthread_jit_write_with_callback_np(
+        callback: ::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;
+
+    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) -> ::os_log_t;
+    pub fn os_log_type_enabled(oslog: ::os_log_t, tpe: ::os_log_type_t) -> bool;
+    pub fn os_signpost_id_make_with_pointer(
+        log: ::os_log_t,
+        ptr: *const ::c_void,
+    ) -> ::os_signpost_id_t;
+    pub fn os_signpost_id_generate(log: ::os_log_t) -> ::os_signpost_id_t;
+    pub fn os_signpost_enabled(log: ::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 ::kevent,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent,
+        nevents: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn kevent64(
+        kq: ::c_int,
+        changelist: *const ::kevent64_s,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent64_s,
+        nevents: ::c_int,
+        flags: ::c_uint,
+        timeout: *const ::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: ::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 ::sf_hdtr,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::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 ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t) -> ::c_int;
+    pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::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 ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::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 ::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 ::timeval, tz: *const ::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 ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_setarchpref_np(
+        attr: *mut posix_spawnattr_t,
+        count: ::size_t,
+        pref: *mut ::cpu_type_t,
+        subpref: *mut ::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 ::cpu_type_t,
+        subpref: *mut ::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 ::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 ::cpu_type_t,
+        ocount: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_set_qos_class_np(
+        attr: *mut posix_spawnattr_t,
+        qos_class: ::qos_class_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_get_qos_class_np(
+        attr: *const posix_spawnattr_t,
+        qos_class: *mut ::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: ::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 ::utsname) -> ::c_int;
+
+    pub fn connectx(
+        socket: ::c_int,
+        endpoints: *const sa_endpoints_t,
+        associd: sae_associd_t,
+        flags: ::c_uint,
+        iov: *const ::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;
+
+    // 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 ::malloc_zone_t) -> ::boolean_t;
+    pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
+    pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
+    pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
+    pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
+    pub fn malloc_default_zone() -> *mut ::malloc_zone_t;
+    pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t;
+    pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
+    pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
+    pub fn malloc_zone_calloc(
+        zone: *mut ::malloc_zone_t,
+        num_items: ::size_t,
+        size: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn malloc_zone_realloc(
+        zone: *mut ::malloc_zone_t,
+        ptr: *mut ::c_void,
+        size: ::size_t,
+    ) -> *mut ::c_void;
+    pub fn malloc_zone_free(zone: *mut ::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: ::pid_t,
+        buffer: *mut ::c_void,
+        buffersize: ::c_int,
+    ) -> ::c_int;
+    pub fn proc_listchildpids(ppid: ::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 ::timespec) -> ::c_int;
+
+    pub fn gethostid() -> ::c_long;
+    pub fn sethostid(hostid: ::c_long);
+
+    pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
+    pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+
+    pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int;
+    pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char;
+
+    pub fn mach_vm_map(
+        target_task: ::vm_map_t,
+        address: *mut ::mach_vm_address_t,
+        size: ::mach_vm_size_t,
+        mask: ::mach_vm_offset_t,
+        flags: ::c_int,
+        object: ::mem_entry_name_port_t,
+        offset: ::memory_object_offset_t,
+        copy: ::boolean_t,
+        cur_protection: ::vm_prot_t,
+        max_protection: ::vm_prot_t,
+        inheritance: ::vm_inherit_t,
+    ) -> ::kern_return_t;
+
+    pub fn vm_allocate(
+        target_task: vm_map_t,
+        address: *mut vm_address_t,
+        size: vm_size_t,
+        flags: ::c_int,
+    ) -> ::kern_return_t;
+
+    pub fn vm_deallocate(
+        target_task: vm_map_t,
+        address: vm_address_t,
+        size: vm_size_t,
+    ) -> ::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,
+    ) -> ::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,
+    ) -> ::kern_return_t;
+
+    pub static mut mach_task_self_: ::mach_port_t;
+    pub fn task_for_pid(
+        host: ::mach_port_t,
+        pid: ::pid_t,
+        task: *mut ::mach_port_t,
+    ) -> ::kern_return_t;
+    pub fn task_info(
+        host: ::mach_port_t,
+        flavor: task_flavor_t,
+        task_info_out: task_info_t,
+        task_info_count: *mut mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+    pub fn task_create(
+        target_task: ::task_t,
+        ledgers: ::ledger_array_t,
+        ledgersCnt: ::mach_msg_type_number_t,
+        inherit_memory: ::boolean_t,
+        child_task: *mut ::task_t,
+    ) -> ::kern_return_t;
+    pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t;
+    pub fn task_threads(
+        target_task: ::task_inspect_t,
+        act_list: *mut ::thread_act_array_t,
+        act_listCnt: *mut ::mach_msg_type_number_t,
+    ) -> ::kern_return_t;
+    pub fn host_statistics(
+        host_priv: host_t,
+        flavor: host_flavor_t,
+        host_info_out: host_info_t,
+        host_info_outCnt: *mut mach_msg_type_number_t,
+    ) -> ::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,
+    ) -> ::sysdir_search_path_enumeration_state;
+    pub fn sysdir_get_next_search_path_enumeration(
+        state: ::sysdir_search_path_enumeration_state,
+        path: *mut ::c_char,
+    ) -> ::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: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::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;
+}
+
+pub unsafe fn mach_task_self() -> ::mach_port_t {
+    mach_task_self_
+}
+
+cfg_if! {
+    if #[cfg(target_os = "macos")] {
+        extern "C" {
+            pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+        }
+    }
+}
+cfg_if! {
+    if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] {
+        extern "C" {
+            pub fn memmem(
+                haystack: *const ::c_void,
+                haystacklen: ::size_t,
+                needle: *const ::c_void,
+                needlelen: ::size_t,
+            ) -> *mut ::c_void;
+            pub fn task_set_info(target_task: ::task_t,
+                                 flavor: ::task_flavor_t,
+                                 task_info_in: ::task_info_t,
+                                 task_info_inCnt: ::mach_msg_type_number_t
+            ) -> ::kern_return_t;
+        }
+    }
+}
+
+// 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.
+#[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
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_long_array)] {
+        mod long_array;
+        pub use self::long_array::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs
new file mode 100644
index 00000000000..5fe6bb89cf2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs
@@ -0,0 +1,13 @@
+// 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
new file mode 100644
index 00000000000..6ade7949afb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -0,0 +1,1732 @@
+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 = ::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 = ::uintptr_t;
+pub type pthread_spinlock_t = ::uintptr_t;
+
+pub type segsz_t = usize;
+
+pub type vm_prot_t = u8;
+pub type vm_maptype_t = u8;
+pub type vm_inherit_t = i8;
+pub type vm_subsys_t = ::c_int;
+pub type vm_eflags_t = ::c_uint;
+
+pub type vm_map_t = *mut __c_anonymous_vm_map;
+pub type vm_map_entry_t = *mut vm_map_entry;
+
+pub type pmap = __c_anonymous_pmap;
+
+#[cfg_attr(feature = "extra_traits", derive(Debug))]
+pub enum sem {}
+impl ::Copy for sem {}
+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: ::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: ::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 f_owner: ::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: ::uuid_t,
+        pub f_uid_uuid: ::uuid_t,
+    }
+
+    pub struct stat {
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_dev: ::dev_t,
+        pub st_mode: ::mode_t,
+        pub st_padding1: u16,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::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_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: ::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: ::uid_t,
+        pub cr_ngroups: ::c_short,
+        pub cr_groups: [::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        shm_internal: *mut ::c_void,
+    }
+
+    pub struct kinfo_file {
+        pub f_size: ::size_t,
+        pub f_pid: ::pid_t,
+        pub f_uid: ::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: ::pid_t,
+        pub kl_tid: ::lwpid_t,
+        pub kl_flags: ::c_int,
+        pub kl_stat: ::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: ::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: ::rusage,
+        pub kl_siglist: ::sigset_t,
+        pub kl_sigmask: ::sigset_t,
+        pub kl_wchan: ::uintptr_t,
+        pub kl_wmesg: [::c_char; 9],
+        pub kl_comm: [::c_char; MAXCOMLEN+1],
+    }
+
+    pub struct kinfo_proc {
+        pub kp_paddr: ::uintptr_t,
+        pub kp_flags: ::c_int,
+        pub kp_stat: ::procstat,
+        pub kp_lock: ::c_int,
+        pub kp_acflag: ::c_int,
+        pub kp_traceflag: ::c_int,
+        pub kp_fd: ::uintptr_t,
+        pub kp_siglist: ::sigset_t,
+        pub kp_sigignore: ::sigset_t,
+        pub kp_sigcatch: ::sigset_t,
+        pub kp_sigflag: ::c_int,
+        pub kp_start: ::timeval,
+        pub kp_comm: [::c_char; MAXCOMLEN+1],
+        pub kp_uid: ::uid_t,
+        pub kp_ngroups: ::c_short,
+        pub kp_groups: [::gid_t; NGROUPS],
+        pub kp_ruid: ::uid_t,
+        pub kp_svuid: ::uid_t,
+        pub kp_rgid: ::gid_t,
+        pub kp_svgid: ::gid_t,
+        pub kp_pid: ::pid_t,
+        pub kp_ppid: ::pid_t,
+        pub kp_pgid: ::pid_t,
+        pub kp_jobc: ::c_int,
+        pub kp_sid: ::pid_t,
+        pub kp_login: [::c_char; 40], // MAXNAMELEN rounded up to the nearest sizeof(long)
+        pub kp_tdev: ::dev_t,
+        pub kp_tpgid: ::pid_t,
+        pub kp_tsid: ::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: ::segsz_t,
+        pub kp_vm_swrss: ::segsz_t,
+        pub kp_vm_tsize: ::segsz_t,
+        pub kp_vm_dsize: ::segsz_t,
+        pub kp_vm_ssize: ::segsz_t,
+        pub kp_vm_prssize: ::c_uint,
+        pub kp_jailid: ::c_int,
+        pub kp_ru: ::rusage,
+        pub kp_cru: ::rusage,
+        pub kp_auxflags: ::c_int,
+        pub kp_lwp: ::kinfo_lwp,
+        pub kp_ktaddr: ::uintptr_t,
+        kp_spare: [::c_int; 2],
+    }
+
+    pub struct __c_anonymous_vm_map {
+        _priv: [::uintptr_t; 36],
+    }
+
+    pub struct vm_map_entry {
+        _priv: [::uintptr_t; 15],
+        pub eflags: ::vm_eflags_t,
+        pub maptype: ::vm_maptype_t,
+        pub protection: ::vm_prot_t,
+        pub max_protection: ::vm_prot_t,
+        pub inheritance: ::vm_inherit_t,
+        pub wired_count: ::c_int,
+        pub id: ::vm_subsys_t,
+    }
+
+    pub struct __c_anonymous_pmap {
+        _priv1: [::uintptr_t; 32],
+        _priv2: [::uintptr_t; 32],
+        _priv3: [::uintptr_t; 32],
+        _priv4: [::uintptr_t; 32],
+        _priv5: [::uintptr_t; 8],
+    }
+
+    pub struct vmspace {
+        vm_map: __c_anonymous_vm_map,
+        vm_pmap: __c_anonymous_pmap,
+        pub vm_flags: ::c_int,
+        pub vm_shm: *mut ::c_char,
+        pub vm_rssize: ::segsz_t,
+        pub vm_swrss: ::segsz_t,
+        pub vm_tsize: ::segsz_t,
+        pub vm_dsize: ::segsz_t,
+        pub vm_ssize: ::segsz_t,
+        pub vm_taddr: *mut ::c_char,
+        pub vm_daddr: *mut ::c_char,
+        pub vm_maxsaddr: *mut ::c_char,
+        pub vm_minsaddr: *mut ::c_char,
+        _unused1: ::c_int,
+        _unused2: ::c_int,
+        pub vm_pagesupply: ::c_int,
+        pub vm_holdcnt: ::c_uint,
+        pub vm_refcnt: ::c_uint,
+    }
+
+    pub struct cpuctl_msr_args_t {
+        pub msr: ::c_int,
+        pub data: u64,
+    }
+
+    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: ::pid_t,
+        ut_exit: exit_status,
+        ut_ss: ::sockaddr_storage,
+        pub ut_tv: ::timeval,
+        pub ut_unused2: [u8; 16],
+    }
+
+    pub struct lastlogx {
+        pub ll_tv: ::timeval,
+        pub ll_line: [::c_char; _UTX_LINESIZE],
+        pub ll_host: [::c_char; _UTX_HOSTSIZE],
+        pub ll_ss: ::sockaddr_storage,
+    }
+
+    pub struct dirent {
+        pub d_fileno: ::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: ::fsid_t,
+        pub f_owner: ::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: ::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: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: stack_t,
+        pub uc_cofunc: ::Option<unsafe extern "C" fn(uc: *mut ucontext_t, arg: *mut ::c_void)>,
+        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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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.iter().zip(other.mc_fpregs.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_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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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: ::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::<::cpumask_t>() * 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;
+
+// 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;
+
+const_fn! {
+    {const} fn _CMSG_ALIGN(n: usize) -> usize {
+        (n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
+        (cmsg as *mut ::c_uchar)
+            .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize)
+            as ::c_uint
+    }
+
+    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::<::cmsghdr>());
+        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::<::cmsghdr>()) +
+            _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: ::dev_t) -> ::c_int {
+         ((dev >> 8) & 0xff) as ::c_int
+    }
+
+    pub fn minor(dev: ::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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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 ::timespec) -> ::c_int;
+
+    pub fn devname_r(
+        dev: ::dev_t,
+        mode: ::mode_t,
+        buf: *mut ::c_char,
+        len: ::size_t,
+    ) -> *mut ::c_char;
+
+    pub fn waitid(
+        idtype: idtype_t,
+        id: ::id_t,
+        infop: *mut ::siginfo_t,
+        options: ::c_int,
+    ) -> ::c_int;
+
+    pub fn freelocale(loc: ::locale_t);
+
+    pub fn lwp_rtprio(
+        function: ::c_int,
+        pid: ::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 ::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: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int;
+    pub fn sched_setaffinity(pid: ::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: ::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 ::shmid_ds) -> ::c_int;
+    pub fn procctl(idtype: ::idtype_t, id: ::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: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
+    pub fn updlastlogx(fname: *const ::c_char, uid: ::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: ::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 ::statfs, flags: ::c_int) -> ::c_int;
+    pub fn getmntvinfo(
+        mntbufp: *mut *mut ::statfs,
+        mntvbufp: *mut *mut ::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 ::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 ::kvm_t,
+        map: vm_map_t,
+        entry: vm_map_entry_t,
+    ) -> vm_map_entry_t;
+    pub fn kvm_vm_map_entry_next(
+        kvm: *mut ::kvm_t,
+        map: vm_map_entry_t,
+        entry: vm_map_entry_t,
+    ) -> vm_map_entry_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_thread_local)] {
+        mod errno;
+        pub use self::errno::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
new file mode 100644
index 00000000000..e8be8815c02
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
@@ -0,0 +1,146 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+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: [::register_t; 30],
+        pub gp_lr: ::register_t,
+        pub gp_sp: ::register_t,
+        pub gp_elr: ::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],
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs
new file mode 100644
index 00000000000..300b3dd45ca
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs
@@ -0,0 +1,50 @@
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = u32;
+pub type time_t = i64;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+s! {
+    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: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        pub st_atime_pad: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        pub st_mtime_pad: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        pub st_ctime_pad: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        pub st_birthtime_pad: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
new file mode 100644
index 00000000000..f32128f7755
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
@@ -0,0 +1,32 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+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: ::uid_t,
+    pub st_gid: ::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_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u32,
+    pub st_lspare: i32,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
new file mode 100644
index 00000000000..de34069eabd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
@@ -0,0 +1,488 @@
+// 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 `unsigned int` to `unsigned long` in FreeBSD 12:
+pub type ino_t = u32;
+
+s! {
+    pub struct kevent {
+        pub ident: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::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: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::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 ::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: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::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: ::dev_t,
+        /// Signals arrived but not delivered.
+        pub ki_siglist: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::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: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::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; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::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; ::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: ::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: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::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; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::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: ::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: ::uid_t,
+        pub f_fsid: ::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; ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::dev_t;
+        (major << 8) | minor
+    }
+}
+
+f! {
+    pub fn major(dev: ::dev_t) -> ::c_int {
+         ((dev >> 8) & 0xff) as ::c_int
+    }
+
+    pub fn minor(dev: ::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: ::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(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
new file mode 100644
index 00000000000..80c6fa16845
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    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: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
new file mode 100644
index 00000000000..10fcaa03a4e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -0,0 +1,505 @@
+// APIs in FreeBSD 12 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+pub type shmatt_t = ::c_uint;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::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: ::vm_prot_t,
+        pub offset: ::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 ::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: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::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: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::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: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::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; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::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; ::KI_NSPARE_INT],
+        /// Controlling tty dev.
+        pub ki_tdev: ::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: ::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: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::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; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::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: ::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: ::uid_t,
+        pub f_fsid: ::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; ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::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: ::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(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
new file mode 100644
index 00000000000..7bf2534455b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::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 = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
new file mode 100644
index 00000000000..80c6fa16845
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    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: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
new file mode 100644
index 00000000000..ec6bce2a030
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -0,0 +1,546 @@
+// APIs in FreeBSD 13 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::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: ::u_int,
+        pub kp_paddr: ::kpaddr_t,
+        pub kp_kmap_vaddr: ::kvaddr_t,
+        pub kp_dmap_vaddr: ::kvaddr_t,
+        pub kp_prot: ::vm_prot_t,
+        pub kp_offset: ::off_t,
+        pub kp_len: ::size_t,
+    }
+
+    pub struct __c_anonymous_domainset {
+        _priv: [::uintptr_t; 4],
+    }
+
+    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 ::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: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::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: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::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: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::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; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::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; ::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: ::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: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::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; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::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: ::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: ::uid_t,
+        pub f_fsid: ::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; ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::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: ::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: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut ::domainset_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn cpuset_setdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const ::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 ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
new file mode 100644
index 00000000000..7bf2534455b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
@@ -0,0 +1,5 @@
+pub const PROC_KPTI_CTL: ::c_int = ::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 = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
new file mode 100644
index 00000000000..80c6fa16845
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    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: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
new file mode 100644
index 00000000000..160a4baae48
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
@@ -0,0 +1,546 @@
+// APIs in FreeBSD 14 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::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: ::u_int,
+        pub kp_paddr: ::kpaddr_t,
+        pub kp_kmap_vaddr: ::kvaddr_t,
+        pub kp_dmap_vaddr: ::kvaddr_t,
+        pub kp_prot: ::vm_prot_t,
+        pub kp_offset: ::off_t,
+        pub kp_len: ::size_t,
+    }
+
+    pub struct __c_anonymous_domainset {
+        _priv: [::uintptr_t; 4],
+    }
+
+    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 ::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: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::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: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::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: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::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; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::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; ::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: ::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: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::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; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::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: ::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: ::uid_t,
+        pub f_fsid: ::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; ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::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: ::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: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut ::domainset_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn cpuset_setdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const ::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 ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
new file mode 100644
index 00000000000..01d0b4328da
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
@@ -0,0 +1,12 @@
+pub const PROC_KPTI_CTL: ::c_int = ::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 = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
+pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
+pub const PROC_LA_STATUS: ::c_int = ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs
new file mode 100644
index 00000000000..80c6fa16845
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    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: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
new file mode 100644
index 00000000000..d73215a68ec
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
@@ -0,0 +1,546 @@
+// APIs in FreeBSD 15 that have changed since 11.
+
+pub type nlink_t = u64;
+pub type dev_t = u64;
+pub type ino_t = ::c_ulong;
+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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+    }
+
+    pub struct kevent {
+        pub ident: ::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: ::u_int,
+        pub kp_paddr: ::kpaddr_t,
+        pub kp_kmap_vaddr: ::kvaddr_t,
+        pub kp_dmap_vaddr: ::kvaddr_t,
+        pub kp_prot: ::vm_prot_t,
+        pub kp_offset: ::off_t,
+        pub kp_len: ::size_t,
+    }
+
+    pub struct __c_anonymous_domainset {
+        _priv: [::uintptr_t; 4],
+    }
+
+    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 ::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: ::pid_t,
+        /// Parent process ID.
+        pub ki_ppid: ::pid_t,
+        /// Process group ID.
+        pub ki_pgid: ::pid_t,
+        /// tty process group ID.
+        pub ki_tpgid: ::pid_t,
+        /// Process session ID.
+        pub ki_sid: ::pid_t,
+        /// Terminal session ID.
+        pub ki_tsid: ::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: ::sigset_t,
+        /// Current signal mask.
+        pub ki_sigmask: ::sigset_t,
+        /// Signals being ignored.
+        pub ki_sigignore: ::sigset_t,
+        /// Signals being caught by user.
+        pub ki_sigcatch: ::sigset_t,
+        /// Effective user ID.
+        pub ki_uid: ::uid_t,
+        /// Real user ID.
+        pub ki_ruid: ::uid_t,
+        /// Saved effective user ID.
+        pub ki_svuid: ::uid_t,
+        /// Real group ID.
+        pub ki_rgid: ::gid_t,
+        /// Saved effective group ID.
+        pub ki_svgid: ::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: [::gid_t; ::KI_NGROUPS],
+        /// Virtual size.
+        pub ki_size: ::vm_size_t,
+        /// Current resident set size in pages.
+        pub ki_rssize: ::segsz_t,
+        /// Resident set size before last swap.
+        pub ki_swrss: ::segsz_t,
+        /// Text size (pages) XXX.
+        pub ki_tsize: ::segsz_t,
+        /// Data size (pages) XXX.
+        pub ki_dsize: ::segsz_t,
+        /// Stack size (pages).
+        pub ki_ssize: ::segsz_t,
+        /// Exit status for wait & stop signal.
+        pub ki_xstat: ::u_short,
+        /// Accounting flags.
+        pub ki_acflag: ::u_short,
+        /// %cpu for process during `ki_swtime`.
+        pub ki_pctcpu: ::fixpt_t,
+        /// Time averaged value of `ki_cpticks`.
+        pub ki_estcpu: ::u_int,
+        /// Time since last blocked.
+        pub ki_slptime: ::u_int,
+        /// Time swapped in or out.
+        pub ki_swtime: ::u_int,
+        /// Number of copy-on-write faults.
+        pub ki_cow: ::u_int,
+        /// Real time in microsec.
+        pub ki_runtime: u64,
+        /// Starting time.
+        pub ki_start: ::timeval,
+        /// Time used by process children.
+        pub ki_childtime: ::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; ::TDNAMLEN + 1],
+        /// Wchan message.
+        pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
+        /// Setlogin name.
+        pub ki_login: [::c_char; ::LOGNAMELEN + 1],
+        /// Lock name.
+        pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
+        /// Command name.
+        pub ki_comm: [::c_char; ::COMMLEN + 1],
+        /// Emulation name.
+        pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
+        /// Login class.
+        pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
+        /// More thread name.
+        pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::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; ::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: ::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: ::lwpid_t,
+        /// Process priority.
+        pub ki_pri: ::priority,
+        /// Process rusage statistics.
+        pub ki_rusage: ::rusage,
+        /// rusage of children processes.
+        pub ki_rusage_ch: ::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; ::KI_NSPARE_PTR],
+        pub ki_sparelongs: [::c_long; ::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: ::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: ::uid_t,
+        pub f_fsid: ::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; ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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: ::dev_t) -> ::c_int {
+        (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+    }
+
+    pub fn minor(dev: ::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: ::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: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *mut ::domainset_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn cpuset_setdomain(
+        level: ::cpulevel_t,
+        which: ::cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const ::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 ::kvm_t) -> ::kssize_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "x86_64",
+                 target_arch = "aarch64",
+                 target_arch = "riscv64"))] {
+        mod b64;
+        pub use self::b64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod x86_64;
+        pub use self::x86_64::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
new file mode 100644
index 00000000000..01d0b4328da
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
@@ -0,0 +1,12 @@
+pub const PROC_KPTI_CTL: ::c_int = ::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 = ::PROC_PROCCTL_MD_MIN + 1;
+pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
+pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
+pub const PROC_LA_STATUS: ::c_int = ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
new file mode 100644
index 00000000000..78314084cc6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -0,0 +1,5758 @@
+pub type fflags_t = u32;
+pub type clock_t = i32;
+
+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 = ::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 = ::uid_t;
+pub type au_asid_t = ::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 ::in_addr,
+        pub ip6: *mut ::in6_addr,
+    }
+
+    pub struct statvfs {
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_files: ::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: ::ipc_perm,
+        __unused1: *mut ::c_void,
+        __unused2: *mut ::c_void,
+        pub msg_cbytes: ::msglen_t,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::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: ::msghdr,
+        pub msg_len: ::ssize_t,
+    }
+
+    pub struct sockcred {
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::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: ::sigset_t,
+        pub pl_siglist: ::sigset_t,
+        pub pl_siginfo: ::siginfo_t,
+        pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
+        pub pl_child_pid: ::pid_t,
+        pub pl_syscall_code: ::c_uint,
+        pub pl_syscall_narg: ::c_uint,
+    }
+
+    pub struct ptrace_sc_ret {
+        pub sr_retval: [::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 ::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: ::lwpid_t,
+        m_flags: u32,
+        m_ceilings: [u32; 2],
+        m_rb_link: ::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: ::uintptr_t,
+        pub vmentries: *mut ::c_void,
+        pub files: *mut ::c_void,
+        pub argv: *mut ::c_void,
+        pub envv: *mut ::c_void,
+        pub core: ::uintptr_t,
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::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: ::kvaddr_t,
+    }
+
+    pub struct __c_anonymous_sem {
+        _priv: ::uintptr_t,
+    }
+
+    pub struct semid_ds {
+        pub sem_perm: ::ipc_perm,
+        pub __sem_base: *mut __c_anonymous_sem,
+        pub sem_nsems: ::c_ushort,
+        pub sem_otime: ::time_t,
+        pub sem_ctime: ::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: ::sockaddr_storage,
+        /// Peer address.
+        pub sa_peer: ::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; ::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; ::IFNAMSIZ as usize],
+        pub ifra_addr: ::sockaddr,
+        pub ifra_broadaddr: ::sockaddr,
+        pub ifra_mask: ::sockaddr,
+        pub ifra_vhid: ::c_int,
+    }
+
+    /// 9.x compat
+    pub struct oifaliasreq {
+        /// if name, e.g. "en0"
+        pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ifra_addr: ::sockaddr,
+        pub ifra_broadaddr: ::sockaddr,
+        pub ifra_mask: ::sockaddr,
+    }
+
+    pub struct ifmediareq {
+        /// if name, e.g. "en0"
+        pub ifm_name: [::c_char; ::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; ::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; ::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; ::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; ::MAXFIDSZ as usize],
+    }
+
+    pub struct fhandle {
+        pub fh_fsid: ::fsid_t,
+        pub fh_fid: fid,
+    }
+
+    pub struct bintime {
+        pub sec: ::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: ::u_int,
+        /// Allocated entry
+        pub allocated: ::c_int,
+        /// started ops
+        pub start_count: ::u_int,
+        /// completed ops
+        pub end_count: ::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: ::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: ::pid_t,
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct ifconf {
+        pub ifc_len: ::c_int,
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ifreq,
+    }
+
+    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: ::au_id_t,
+        pub ai_mask: ::au_mask_t,
+        pub ai_termid: au_tid_t,
+        pub ai_asid: ::au_asid_t,
+    }
+
+    pub struct tcp_fastopen {
+        pub enable: ::c_int,
+        pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize],
+    }
+
+    pub struct tcp_function_set {
+        pub function_set_name: [::c_char; ::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: ::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: [::uintptr_t; 32],
+        __privb: [::uintptr_t; 26],
+    }
+
+    pub struct memory_type_list {
+        __priv: [::uintptr_t; 2],
+    }
+
+    pub struct pidfh {
+        __priva: [[::uintptr_t; 32]; 8],
+        __privb: [::uintptr_t; 2],
+    }
+
+    pub struct sctp_event {
+        pub se_assoc_id: ::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: ::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: ::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: ::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: ::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: ::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: ::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: ::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: ::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: ::sockaddr_storage,
+        pub spc_state: u32,
+        pub spc_error: u32,
+        pub spc_assoc_id: ::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: ::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: ::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: ::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: ::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: ::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: ::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: ::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: ::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: ::timeval,
+        pub ut_id: [::c_char; 8],
+        pub ut_pid: ::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],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_cr_pid {
+        __cr_unused: *mut ::c_void,
+        pub cr_pid: ::pid_t,
+    }
+
+    pub struct xucred {
+        pub cr_version: ::c_uint,
+        pub cr_uid: ::uid_t,
+        pub cr_ngroups: ::c_short,
+        pub cr_groups: [::gid_t; 16],
+        #[cfg(libc_union)]
+        pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
+        #[cfg(not(libc_union))]
+        __cr_unused1: *mut ::c_void,
+    }
+
+    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: ::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: ::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],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_elf32_auxv_union {
+        pub a_val: ::c_int,
+    }
+
+    pub struct Elf32_Auxinfo {
+        pub a_type: ::c_int,
+        #[cfg(libc_union)]
+        pub a_un: __c_anonymous_elf32_auxv_union,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifi_epoch {
+        pub tt: ::time_t,
+        pub ph: u64,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifi_lastchange {
+        pub tv: ::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
+        #[cfg(libc_union)]
+        pub __ifi_epoch: __c_anonymous_ifi_epoch,
+        /// uptime at attach or stat reset
+        #[cfg(not(libc_union))]
+        pub __ifi_epoch: u64,
+        /// time of last administrative change
+        #[cfg(libc_union)]
+        pub __ifi_lastchange: __c_anonymous_ifi_lastchange,
+        /// time of last administrative change
+        #[cfg(not(libc_union))]
+        pub __ifi_lastchange: ::timeval,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::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: ::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; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: ::caddr_t,
+        pub ifcu_req: *mut ifreq,
+    }
+
+    pub struct ifstat {
+        /// if name, e.g. "en0"
+        pub ifs_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ascii: [::c_char; ::IFSTATMAX as usize + 1],
+    }
+
+    pub struct ifrsskey {
+        /// if name, e.g. "en0"
+        pub ifrk_name: [::c_char; ::IFNAMSIZ as usize],
+        /// RSS_FUNC_
+        pub ifrk_func: u8,
+        pub ifrk_spare0: u8,
+        pub ifrk_keylen: u16,
+        pub ifrk_key: [u8; ::RSS_KEYLEN as usize],
+    }
+
+    pub struct ifdownreason {
+        pub ifdr_name: [::c_char; ::IFNAMSIZ as usize],
+        pub ifdr_reason: u32,
+        pub ifdr_vendor: u32,
+        pub ifdr_msg: [::c_char; ::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,
+    }
+}
+
+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<H: ::hash::Hasher>(&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);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for __c_anonymous_cr_pid {
+            fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
+                unsafe { self.cr_pid == other.cr_pid}
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_cr_pid {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_cr_pid {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("cr_pid")
+                    .field("cr_pid", unsafe { &self.cr_pid })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_cr_pid {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.cr_pid.hash(state) };
+            }
+        }
+
+        impl PartialEq for xucred {
+            fn eq(&self, other: &xucred) -> bool {
+                #[cfg(libc_union)]
+                let equal_cr_pid = self.cr_pid__c_anonymous_union
+                    == other.cr_pid__c_anonymous_union;
+                #[cfg(not(libc_union))]
+                let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
+
+                self.cr_version == other.cr_version
+                    && self.cr_uid == other.cr_uid
+                    && self.cr_ngroups == other.cr_ngroups
+                    && self.cr_groups == other.cr_groups
+                    && equal_cr_pid
+            }
+        }
+        impl Eq for xucred {}
+        impl ::fmt::Debug for xucred {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                let mut struct_formatter = f.debug_struct("xucred");
+                struct_formatter.field("cr_version", &self.cr_version);
+                struct_formatter.field("cr_uid", &self.cr_uid);
+                struct_formatter.field("cr_ngroups", &self.cr_ngroups);
+                struct_formatter.field("cr_groups", &self.cr_groups);
+                #[cfg(libc_union)]
+                struct_formatter.field(
+                    "cr_pid__c_anonymous_union",
+                    &self.cr_pid__c_anonymous_union
+                );
+                struct_formatter.finish()
+            }
+        }
+        impl ::hash::Hash for xucred {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.cr_version.hash(state);
+                self.cr_uid.hash(state);
+                self.cr_ngroups.hash(state);
+                self.cr_groups.hash(state);
+                #[cfg(libc_union)]
+                self.cr_pid__c_anonymous_union.hash(state);
+                #[cfg(not(libc_union))]
+                self.__cr_unused1.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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                let self_devname: &[::c_char] = &self.devname;
+
+                self.dev.hash(state);
+                self_devname.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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}
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_elf32_auxv_union {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("a_val")
+                    .field("a_val", unsafe { &self.a_val })
+                    .finish()
+            }
+        }
+        #[cfg(not(libc_union))]
+        impl PartialEq for Elf32_Auxinfo {
+            fn eq(&self, other: &Elf32_Auxinfo) -> bool {
+                self.a_type == other.a_type
+            }
+        }
+        #[cfg(libc_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 {}
+        #[cfg(not(libc_union))]
+        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)
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        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()
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifr_ifru {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_buffer", unsafe { &self.ifru_buffer })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_index", unsafe { &self.ifru_index })
+                    .field("ifru_jid", unsafe { &self.ifru_jid })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_phys", unsafe { &self.ifru_phys })
+                    .field("ifru_media", unsafe { &self.ifru_media })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .field("ifru_cap", unsafe { &self.ifru_cap })
+                    .field("ifru_fib", unsafe { &self.ifru_fib })
+                    .field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifr_ifru {
+            fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifr_name.hash(state);
+                self.ifr_ifru.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifc_ifcu {}
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifc_ifcu")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+            fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.ifdr_name.hash(state);
+                self.ifdr_reason.hash(state);
+                self.ifdr_vendor.hash(state);
+                self.ifdr_msg.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifi_epoch {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifi_epoch {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifi_epoch")
+                    .field("tt", unsafe { &self.tt })
+                    .field("ph", unsafe { &self.ph })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifi_epoch {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.tt.hash(state);
+                    self.ph.hash(state);
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifi_lastchange {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifi_lastchange {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifi_lastchange")
+                    .field("tv", unsafe { &self.tv })
+                    .field("ph", unsafe { &self.ph })
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifi_lastchange {
+            fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                {self.cause}.hash(state);
+                {self.hmac_id}.hash(state);
+            }
+        }
+    }
+}
+
+#[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/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: ::rlim_t = 15;
+pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::rlim_t = ::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 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;
+
+pub const BIOCSETFNR: ::c_ulong = 0x80104282;
+
+pub const FIODGNAME: ::c_ulong = 0x80106678;
+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;
+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_FASTOPEN_PSK_LEN: ::c_int = 16;
+pub const TCP_FUNCTION_NAME_LEN_MAX: ::c_int = 32;
+
+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: ::speed_t = 460800;
+pub const B921600: ::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: ::tcflag_t = 0x00000004;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB3: ::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;
+
+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 getrandom()
+pub const GRND_NONBLOCK: ::c_uint = 0x1;
+pub const GRND_RANDOM: ::c_uint = 0x2;
+pub const GRND_INSECURE: ::c_uint = 0x4;
+
+// 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 = ::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;
+
+// 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: ::clockid_t = ::CLOCK_UPTIME;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = ::CLOCK_REALTIME_FAST;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = ::CLOCK_MONOTONIC_FAST;
+
+// sys/timerfd.h
+
+pub const TFD_NONBLOCK: ::c_int = ::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;
+
+cfg_if! {
+    if #[cfg(libc_const_extern_fn)] {
+        pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+            a << 24
+        }
+    } else {
+        pub 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::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+            + _ALIGN(::mem::size_of::<::cmsghdr>());
+        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::<::cmsghdr>()) + _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::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn uname(buf: *mut ::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::<::c_long>();
+        let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+        cpuset.__bits[idx] |= 1 << offset;
+        ()
+    }
+
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
+        let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+        let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
+        cpuset.__bits[idx] &= !(1 << offset);
+        ()
+    }
+
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
+        let bitset_bits = 8 * ::mem::size_of::<::c_long>();
+        let (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::<cpuset_t>();
+        let bitset_size = ::mem::size_of::<::c_long>();
+
+        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::<sockcred2>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn PROT_MAX(x: ::c_int) -> ::c_int {
+        x << 16
+    }
+
+    pub fn PROT_MAX_EXTRACT(x: ::c_int) -> ::c_int {
+        (x >> 16) & (::PROT_READ | ::PROT_WRITE | ::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 ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+    pub fn aio_writev(aiocbp: *mut ::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: ::dev_t,
+        mode: ::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 ::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 ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+    pub fn jail_set(iov: *mut ::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 ::timespec) -> ::ssize_t;
+    pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
+
+    pub fn waitid(
+        idtype: idtype_t,
+        id: ::id_t,
+        infop: *mut ::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) -> ::key_t;
+    pub fn shmget(key: ::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 ::shmid_ds) -> ::c_int;
+    pub fn semget(key: ::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 ::msqid_ds) -> ::c_int;
+    pub fn msgget(key: ::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 ::termios);
+
+    pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
+    pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
+    pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
+
+    pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::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 ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::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: ::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: ::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: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpusetp: *mut cpuset_t,
+    ) -> ::c_int;
+    pub fn pthread_setaffinity_np(
+        td: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpusetp: *const cpuset_t,
+    ) -> ::c_int;
+
+    // sched.h linux compatibility api
+    pub fn sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int;
+    pub fn sched_setaffinity(
+        pid: ::pid_t,
+        cpusetsz: ::size_t,
+        cpuset: *const ::cpuset_t,
+    ) -> ::c_int;
+    pub fn sched_getcpu() -> ::c_int;
+
+    pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
+
+    pub fn pthread_mutexattr_getrobust(
+        attr: *mut ::pthread_mutexattr_t,
+        robust: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_mutexattr_setrobust(
+        attr: *mut ::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 ::mmsghdr,
+        vlen: ::size_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::size_t,
+        flags: ::c_int,
+        timeout: *const ::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 ::stat) -> ::c_int;
+    pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut ::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 ::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 ::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 ::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: ::id_t,
+        setsize: ::size_t,
+        mask: *mut cpuset_t,
+    ) -> ::c_int;
+    pub fn cpuset_setaffinity(
+        level: cpulevel_t,
+        which: cpuwhich_t,
+        id: ::id_t,
+        setsize: ::size_t,
+        mask: *const cpuset_t,
+    ) -> ::c_int;
+    pub fn cpuset(setid: *mut ::cpusetid_t) -> ::c_int;
+    pub fn cpuset_getid(
+        level: cpulevel_t,
+        which: cpuwhich_t,
+        id: ::id_t,
+        setid: *mut ::cpusetid_t,
+    ) -> ::c_int;
+    pub fn cpuset_setid(which: cpuwhich_t, id: ::id_t, setid: ::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: ::idtype_t, id: ::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: ::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: ::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 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 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: ::sctp_assoc_t) -> ::c_int;
+    pub fn sctp_bindx(s: ::c_int, addrs: *mut ::sockaddr, num: ::c_int, tpe: ::c_int) -> ::c_int;
+    pub fn sctp_connectx(
+        s: ::c_int,
+        addrs: *const ::sockaddr,
+        addrcnt: ::c_int,
+        id: *mut ::sctp_assoc_t,
+    ) -> ::c_int;
+    pub fn sctp_getaddrlen(family: ::sa_family_t) -> ::c_int;
+    pub fn sctp_getpaddrs(
+        s: ::c_int,
+        asocid: ::sctp_assoc_t,
+        addrs: *mut *mut ::sockaddr,
+    ) -> ::c_int;
+    pub fn sctp_freepaddrs(addrs: *mut ::sockaddr);
+    pub fn sctp_getladdrs(
+        s: ::c_int,
+        asocid: ::sctp_assoc_t,
+        addrs: *mut *mut ::sockaddr,
+    ) -> ::c_int;
+    pub fn sctp_freeladdrs(addrs: *mut ::sockaddr);
+    pub fn sctp_opt_info(
+        s: ::c_int,
+        id: ::sctp_assoc_t,
+        opt: ::c_int,
+        arg: *mut ::c_void,
+        size: *mut ::socklen_t,
+    ) -> ::c_int;
+    pub fn sctp_sendv(
+        sd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        addrs: *mut ::sockaddr,
+        addrcnt: ::c_int,
+        info: *mut ::c_void,
+        infolen: ::socklen_t,
+        infotype: ::c_uint,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn sctp_recvv(
+        sd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        from: *mut ::sockaddr,
+        fromlen: *mut ::socklen_t,
+        info: *mut ::c_void,
+        infolen: *mut ::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;
+}
+
+#[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 ::kvm_t, cpu: ::c_uint) -> ::c_int;
+    pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
+        -> *mut *mut ::c_char;
+    pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int;
+    pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
+        -> *mut *mut ::c_char;
+    pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char;
+    pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void;
+    pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64;
+    pub fn kvm_getswapinfo(
+        kd: *mut ::kvm_t,
+        info: *mut kvm_swap,
+        maxswap: ::c_int,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int;
+    pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int;
+    pub fn kvm_read_zpcpu(
+        kd: *mut ::kvm_t,
+        base: ::c_ulong,
+        buf: *mut ::c_void,
+        size: ::size_t,
+        cpu: ::c_int,
+    ) -> ::ssize_t;
+    pub fn kvm_read2(
+        kd: *mut ::kvm_t,
+        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 ::in_addr) -> ::c_int;
+    pub fn realhostname_sa(
+        host: *mut ::c_char,
+        hsize: ::size_t,
+        addr: *mut ::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: ::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: ::mode_t,
+        pidptr: *mut ::pid_t,
+    ) -> *mut ::pidfh;
+    pub fn pidfile_write(path: *mut ::pidfh) -> ::c_int;
+    pub fn pidfile_close(path: *mut ::pidfh) -> ::c_int;
+    pub fn pidfile_remove(path: *mut ::pidfh) -> ::c_int;
+    pub fn pidfile_fileno(path: *const ::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 ::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 ::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 ::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 ::kvm_t) -> ::c_int;
+    pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long;
+    pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn devstat_selectdevs(
+        dev_select: *mut *mut device_selection,
+        num_selected: *mut ::c_int,
+        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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
new file mode 100644
index 00000000000..a0120c337e0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
@@ -0,0 +1,47 @@
+pub type c_char = u8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+s! {
+    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: ::uid_t,
+        pub st_gid: ::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_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
new file mode 100644
index 00000000000..7f5b9752264
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
@@ -0,0 +1,47 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type wchar_t = i32;
+pub type time_t = i64;
+pub type suseconds_t = i64;
+pub type register_t = i64;
+
+s! {
+    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: ::uid_t,
+        pub st_gid: ::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_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
new file mode 100644
index 00000000000..f9fa1c2750b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs
@@ -0,0 +1,154 @@
+pub type c_char = u8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+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: ::register_t,
+        pub gp_sp: ::register_t,
+        pub gp_gp: ::register_t,
+        pub gp_tp: ::register_t,
+        pub gp_t: [::register_t; 7],
+        pub gp_s: [::register_t; 12],
+        pub gp_a: [::register_t; 8],
+        pub gp_sepc: ::register_t,
+        pub gp_sstatus: ::register_t,
+    }
+
+    pub struct fpregs {
+        pub fp_x: [[::register_t; 2]; 32],
+        pub fp_fcsr: ::register_t,
+        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],
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+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<H: ::hash::Hasher>(&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.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_x", &self.fp_x)
+                    .field("fp_fcsr", &self.fp_fcsr)
+                    .field("fp_flags", &self.fp_flags)
+                    .field("fp_pad", &self.fp_pad)
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for fpregs {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.fp_x.hash(state);
+                self.fp_fcsr.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<H: ::hash::Hasher>(&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 MAP_32BIT: ::c_int = 0x00080000;
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs
new file mode 100644
index 00000000000..4046ec3109f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs
@@ -0,0 +1,201 @@
+pub type c_char = i8;
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type wchar_t = i32;
+pub type time_t = i32;
+pub type suseconds_t = i32;
+pub type register_t = i32;
+
+s_no_extra_traits! {
+    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; 32]; 4],
+        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],
+    }
+}
+
+s! {
+    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: ::uid_t,
+        pub st_gid: ::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_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u32,
+        pub st_lspare: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        __unused: [u8; 8],
+    }
+
+    pub struct ucontext_t {
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_flags: ::c_int,
+        __spare__: [::c_int; 4],
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+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<H: ::hash::Hasher>(&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 const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
new file mode 100644
index 00000000000..3a016a05198
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
@@ -0,0 +1,197 @@
+use {c_long, register_t};
+
+s_no_extra_traits! {
+    #[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 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<H: ::hash::Hasher>(&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);
+            }
+        }
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_link: *mut ::ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_flags: ::c_int,
+        __spare__: [::c_int; 4],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
new file mode 100644
index 00000000000..ae1fcf78104
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
@@ -0,0 +1,334 @@
+pub type c_char = i8;
+pub type c_long = i64;
+pub type c_ulong = u64;
+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],
+    }
+
+    #[cfg(libc_union)]
+    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,
+        #[cfg(libc_union)]
+        pub a_un: __c_anonymous_elf64_auxv_union,
+    }
+
+    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: [::uintptr_t; 38], // FIXME if needed
+        pub kf_status: u16,
+        _kf_pad1: u16,
+        _kf_ispare0: ::c_int,
+        pub kf_cap_rights: ::cap_rights_t,
+        _kf_cap_spare: u64,
+        pub kf_path: [::c_char; ::PATH_MAX as usize],
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.xmm_env.hash(state);
+                self.xmm_acc.hash(state);
+                self.xmm_reg.hash(state);
+                self.xmm_pad.hash(state);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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 }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_elf64_auxv_union {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_elf64_auxv_union {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("a_val")
+                    .field("a_val", unsafe { &self.a_val })
+                    .finish()
+            }
+        }
+        #[cfg(not(libc_union))]
+        impl PartialEq for Elf64_Auxinfo {
+            fn eq(&self, other: &Elf64_Auxinfo) -> bool {
+                self.a_type == other.a_type
+            }
+        }
+        #[cfg(libc_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 {}
+        #[cfg(not(libc_union))]
+        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)
+                    .finish()
+            }
+        }
+        #[cfg(libc_union)]
+        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 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<H: ::hash::Hasher>(&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);
+            }
+        }
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
new file mode 100644
index 00000000000..00a944e42bf
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
@@ -0,0 +1,1918 @@
+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 = ::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) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+s! {
+    pub struct in_addr {
+        pub s_addr: ::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: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::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: ::pid_t,
+        pub si_uid: ::uid_t,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        pub si_value: ::sigval,
+        _pad1: ::c_long,
+        _pad2: [::c_int; 7],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::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: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8],
+    }
+
+    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; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+    }
+
+    pub struct flock {
+        pub l_start: ::off_t,
+        pub l_len: ::off_t,
+        pub l_pid: ::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 ::iovec,
+        pub hdr_cnt: ::c_int,
+        pub trailers: *mut ::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: ::pid_t,
+        pub cmcred_uid: ::uid_t,
+        pub cmcred_euid: ::uid_t,
+        pub cmcred_gid: ::gid_t,
+        pub cmcred_ngroups: ::c_short,
+        pub cmcred_groups: [::gid_t; CMGROUP_MAX],
+    }
+
+    pub struct rtprio {
+        pub type_: ::c_ushort,
+        pub prio: ::c_ushort,
+    }
+
+    pub struct in6_pktinfo {
+        pub ipi6_addr: ::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: ::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; 10]; 24],
+    }
+
+    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: ::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: ::uid_t,
+        pub cgid: ::gid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mode: ::mode_t,
+        pub seq: ::c_ushort,
+        pub key: ::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: ::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<H: ::hash::Hasher>(&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
+cfg_if! {
+    if #[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))] {
+        const SIZEOF_LONG: usize = 4;
+    } else if #[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))] {
+        const SIZEOF_LONG: usize = 8;
+    } else if #[cfg(libc_const_size_of)] {
+        const SIZEOF_LONG: usize = ::mem::size_of::<::c_long>();
+    }
+}
+
+#[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: ::nl_item = 0;
+pub const D_T_FMT: ::nl_item = 1;
+pub const D_FMT: ::nl_item = 2;
+pub const T_FMT: ::nl_item = 3;
+pub const T_FMT_AMPM: ::nl_item = 4;
+pub const AM_STR: ::nl_item = 5;
+pub const PM_STR: ::nl_item = 6;
+
+pub const DAY_1: ::nl_item = 7;
+pub const DAY_2: ::nl_item = 8;
+pub const DAY_3: ::nl_item = 9;
+pub const DAY_4: ::nl_item = 10;
+pub const DAY_5: ::nl_item = 11;
+pub const DAY_6: ::nl_item = 12;
+pub const DAY_7: ::nl_item = 13;
+
+pub const ABDAY_1: ::nl_item = 14;
+pub const ABDAY_2: ::nl_item = 15;
+pub const ABDAY_3: ::nl_item = 16;
+pub const ABDAY_4: ::nl_item = 17;
+pub const ABDAY_5: ::nl_item = 18;
+pub const ABDAY_6: ::nl_item = 19;
+pub const ABDAY_7: ::nl_item = 20;
+
+pub const MON_1: ::nl_item = 21;
+pub const MON_2: ::nl_item = 22;
+pub const MON_3: ::nl_item = 23;
+pub const MON_4: ::nl_item = 24;
+pub const MON_5: ::nl_item = 25;
+pub const MON_6: ::nl_item = 26;
+pub const MON_7: ::nl_item = 27;
+pub const MON_8: ::nl_item = 28;
+pub const MON_9: ::nl_item = 29;
+pub const MON_10: ::nl_item = 30;
+pub const MON_11: ::nl_item = 31;
+pub const MON_12: ::nl_item = 32;
+
+pub const ABMON_1: ::nl_item = 33;
+pub const ABMON_2: ::nl_item = 34;
+pub const ABMON_3: ::nl_item = 35;
+pub const ABMON_4: ::nl_item = 36;
+pub const ABMON_5: ::nl_item = 37;
+pub const ABMON_6: ::nl_item = 38;
+pub const ABMON_7: ::nl_item = 39;
+pub const ABMON_8: ::nl_item = 40;
+pub const ABMON_9: ::nl_item = 41;
+pub const ABMON_10: ::nl_item = 42;
+pub const ABMON_11: ::nl_item = 43;
+pub const ABMON_12: ::nl_item = 44;
+
+pub const ERA: ::nl_item = 45;
+pub const ERA_D_FMT: ::nl_item = 46;
+pub const ERA_D_T_FMT: ::nl_item = 47;
+pub const ERA_T_FMT: ::nl_item = 48;
+pub const ALT_DIGITS: ::nl_item = 49;
+
+pub const RADIXCHAR: ::nl_item = 50;
+pub const THOUSEP: ::nl_item = 51;
+
+pub const YESEXPR: ::nl_item = 52;
+pub const NOEXPR: ::nl_item = 53;
+
+pub const YESSTR: ::nl_item = 54;
+pub const NOSTR: ::nl_item = 55;
+
+pub const CRNCYSTR: ::nl_item = 56;
+
+pub const D_MD_ORDER: ::nl_item = 57;
+
+pub const ALTMON_1: ::nl_item = 58;
+pub const ALTMON_2: ::nl_item = 59;
+pub const ALTMON_3: ::nl_item = 60;
+pub const ALTMON_4: ::nl_item = 61;
+pub const ALTMON_5: ::nl_item = 62;
+pub const ALTMON_6: ::nl_item = 63;
+pub const ALTMON_7: ::nl_item = 64;
+pub const ALTMON_8: ::nl_item = 65;
+pub const ALTMON_9: ::nl_item = 66;
+pub const ALTMON_10: ::nl_item = 67;
+pub const ALTMON_11: ::nl_item = 68;
+pub const ALTMON_12: ::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 = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+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 = ::POLLIN
+    | ::POLLPRI
+    | ::POLLOUT
+    | ::POLLRDNORM
+    | ::POLLRDBAND
+    | ::POLLWRBAND
+    | ::POLLERR
+    | ::POLLHUP
+    | ::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_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: ::clockid_t = 0;
+pub const CLOCK_VIRTUAL: ::clockid_t = 1;
+pub const CLOCK_PROF: ::clockid_t = 2;
+pub const CLOCK_MONOTONIC: ::clockid_t = 4;
+pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
+pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
+pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
+pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
+pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
+pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
+pub const CLOCK_SECOND: ::clockid_t = 13;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::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 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 IPV6_DONTFRAG: ::c_int = 62;
+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;
+
+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 TIOCTIMESTAMP: ::c_ulong = 0x40107459;
+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;
+pub const BIOCSETF: ::c_ulong = 0x80104267;
+pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279;
+pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
+pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
+
+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: ::tcflag_t = 0x00030000;
+pub const CCTS_OFLOW: ::tcflag_t = 0x00010000;
+pub const CRTS_IFLOW: ::tcflag_t = 0x00020000;
+pub const CDTR_IFLOW: ::tcflag_t = 0x00040000;
+pub const CDSR_OFLOW: ::tcflag_t = 0x00080000;
+pub const CCAR_OFLOW: ::tcflag_t = 0x00100000;
+pub const VERASE2: usize = 7;
+pub const OCRNL: ::tcflag_t = 0x10;
+pub const ONOCR: ::tcflag_t = 0x20;
+pub const ONLRET: ::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;
+
+//<sys/timex.h>
+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: ::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;
+
+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 ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn accept4(
+        s: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::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: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn endutxent();
+    pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
+    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 ::timespec) -> ::c_int;
+    pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrouplist(
+        name: *const ::c_char,
+        basegid: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::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 ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::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: ::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 ::kevent,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent,
+        nevents: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
+    pub fn lutimes(file: *const ::c_char, times: *const ::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: ::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: ::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: ::locale_t) -> ::locale_t;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::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 ::pollfd,
+        nfds: ::nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pthread_attr_get_np(tid: ::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 ::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_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: ::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 ::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 ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::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: ::pthread_t, name: *mut ::c_char, len: ::size_t);
+    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
+    pub fn pthread_getname_np(
+        thread: ::pthread_t,
+        buffer: *mut ::c_char,
+        length: ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut sched_param,
+    ) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::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 ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
+    pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::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 ::timespec) -> ::c_int;
+    pub fn sendfile(
+        fd: ::c_int,
+        s: ::c_int,
+        offset: ::off_t,
+        nbytes: ::size_t,
+        hdtr: *mut ::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: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn setutxent();
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::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: ::locale_t) -> ::locale_t;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::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 <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;
+
+    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: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::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 ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+    pub fn fparseln(
+        stream: *mut ::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 ::kvm_t;
+    pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int;
+    pub fn kvm_getprocs(
+        kd: *mut ::kvm_t,
+        op: ::c_int,
+        arg: ::c_int,
+        cnt: *mut ::c_int,
+    ) -> *mut ::kinfo_proc;
+    pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+    pub fn kvm_openfiles(
+        execfile: *const ::c_char,
+        corefile: *const ::c_char,
+        swapfile: *const ::c_char,
+        flags: ::c_int,
+        errbuf: *mut ::c_char,
+    ) -> *mut ::kvm_t;
+    pub fn kvm_read(
+        kd: *mut ::kvm_t,
+        addr: ::c_ulong,
+        buf: *mut ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+    pub fn kvm_write(
+        kd: *mut ::kvm_t,
+        addr: ::c_ulong,
+        buf: *const ::c_void,
+        nbytes: ::size_t,
+    ) -> ::ssize_t;
+}
+
+cfg_if! {
+    if #[cfg(target_os = "freebsd")] {
+        mod freebsd;
+        pub use self::freebsd::*;
+    } else if #[cfg(target_os = "dragonfly")] {
+        mod dragonfly;
+        pub use self::dragonfly::*;
+    } else {
+        // ...
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/mod.rs
new file mode 100644
index 00000000000..9a2e6c463d3
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/mod.rs
@@ -0,0 +1,932 @@
+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 = ::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: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::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: ::uid_t,
+        pub pw_gid: ::gid_t,
+        pub pw_change: ::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: ::time_t,
+
+        #[cfg(not(any(target_os = "macos",
+                      target_os = "ios",
+                      target_os = "tvos",
+                      target_os = "watchos",
+                      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 ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::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 / 64],
+        #[cfg(not(all(target_pointer_width = "64",
+                      any(target_os = "freebsd", target_os = "dragonfly"))))]
+        fds_bits: [i32; FD_SETSIZE / 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: ::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,
+    }
+
+    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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 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: ::cc_t = 0xff;
+pub const IGNBRK: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXON: ::tcflag_t = 0x00000200;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x1;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const OXTABS: ::tcflag_t = 0x4;
+pub const ONOEOT: ::tcflag_t = 0x8;
+pub const CIGNORE: ::tcflag_t = 0x00000001;
+pub const CSIZE: ::tcflag_t = 0x00000300;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000100;
+pub const CS7: ::tcflag_t = 0x00000200;
+pub const CS8: ::tcflag_t = 0x00000300;
+pub const CSTOPB: ::tcflag_t = 0x00000400;
+pub const CREAD: ::tcflag_t = 0x00000800;
+pub const PARENB: ::tcflag_t = 0x00001000;
+pub const PARODD: ::tcflag_t = 0x00002000;
+pub const HUPCL: ::tcflag_t = 0x00004000;
+pub const CLOCAL: ::tcflag_t = 0x00008000;
+pub const ECHOKE: ::tcflag_t = 0x00000001;
+pub const ECHOE: ::tcflag_t = 0x00000002;
+pub const ECHOK: ::tcflag_t = 0x00000004;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const ECHONL: ::tcflag_t = 0x00000010;
+pub const ECHOPRT: ::tcflag_t = 0x00000020;
+pub const ECHOCTL: ::tcflag_t = 0x00000040;
+pub const ISIG: ::tcflag_t = 0x00000080;
+pub const ICANON: ::tcflag_t = 0x00000100;
+pub const ALTWERASE: ::tcflag_t = 0x00000200;
+pub const IEXTEN: ::tcflag_t = 0x00000400;
+pub const EXTPROC: ::tcflag_t = 0x00000800;
+pub const TOSTOP: ::tcflag_t = 0x00400000;
+pub const FLUSHO: ::tcflag_t = 0x00800000;
+pub const NOKERNINFO: ::tcflag_t = 0x02000000;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const MDMBUF: ::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;
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
+            (*mhdr).msg_control as *mut ::cmsghdr
+        } else {
+            0 as *mut ::cmsghdr
+        }
+    }
+
+    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 ::rlimit) -> ::c_int;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "setrlimit$UNIX2003"
+    )]
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::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 ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::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 ::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 ::uid_t, egid: *mut ::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<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::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 ::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 ::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 ::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 ::sockaddr,
+        addrlen: *mut ::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 ::timeval) -> ::c_int;
+    pub fn nl_langinfo(item: ::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 ::sockaddr, address_len: ::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 ::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 ::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 ::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 ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    pub fn sync();
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_cancel$UNIX2003"
+    )]
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::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: ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::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 ::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 ::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 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: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "getitimer$UNIX2003"
+    )]
+    pub fn getitimer(which: ::c_int, curr_value: *mut ::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 ::itimerval,
+        old_value: *mut ::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 ::tm,
+    ) -> ::size_t;
+    pub fn strftime_l(
+        buf: *mut ::c_char,
+        maxsize: ::size_t,
+        format: *const ::c_char,
+        timeptr: *const ::tm,
+        locale: ::locale_t,
+    ) -> ::size_t;
+}
+
+cfg_if! {
+    if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] {
+        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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/mod.rs
new file mode 100644
index 00000000000..e92cf659401
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/mod.rs
@@ -0,0 +1,863 @@
+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: ::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 in6_pktinfo {
+        pub ipi6_addr: ::in6_addr,
+        pub ipi6_ifindex: ::c_uint,
+    }
+
+    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; ::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: ::pid_t,
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+    }
+
+    pub struct ipc_perm {
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mode: ::mode_t,
+        #[cfg(target_os = "openbsd")]
+        pub seq: ::c_ushort,
+        #[cfg(target_os = "netbsd")]
+        pub _seq: ::c_ushort,
+        #[cfg(target_os = "openbsd")]
+        pub key: ::key_t,
+        #[cfg(target_os = "netbsd")]
+        pub _key: ::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 const D_T_FMT: ::nl_item = 0;
+pub const D_FMT: ::nl_item = 1;
+pub const T_FMT: ::nl_item = 2;
+pub const T_FMT_AMPM: ::nl_item = 3;
+pub const AM_STR: ::nl_item = 4;
+pub const PM_STR: ::nl_item = 5;
+
+pub const DAY_1: ::nl_item = 6;
+pub const DAY_2: ::nl_item = 7;
+pub const DAY_3: ::nl_item = 8;
+pub const DAY_4: ::nl_item = 9;
+pub const DAY_5: ::nl_item = 10;
+pub const DAY_6: ::nl_item = 11;
+pub const DAY_7: ::nl_item = 12;
+
+pub const ABDAY_1: ::nl_item = 13;
+pub const ABDAY_2: ::nl_item = 14;
+pub const ABDAY_3: ::nl_item = 15;
+pub const ABDAY_4: ::nl_item = 16;
+pub const ABDAY_5: ::nl_item = 17;
+pub const ABDAY_6: ::nl_item = 18;
+pub const ABDAY_7: ::nl_item = 19;
+
+pub const MON_1: ::nl_item = 20;
+pub const MON_2: ::nl_item = 21;
+pub const MON_3: ::nl_item = 22;
+pub const MON_4: ::nl_item = 23;
+pub const MON_5: ::nl_item = 24;
+pub const MON_6: ::nl_item = 25;
+pub const MON_7: ::nl_item = 26;
+pub const MON_8: ::nl_item = 27;
+pub const MON_9: ::nl_item = 28;
+pub const MON_10: ::nl_item = 29;
+pub const MON_11: ::nl_item = 30;
+pub const MON_12: ::nl_item = 31;
+
+pub const ABMON_1: ::nl_item = 32;
+pub const ABMON_2: ::nl_item = 33;
+pub const ABMON_3: ::nl_item = 34;
+pub const ABMON_4: ::nl_item = 35;
+pub const ABMON_5: ::nl_item = 36;
+pub const ABMON_6: ::nl_item = 37;
+pub const ABMON_7: ::nl_item = 38;
+pub const ABMON_8: ::nl_item = 39;
+pub const ABMON_9: ::nl_item = 40;
+pub const ABMON_10: ::nl_item = 41;
+pub const ABMON_11: ::nl_item = 42;
+pub const ABMON_12: ::nl_item = 43;
+
+pub const RADIXCHAR: ::nl_item = 44;
+pub const THOUSEP: ::nl_item = 45;
+pub const YESSTR: ::nl_item = 46;
+pub const YESEXPR: ::nl_item = 47;
+pub const NOSTR: ::nl_item = 48;
+pub const NOEXPR: ::nl_item = 49;
+pub const CRNCYSTR: ::nl_item = 50;
+
+pub const CODESET: ::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 = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+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: ::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;
+
+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: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::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: ::tcflag_t = 0x00010000;
+pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS;
+pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS;
+pub const OCRNL: ::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 ::sockaddr,
+        addrlen: *mut ::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: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn __errno() -> *mut ::c_int;
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::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 ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::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: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::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: ::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 ::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: ::pthread_t,
+        policy: ::c_int,
+        param: *const sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::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: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(name: *const ::c_char, basegid: ::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 ::utsname) -> ::c_int;
+
+    pub fn shmget(key: ::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 ::shmid_ds) -> ::c_int;
+    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: ::id_t,
+        infop: *mut ::siginfo_t,
+        options: ::c_int,
+    ) -> ::c_int;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::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 ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::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: ::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) -> ::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;
+}
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
new file mode 100644
index 00000000000..45bca4778c2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
@@ -0,0 +1,162 @@
+use 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 {
+        #[cfg(libc_union)]
+        pub __qregs: [__c_anonymous__freg; 32],
+        pub __fpcr: u32,
+        pub __fpsr: u32,
+    }
+
+    pub struct mcontext_t {
+        pub __gregs: [::greg_t; 32],
+        pub __fregs: __fregset,
+        __spare: [::greg_t; 8],
+    }
+
+    pub struct ucontext_t {
+        pub uc_flags: ::c_uint,
+        pub uc_link: *mut ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    #[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")] {
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous__freg {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous__freg {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous__freg")
+                    .field("__b8", &self.__b8)
+                    .field("__h16", &self.__h16)
+                    .field("__s32", &self.__s32)
+                    .field("__d64", &self.__d64)
+                    .field("__q128", &self.__q128)
+                    .finish()
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous__freg {
+            fn hash<H: ::hash::Hasher>(&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);
+                }
+            }
+        }
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs
new file mode 100644
index 00000000000..b5000d34d66
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs
@@ -0,0 +1,81 @@
+use 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;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs
new file mode 100644
index 00000000000..a536254ceb4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs
@@ -0,0 +1,21 @@
+use 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;
+
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+         #[doc(hidden)]
+         pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+         #[doc(hidden)]
+         pub const _ALIGNBYTES: usize = 8 - 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
new file mode 100644
index 00000000000..7c63db8e0e2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -0,0 +1,3148 @@
+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 = ::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) -> ::pid_t {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._uid
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_errno: ::c_int,
+            _si_code: ::c_int,
+            __pad1: ::c_int,
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+            value: ::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: ::pid_t,
+            _uid: ::uid_t,
+            _value: ::sigval,
+            _cpid: ::pid_t,
+            _cuid: ::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: ::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: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct sigset_t {
+        __bits: [u32; 4],
+    }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_mode: ::mode_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_atime: ::time_t,
+        pub st_atimensec: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_mtimensec: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_ctimensec: ::c_long,
+        pub st_birthtime: ::time_t,
+        pub st_birthtimensec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::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: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut ::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: ::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 ::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: ::pthread_t,
+        ptr_private: *mut ::c_void,
+    }
+
+    pub struct pthread_spinlock_t {
+        pts_magic: ::c_uint,
+        pts_spin: ::pthread_spin_t,
+        pts_flags: ::c_int,
+    }
+
+    pub struct kevent {
+        pub ident: ::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: ::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: ::pid_t,
+        pub sc_uid: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct uucred {
+        pub cr_unused: ::c_ushort,
+        pub cr_uid: ::uid_t,
+        pub cr_gid: ::gid_t,
+        pub cr_ngroups: ::c_int,
+        pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
+    }
+
+    pub struct unpcbid {
+        pub unp_pid: ::pid_t,
+        pub unp_euid: ::uid_t,
+        pub unp_egid: ::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 mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    pub struct __exit_status {
+        pub e_termination: u16,
+        pub e_exit: u16,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::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: ::time_t
+    }
+
+    pub struct lastlog {
+        pub ll_line: [::c_char; UT_LINESIZE],
+        pub ll_host: [::c_char; UT_HOSTSIZE],
+        pub ll_time: ::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: ::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; 10]; 24],
+    }
+
+    pub struct ki_sigset_t {
+        pub __bits: [u32; 4],
+    }
+
+    pub struct kinfo_proc2 {
+        pub p_forw: u64,
+        pub p_back: u64,
+        pub p_paddr: u64,
+        pub p_addr: u64,
+        pub p_fd: u64,
+        pub p_cwdi: u64,
+        pub p_stats: u64,
+        pub p_limit: u64,
+        pub p_vmspace: u64,
+        pub p_sigacts: u64,
+        pub p_sess: u64,
+        pub p_tsess: u64,
+        pub p_ru: u64,
+        pub p_eflag: i32,
+        pub p_exitsig: i32,
+        pub p_flag: i32,
+        pub p_pid: i32,
+        pub p_ppid: i32,
+        pub p_sid: i32,
+        pub p__pgid: i32,
+        pub p_tpgid: i32,
+        pub p_uid: u32,
+        pub p_ruid: u32,
+        pub p_gid: u32,
+        pub p_rgid: u32,
+        pub p_groups: [u32; KI_NGROUPS as usize],
+        pub p_ngroups: i16,
+        pub p_jobc: i16,
+        pub p_tdev: u32,
+        pub p_estcpu: u32,
+        pub p_rtime_sec: u32,
+        pub p_rtime_usec: u32,
+        pub p_cpticks: i32,
+        pub p_pctcpu: u32,
+        pub p_swtime: u32,
+        pub p_slptime: u32,
+        pub p_schedflags: i32,
+        pub p_uticks: u64,
+        pub p_sticks: u64,
+        pub p_iticks: u64,
+        pub p_tracep: u64,
+        pub p_traceflag: i32,
+        pub p_holdcnt: i32,
+        pub p_siglist: ki_sigset_t,
+        pub p_sigmask: ki_sigset_t,
+        pub p_sigignore: ki_sigset_t,
+        pub p_sigcatch: ki_sigset_t,
+        pub p_stat: i8,
+        pub p_priority: u8,
+        pub p_usrpri: u8,
+        pub p_nice: u8,
+        pub p_xstat: u16,
+        pub p_acflag: u16,
+        pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
+        pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
+        pub p_wchan: u64,
+        pub p_login: [::c_char; KI_MAXLOGNAME as usize],
+        pub p_vm_rssize: i32,
+        pub p_vm_tsize: i32,
+        pub p_vm_dsize: i32,
+        pub p_vm_ssize: i32,
+        pub p_uvalid: i64,
+        pub p_ustart_sec: u32,
+        pub p_ustart_usec: u32,
+        pub p_uutime_sec: u32,
+        pub p_uutime_usec: u32,
+        pub p_ustime_sec: u32,
+        pub p_ustime_usec: u32,
+        pub p_uru_maxrss: u64,
+        pub p_uru_ixrss: u64,
+        pub p_uru_idrss: u64,
+        pub p_uru_isrss: u64,
+        pub p_uru_minflt: u64,
+        pub p_uru_majflt: u64,
+        pub p_uru_nswap: u64,
+        pub p_uru_inblock: u64,
+        pub p_uru_oublock: u64,
+        pub p_uru_msgsnd: u64,
+        pub p_uru_msgrcv: u64,
+        pub p_uru_nsignals: u64,
+        pub p_uru_nvcsw: u64,
+        pub p_uru_nivcsw: u64,
+        pub p_uctime_sec: u32,
+        pub p_uctime_usec: u32,
+        pub p_cpuid: u64,
+        pub p_realflag: u64,
+        pub p_nlwps: u64,
+        pub p_nrlwps: u64,
+        pub p_realstat: u64,
+        pub p_svuid: u32,
+        pub p_svgid: u32,
+        pub p_ename: [::c_char; KI_MAXEMULLEN as usize],
+        pub p_vm_vsize: i64,
+        pub p_vm_msize: i64,
+    }
+
+    pub struct kinfo_lwp {
+        pub l_forw: u64,
+        pub l_back: u64,
+        pub l_laddr: u64,
+        pub l_addr: u64,
+        pub l_lid: i32,
+        pub l_flag: i32,
+        pub l_swtime: u32,
+        pub l_slptime: u32,
+        pub l_schedflags: i32,
+        pub l_holdcnt: i32,
+        pub l_priority: u8,
+        pub l_usrpri: u8,
+        pub l_stat: i8,
+        l_pad1: i8,
+        l_pad2: i32,
+        pub l_wmesg: [::c_char; KI_WMESGLEN as usize],
+        pub l_wchan: u64,
+        pub l_cpuid: u64,
+        pub l_rtime_sec: u32,
+        pub l_rtime_usec: u32,
+        pub l_cpticks: u32,
+        pub l_pctcpu: u32,
+        pub l_pid: u32,
+        pub l_name: [::c_char; KI_LNAMELEN as usize],
+    }
+
+    pub struct kinfo_vmentry {
+        pub kve_start: u64,
+        pub kve_end: u64,
+        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: ::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: ::pid_t,
+        pub sa_schedparam: ::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,
+        #[cfg(libc_union)]
+        pub fae_data: __c_anonymous_posix_spawn_fae,
+    }
+
+    pub struct posix_spawn_file_actions_t {
+        pub size: ::c_uint,
+        pub len: ::c_uint,
+        #[cfg(libc_union)]
+        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,
+        #[cfg(libc_union)]
+        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: ::pid_t,
+        pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported
+        pub ut_ss: sockaddr_storage,
+        pub ut_tv: ::timeval,
+        pub ut_pad: [u8; _UTX_PADSIZE],
+    }
+
+    pub struct lastlogx {
+        pub ll_tv: ::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: ::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: ::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: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [i8; 8],
+    }
+
+    pub struct dirent {
+        pub d_fileno: ::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: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_bresvd: ::fsblkcnt_t,
+
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_favail: ::fsfilcnt_t,
+        pub f_fresvd: ::fsfilcnt_t,
+
+        pub f_syncreads: u64,
+        pub f_syncwrites: u64,
+
+        pub f_asyncreads: u64,
+        pub f_asyncwrites: u64,
+
+        pub f_fsidx: ::fsid_t,
+        pub f_fsid: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        pub f_owner: ::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: ::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: ::sigval,
+        __unused1: *mut ::c_void,       //actually a function pointer
+        pub sigev_notify_attributes: *mut ::c_void
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_posix_spawn_fae {
+        pub open: __c_anonymous_posix_spawn_fae_open,
+        pub dup2: __c_anonymous_posix_spawn_fae_dup2,
+    }
+
+    #[cfg(libc_union)]
+    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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_posix_spawn_fae {}
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_posix_spawn_fae {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    f.debug_struct("__c_anonymous_posix_fae")
+                        .field("open", &self.open)
+                        .field("dup2", &self.dup2)
+                        .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_posix_spawn_fae {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.open.hash(state);
+                    self.dup2.hash(state);
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifc_ifcu {}
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    f.debug_struct("__c_anonymous_ifc_ifcu")
+                        .field("ifcu_buf", &self.ifcu_buf)
+                        .field("ifcu_req", &self.ifcu_req)
+                        .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+            fn hash<H: ::hash::Hasher>(&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 << ::LC_COLLATE;
+pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
+pub const LC_ALL_MASK: ::c_int = !0;
+
+pub const ERA: ::nl_item = 52;
+pub const ERA_D_FMT: ::nl_item = 53;
+pub const ERA_D_T_FMT: ::nl_item = 54;
+pub const ERA_T_FMT: ::nl_item = 55;
+pub const ALT_DIGITS: ::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;
+
+// <sys/fstypes.h>
+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;
+
+//<sys/timex.h>
+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: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::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: ::speed_t = 460800;
+pub const B921600: ::speed_t = 921600;
+
+pub const ONOCR: ::tcflag_t = 0x20;
+pub const ONLRET: ::tcflag_t = 0x40;
+pub const CDTRCTS: ::tcflag_t = 0x00020000;
+pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::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;
+
+cfg_if! {
+
+    if #[cfg(libc_const_extern_fn)] {
+        pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+            alignment << MAP_ALIGNMENT_SHIFT
+        }
+    } else {
+        pub fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+            alignment << MAP_ALIGNMENT_SHIFT
+        }
+    }
+}
+
+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::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+            + _ALIGN(::mem::size_of::<::cmsghdr>());
+        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::<::cmsghdr>()) + _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 ::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::<sockcred>() + ::mem::size_of::<::gid_t>() * 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: ::dev_t) -> ::c_int {
+        (((dev as u32) & 0x000fff00) >>  8) as ::c_int
+    }
+
+    pub fn minor(dev: ::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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::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 ::termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut ::termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+
+    #[link_name = "__lutimes50"]
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+    #[link_name = "__gettimeofday50"]
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    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 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;
+    #[link_name = "__kevent50"]
+    pub fn kevent(
+        kq: ::c_int,
+        changelist: *const ::kevent,
+        nchanges: ::size_t,
+        eventlist: *mut ::kevent,
+        nevents: ::size_t,
+        timeout: *const ::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, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    #[link_name = "__mq_timedreceive50"]
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    #[link_name = "__mq_timedsend50"]
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::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: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(
+        t: ::pthread_t,
+        name: *const ::c_char,
+        arg: *const ::c_void,
+    ) -> ::c_int;
+    pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_getattr_np(native: ::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 ::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_getaffinity_np(
+        thread: ::pthread_t,
+        size: ::size_t,
+        set: *mut cpuset_t,
+    ) -> ::c_int;
+    pub fn pthread_setaffinity_np(
+        thread: ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    #[link_name = "__settimeofday50"]
+    pub fn settimeofday(tv: *const ::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 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 ::timespec,
+    ) -> ::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: ::clockid_t,
+        sevp: *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, curr_value: *mut ::itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::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: ::pid_t, t: *mut ::timespec) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    #[link_name = "__pollts50"]
+    pub fn pollts(
+        fds: *mut ::pollfd,
+        nfds: ::nfds_t,
+        ts: *const ::timespec,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: ::nfds_t,
+        ts: *const ::timespec,
+        sigmask: *const ::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 = "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 ::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 ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
+    pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
+    pub fn updlastlogx(fname: *const ::c_char, uid: ::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) -> ::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: ::intmax_t,
+        hi: ::intmax_t,
+    ) -> ::intmax_t;
+    pub fn estrtou(
+        nptr: *const ::c_char,
+        base: ::c_int,
+        lo: ::uintmax_t,
+        hi: ::uintmax_t,
+    ) -> ::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<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>,
+    ) -> ::Option<unsafe extern "C" fn(::c_int, *const ::c_char, ...)>;
+    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: ::uintmax_t,
+        denominator: ::uintmax_t,
+        precision: ::size_t,
+    ) -> *mut ::c_char;
+    pub fn strspct(
+        buf: *mut ::c_char,
+        bufsiz: ::size_t,
+        numerator: ::intmax_t,
+        denominator: ::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: ::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(libc_union)] {
+        extern {
+            // these functions use statvfs:
+            pub fn getmntinfo(mntbufp: *mut *mut ::statvfs, flags: ::c_int) -> ::c_int;
+            pub fn getvfsstat(buf: *mut statvfs, bufsize: ::size_t, flags: ::c_int) -> ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs
new file mode 100644
index 00000000000..e12fd5e1123
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs
@@ -0,0 +1,21 @@
+use 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;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
new file mode 100644
index 00000000000..bc09149efea
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
@@ -0,0 +1,21 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 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;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs
new file mode 100644
index 00000000000..6a86759e07e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs
@@ -0,0 +1,8 @@
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs
new file mode 100644
index 00000000000..daa89a11a67
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs
@@ -0,0 +1,15 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+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
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
new file mode 100644
index 00000000000..ba259074f61
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs
@@ -0,0 +1,67 @@
+use 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 ::ucontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: ::mcontext_t,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
new file mode 100644
index 00000000000..2bc82e486c5
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
@@ -0,0 +1,30 @@
+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,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs
new file mode 100644
index 00000000000..f1ab365d1cd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs
new file mode 100644
index 00000000000..15803ced09a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
new file mode 100644
index 00000000000..8f470aff9a3
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -0,0 +1,2209 @@
+use unix::bsd::O_SYNC;
+
+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 = ::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 ::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: ::uid_t,
+        pub gid: ::gid_t,
+        pub mask: ::mode_t,
+        pub flags: ::c_int,
+    }
+
+    pub struct ntfs_args {
+        pub fspec: *mut ::c_char,
+        pub export_info: export_args,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub mode: ::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: ::ino_t,
+        pub ta_size_max: ::off_t,
+        pub ta_root_uid: ::uid_t,
+        pub ta_root_gid: ::gid_t,
+        pub ta_root_mode: ::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: ::uid_t,
+        pub cr_gid: ::gid_t,
+        pub cr_ngroups: ::c_short,
+        //https://github.com/openbsd/src/blob/HEAD/sys/sys/syslimits.h#L44
+        pub cr_groups: [::gid_t; 16],
+    }
+
+    pub struct export_args {
+        pub ex_flags: ::c_int,
+        pub ex_root: ::uid_t,
+        pub ex_anon: xucred,
+        pub ex_addr: *mut ::sockaddr,
+        pub ex_addrlen: ::c_int,
+        pub ex_mask: *mut ::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: ::in_addr_t,
+    }
+
+    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: [i8; 8],
+    }
+
+    pub struct splice {
+        pub sp_fd: ::c_int,
+        pub sp_max: ::off_t,
+        pub sp_idle: ::timeval,
+    }
+
+    pub struct kevent {
+        pub ident: ::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: ::mode_t,
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::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_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: u32,
+        pub st_gen: u32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+    }
+
+    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 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 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: ::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: ::uid_t,
+        pub gid: ::gid_t,
+        pub pid: ::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: ::ipc_perm,
+        pub shm_segsz: ::c_int,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::c_short,
+        pub shm_atime: ::time_t,
+        __shm_atimensec: c_long,
+        pub shm_dtime: ::time_t,
+        __shm_dtimensec: c_long,
+        pub shm_ctime: ::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: ::pid_t,
+        pub pe_tid: ::pid_t,
+    }
+
+    pub struct ptrace_thread_state {
+        pub pts_tid: ::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; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    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) -> ::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: ::pid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::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: ::pid_t,
+            _uid: ::uid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer))._uid
+    }
+
+    pub unsafe fn si_value(&self) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_timer {
+            _si_signo: ::c_int,
+            _si_code: ::c_int,
+            _si_errno: ::c_int,
+            _pad: [::c_int; SI_PAD],
+            _pid: ::pid_t,
+            _uid: ::uid_t,
+            value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).value
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_fileno: ::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: ::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: ::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: ::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],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_flags: ::c_short,
+        pub ifru_metric: ::c_int,
+        pub ifru_vnetid: i64,
+        pub ifru_media: u64,
+        pub ifru_data: ::caddr_t,
+        pub ifru_index: ::c_uint,
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 ::fmt::Debug for mount_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("mount_info")
+                // FIXME: .field("align", &self.align)
+                    .finish()
+            }
+        }
+
+        impl ::hash::Hash for mount_info {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe { self.align.hash(state) };
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ifr_ifru {}
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("__c_anonymous_ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_vnetid", unsafe { &self.ifru_vnetid })
+                    .field("ifru_media", unsafe { &self.ifru_media })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .field("ifru_index", unsafe { &self.ifru_index })
+                    .finish()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ifr_ifru {
+            fn hash<H: ::hash::Hasher>(&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);
+                }
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            // 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: ::fsid_t,
+                pub f_namemax: u32,
+                pub f_owner: ::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 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<H: ::hash::Hasher>(&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 = ::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: ::tcflag_t = ::MDMBUF | ::CRTSCTS;
+pub const OLCUC: ::tcflag_t = 0x20;
+pub const ONOCR: ::tcflag_t = 0x40;
+pub const ONLRET: ::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::<::c_int>()) - 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: ::idtype_t = 0;
+pub const P_PGID: ::idtype_t = 1;
+pub const P_PID: ::idtype_t = 2;
+
+// search.h
+pub const FIND: ::ACTION = 0;
+pub const ENTER: ::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: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
+pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_BOOTTIME: ::clockid_t = 6;
+
+pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
+pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
+pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
+pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
+pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
+pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
+
+const _LC_LAST: ::c_int = 7;
+pub const LC_ALL_MASK: ::c_int = (1 << _LC_LAST) - 2;
+
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::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;
+
+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::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+            + _ALIGN(::mem::size_of::<::cmsghdr>());
+        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::<::cmsghdr>()) + _ALIGN(length as usize))
+            as ::c_uint
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint{
+        ((dev as ::c_uint) >> 8) & 0xff
+    }
+
+    pub fn minor(dev: ::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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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 ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn settimeofday(tp: *const ::timeval, tz: *const ::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 ::DIR) -> ::c_int;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::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 ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn kevent(
+        kq: ::c_int,
+        changelist: *const ::kevent,
+        nchanges: ::c_int,
+        eventlist: *mut ::kevent,
+        nevents: ::c_int,
+        timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn getthrid() -> ::pid_t;
+    pub fn pthread_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::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_main_np() -> ::c_int;
+    pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
+    pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
+    pub fn pthread_stackseg_np(thread: ::pthread_t, sinfo: *mut ::stack_t) -> ::c_int;
+
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const ::termios,
+        winp: *const ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *const ::termios,
+        winp: *const ::winsize,
+    ) -> ::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: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn ptrace(request: ::c_int, pid: ::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 <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;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn duplocale(base: ::locale_t) -> ::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<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::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<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn hcreate(nelt: ::size_t) -> ::c_int;
+    pub fn hdestroy();
+    pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY;
+
+    // futex.h
+    pub fn futex(
+        uaddr: *mut u32,
+        op: ::c_int,
+        val: ::c_int,
+        timeout: *const ::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;
+}
+
+#[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(libc_union)] {
+        extern {
+            // these functions use statfs which uses the union mount_info:
+            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 ::statfs, flags: ::c_int) -> ::c_int;
+            pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::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 = "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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
new file mode 100644
index 00000000000..f1ab365d1cd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
new file mode 100644
index 00000000000..99350ec8dc3
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
@@ -0,0 +1,16 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
new file mode 100644
index 00000000000..35f1672bbec
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs
@@ -0,0 +1,35 @@
+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,
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
new file mode 100644
index 00000000000..070fc9385f6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
new file mode 100644
index 00000000000..e87d0ff1e7d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
@@ -0,0 +1,16 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 4 - 1;
+    }
+}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
new file mode 100644
index 00000000000..60dab004456
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
@@ -0,0 +1,130 @@
+use 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<H: ::hash::Hasher>(&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);
+            }
+        }
+    }
+}
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/haiku/b32.rs b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/b32.rs
new file mode 100644
index 00000000000..073ae9d4b58
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/b32.rs
@@ -0,0 +1,20 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type time_t = i32;
+
+pub type Elf_Addr = ::Elf32_Addr;
+pub type Elf_Half = ::Elf32_Half;
+pub type Elf_Phdr = ::Elf32_Phdr;
+
+s! {
+    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,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/haiku/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/b64.rs
new file mode 100644
index 00000000000..456918052d2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/b64.rs
@@ -0,0 +1,20 @@
+pub type c_ulong = u64;
+pub type c_long = i64;
+pub type time_t = i64;
+
+pub type Elf_Addr = ::Elf64_Addr;
+pub type Elf_Half = ::Elf64_Half;
+pub type Elf_Phdr = ::Elf64_Phdr;
+
+s! {
+    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,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/haiku/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/mod.rs
new file mode 100644
index 00000000000..e7b0f34dd37
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/mod.rs
@@ -0,0 +1,2105 @@
+pub type rlim_t = ::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 = ::uintptr_t;
+pub type pthread_condattr_t = ::uintptr_t;
+pub type pthread_mutexattr_t = ::uintptr_t;
+pub type pthread_rwlockattr_t = ::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) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        self.si_uid
+    }
+
+    pub unsafe fn si_status(&self) -> ::c_int {
+        self.si_status
+    }
+}
+
+s! {
+    pub struct in_addr {
+        pub s_addr: ::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: ::in_port_t,
+        pub sin_addr: ::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: ::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 ::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 ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::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 ::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,
+    }
+
+    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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line:  ::c_char,
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::speed_t,
+        pub c_cc: [::cc_t; ::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: ::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: ::uid_t,
+        pub st_gid: ::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: ::uid_t,
+        pub pw_gid: ::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: ::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 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: ::pid_t,
+        pub si_uid: ::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: ::sighandler_t, //actually a union with sa_handler
+        pub sa_mask: ::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: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::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: ::ipc_perm,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+    }
+
+    pub struct ipc_perm {
+        pub key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::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: ::Elf_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf_Phdr,
+        pub dlpi_phnum: ::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: ::sigval,
+        __unused1: *mut ::c_void, // actually a function pointer
+        pub sigev_notify_attributes: *mut ::pthread_attr_t,
+    }
+
+    pub struct utmpx {
+        pub ut_type: ::c_short,
+        pub ut_tv: ::timeval,
+        pub ut_id: [::c_char; 8],
+        pub ut_pid: ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 = -1;
+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: ::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: ::mode_t = 4096;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+
+pub const S_IRWXU: ::mode_t = 0o00700;
+pub const S_IRUSR: ::mode_t = 0o00400;
+pub const S_IWUSR: ::mode_t = 0o00200;
+pub const S_IXUSR: ::mode_t = 0o00100;
+pub const S_IRWXG: ::mode_t = 0o00070;
+pub const S_IRGRP: ::mode_t = 0o00040;
+pub const S_IWGRP: ::mode_t = 0o00020;
+pub const S_IXGRP: ::mode_t = 0o00010;
+pub const S_IRWXO: ::mode_t = 0o00007;
+pub const S_IROTH: ::mode_t = 0o00004;
+pub const S_IWOTH: ::mode_t = 0o00002;
+pub const S_IXOTH: ::mode_t = 0o00001;
+
+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;
+
+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 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: ::tcflag_t = 0x01;
+pub const BRKINT: ::tcflag_t = 0x02;
+pub const IGNPAR: ::tcflag_t = 0x04;
+pub const PARMRK: ::tcflag_t = 0x08;
+pub const INPCK: ::tcflag_t = 0x10;
+pub const ISTRIP: ::tcflag_t = 0x20;
+pub const INLCR: ::tcflag_t = 0x40;
+pub const IGNCR: ::tcflag_t = 0x80;
+pub const ICRNL: ::tcflag_t = 0x100;
+pub const IUCLC: ::tcflag_t = 0x200;
+pub const IXON: ::tcflag_t = 0x400;
+pub const IXANY: ::tcflag_t = 0x800;
+pub const IXOFF: ::tcflag_t = 0x1000;
+
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const OLCUC: ::tcflag_t = 0x00000002;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::tcflag_t = 0x00000080;
+pub const NLDLY: ::tcflag_t = 0x00000100;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const CRDLY: ::tcflag_t = 0x00000600;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0x00001800;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0x00002000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VTDLY: ::tcflag_t = 0x00004000;
+pub const VT0: ::tcflag_t = 0x00000000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const FFDLY: ::tcflag_t = 0x00008000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const FF1: ::tcflag_t = 0x00008000;
+
+pub const CSIZE: ::tcflag_t = 0x00000020;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CS6: ::tcflag_t = 0x00000000;
+pub const CS7: ::tcflag_t = 0x00000000;
+pub const CS8: ::tcflag_t = 0x00000020;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const XLOBLK: ::tcflag_t = 0x00001000;
+pub const CTSFLOW: ::tcflag_t = 0x00002000;
+pub const RTSFLOW: ::tcflag_t = 0x00004000;
+pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW;
+
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const IEXTEN: ::tcflag_t = 0x00000200;
+pub const ECHOCTL: ::tcflag_t = 0x00000400;
+pub const ECHOPRT: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00001000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const PENDIN: ::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 = TIOCM_CD;
+pub const TIOCM_RI: ::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 TCWAITEVENT: ::c_ulong = TCGETA + 4;
+pub const TCSBRK: ::c_ulong = TCGETA + 5;
+pub const TCFLSH: ::c_ulong = TCGETA + 6;
+pub const TCXONC: ::c_ulong = TCGETA + 7;
+pub const TCQUERYCONNECTED: ::c_ulong = TCGETA + 8;
+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 TCVTIME: ::c_ulong = TCGETA + 14;
+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 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
+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::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*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::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const msghdr,
+                       cmsg: *const cmsghdr) -> *mut cmsghdr {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)
+            + CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
+        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 ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::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 ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn futimens(fd: ::c_int, times: *const ::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 ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        numfds: ::nfds_t,
+        timeout: *const ::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 ::FILE) -> *mut spwd;
+    pub fn fgetspent_r(
+        file: *mut ::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: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::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: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+    pub fn pthread_create(
+        thread: *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_attr_getguardsize(
+        attr: *const ::pthread_attr_t,
+        guardsize: *mut ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setguardsize(attr: *mut ::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_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 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 ::gid_t) -> ::c_int;
+    pub fn initgroups(name: *const ::c_char, basegid: ::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 ::DIR) -> ::c_int;
+    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 pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::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 waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+
+    pub fn glob(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+    pub fn gettimeofday(tp: *mut ::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: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::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 ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn execvpe(
+        file: *const ::c_char,
+        argv: *const *const ::c_char,
+        environment: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        basegroup: ::gid_t,
+        grouplist: *mut ::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 ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group;
+    pub fn pthread_kill(thread: ::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: ::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 ::group;
+    pub fn setgrent();
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+    pub fn uname(buf: *mut ::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 ::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 ::itimerval) -> ::c_int;
+    pub fn setitimer(
+        which: ::c_int,
+        new_value: *const ::itimerval,
+        old_value: *mut ::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: ::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: ::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) -> ::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<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::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<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+    ) -> *mut ::c_void;
+    pub fn hcreate(nelt: ::size_t) -> ::c_int;
+    pub fn hdestroy();
+    pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::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 ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+
+    pub fn posix_spawn_file_actions_init(file_actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+    pub fn posix_spawn_file_actions_destroy(
+        file_actions: *mut posix_spawn_file_actions_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addopen(
+        file_actions: *mut posix_spawn_file_actions_t,
+        fildes: ::c_int,
+        path: *const ::c_char,
+        oflag: ::c_int,
+        mode: ::mode_t,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_addclose(
+        file_actions: *mut posix_spawn_file_actions_t,
+        fildes: ::c_int,
+    ) -> ::c_int;
+    pub fn posix_spawn_file_actions_adddup2(
+        file_actions: *mut posix_spawn_file_actions_t,
+        fildes: ::c_int,
+        newfildes: ::c_int,
+    ) -> ::c_int;
+
+    pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+    pub fn posix_spawnattr_getflags(
+        attr: *const posix_spawnattr_t,
+        _flags: *mut ::c_short,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+    pub fn posix_spawnattr_getpgroup(
+        attr: *const posix_spawnattr_t,
+        _pgroup: *mut ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: ::pid_t) -> ::c_int;
+    pub fn posix_spawnattr_getsigdefault(
+        attr: *const posix_spawnattr_t,
+        sigdefault: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        sigdefault: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        _sigmask: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        sigmask: *const ::sigset_t,
+    ) -> ::c_int;
+    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: ::locale_t,
+    ) -> ::c_int;
+    pub fn strncasecmp_l(
+        string1: *const ::c_char,
+        string2: *const ::c_char,
+        length: ::size_t,
+        locale: ::locale_t,
+    ) -> ::c_int;
+}
+
+#[link(name = "bsd")]
+extern "C" {
+    pub fn lutimes(file: *const ::c_char, times: *const ::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 ::winsize,
+    ) -> ::pid_t;
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::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;
+}
+
+#[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: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+    pub fn pthread_getname_np(
+        thread: ::pthread_t,
+        buffer: *mut ::c_char,
+        length: ::size_t,
+    ) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/haiku/native.rs b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/native.rs
new file mode 100644
index 00000000000..62d6392fabd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/native.rs
@@ -0,0 +1,1488 @@
+// 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: ::uid_t,
+        pub sender_group: ::gid_t,
+        pub sender_team: ::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: ::uid_t,
+        pub gid: ::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: ::time_t,
+        pub creation_time: ::time_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t
+    }
+
+    //kernel/fs_info.h
+    pub struct fs_info {
+        pub dev: ::dev_t,
+        pub root: ::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: ::dev_t,
+        pub node: ::ino_t,
+        pub name: [::c_char; ::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! {
+    #[cfg(libc_union)]
+    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,
+    }
+
+    #[cfg(libc_union)]
+    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,
+        #[cfg(libc_union)]
+        pub data: __c_anonymous_cpu_topology_info_data,
+        #[cfg(not(libc_union))]
+        pub data: cpu_topology_core_info,
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for cpuid_info {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for cpuid_info {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("cpuid_info")
+                    .field("eax_0", &self.eax_0)
+                    .field("eax_1", &self.eax_1)
+                    .field("eax_2", &self.eax_2)
+                    .field("eax_3", &self.eax_3)
+                    .field("as_chars", &self.as_chars)
+                    .field("regs", &self.regs)
+                    .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_cpu_topology_info_data {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_cpu_topology_info_data {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous_cpu_topology_info_data")
+                    .field("root", &self.root)
+                    .field("package", &self.package)
+                    .field("core", &self.core)
+                    .finish()
+                }
+            }
+        }
+
+        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 = ::FILENAME_MAX as usize;
+pub const B_PATH_NAME_LENGTH: usize = ::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 = ::O_RDONLY as u32;
+pub const B_WRITE_ONLY: u32 = ::O_WRONLY as u32;
+pub const B_READ_WRITE: u32 = ::O_RDWR as u32;
+
+pub const B_FAIL_IF_EXISTS: u32 = ::O_EXCL as u32;
+pub const B_CREATE_FILE: u32 = ::O_CREAT as u32;
+pub const B_ERASE_FILE: u32 = ::O_TRUNC as u32;
+pub const B_OPEN_AT_END: u32 = ::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 = ::EOVERFLOW;
+pub const B_TOO_MANY_ARGS: status_t = ::E2BIG;
+pub const B_FILE_TOO_LARGE: status_t = ::EFBIG;
+pub const B_RESULT_NOT_REPRESENTABLE: status_t = ::ERANGE;
+pub const B_DEVICE_NOT_FOUND: status_t = ::ENODEV;
+pub const B_NOT_SUPPORTED: status_t = ::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');
+
+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: ::bigtime_t,
+        length: ::bigtime_t,
+    ) -> i32;
+    pub fn estimate_max_scheduling_latency(th: ::thread_id) -> ::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: ::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 ::DIR;
+    pub fn fs_lopen_attr_dir(path: *const ::c_char) -> *mut ::DIR;
+    pub fn fs_fopen_attr_dir(fd: ::c_int) -> *mut ::DIR;
+    pub fn fs_close_attr_dir(dir: *mut ::DIR) -> ::c_int;
+    pub fn fs_read_attr_dir(dir: *mut ::DIR) -> *mut ::dirent;
+    pub fn fs_rewind_attr_dir(dir: *mut ::DIR);
+
+    // kernel/fs_image.h
+    pub fn fs_create_index(
+        device: ::dev_t,
+        name: *const ::c_char,
+        type_: u32,
+        flags: u32,
+    ) -> ::c_int;
+    pub fn fs_remove_index(device: ::dev_t, name: *const ::c_char) -> ::c_int;
+    pub fn fs_stat_index(
+        device: ::dev_t,
+        name: *const ::c_char,
+        indexInfo: *mut index_info,
+    ) -> ::c_int;
+
+    pub fn fs_open_index_dir(device: ::dev_t) -> *mut ::DIR;
+    pub fn fs_close_index_dir(indexDirectory: *mut ::DIR) -> ::c_int;
+    pub fn fs_read_index_dir(indexDirectory: *mut ::DIR) -> *mut ::dirent;
+    pub fn fs_rewind_index_dir(indexDirectory: *mut ::DIR);
+
+    // kernel/fs_info.h
+    pub fn dev_for_path(path: *const ::c_char) -> ::dev_t;
+    pub fn next_dev(pos: *mut i32) -> ::dev_t;
+    pub fn fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int;
+
+    // kernel/fs_query.h
+    pub fn fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR;
+    pub fn fs_open_live_query(
+        device: ::dev_t,
+        query: *const ::c_char,
+        flags: u32,
+        port: port_id,
+        token: i32,
+    ) -> *mut ::DIR;
+    pub fn fs_close_query(d: *mut ::DIR) -> ::c_int;
+    pub fn fs_read_query(d: *mut ::DIR) -> *mut ::dirent;
+    pub fn get_path_for_dirent(dent: *mut ::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,
+    ) -> ::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,
+        architectur: *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: ::dev_t,
+        createIt: bool,
+        pathString: *mut ::c_char,
+        length: i32,
+    ) -> status_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        extern "C" {
+            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::<cpu_info>() 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::<area_info>() 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::<area_info>() 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::<port_info>() 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::<port_info>() 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::<port_message_info>() 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::<sem_info>() 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::<sem_info>() 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::<team_info>() 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::<team_info>() 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::<team_usage_info>() 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::<thread_info>() 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::<thread_info>() 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::<image_info>() 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::<image_info>() as ::size_t,
+    )
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/haiku/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/x86_64.rs
new file mode 100644
index 00000000000..1b0462f2046
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/haiku/x86_64.rs
@@ -0,0 +1,264 @@
+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: ::sigset_t,
+        pub uc_stack: ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/hurd/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/align.rs
new file mode 100644
index 00000000000..1dd7d8e541d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/align.rs
@@ -0,0 +1 @@
+// Placeholder file
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/hurd/b32.rs b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/b32.rs
new file mode 100644
index 00000000000..7e82a91d3be
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/b32.rs
@@ -0,0 +1,93 @@
+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 = ::__int64_t;
+pub type __uquad_type = ::__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 = ::__int64_t;
+pub type __u64_type = ::__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 = ::Elf32_Addr;
+pub type Elf_Half = ::Elf32_Half;
+pub type Elf_Ehdr = ::Elf32_Ehdr;
+pub type Elf_Phdr = ::Elf32_Phdr;
+pub type Elf_Shdr = ::Elf32_Shdr;
+pub type Elf_Sym = ::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: ::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,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/hurd/b64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/b64.rs
new file mode 100644
index 00000000000..e2e502af2b6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/b64.rs
@@ -0,0 +1,95 @@
+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 = ::Elf64_Addr;
+pub type Elf_Half = ::Elf64_Half;
+pub type Elf_Ehdr = ::Elf64_Ehdr;
+pub type Elf_Phdr = ::Elf64_Phdr;
+pub type Elf_Shdr = ::Elf64_Shdr;
+pub type Elf_Sym = ::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: ::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,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/hurd/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/mod.rs
new file mode 100644
index 00000000000..2701649f6c6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/mod.rs
@@ -0,0 +1,4687 @@
+#![allow(dead_code)]
+
+// 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 ssize_t = __ssize_t;
+pub type size_t = ::c_ulong;
+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 = ::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 = ::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: ::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: ::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: 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: 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,
+    }
+
+    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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_cc: [::cc_t; 20usize],
+        pub __ispeed: ::speed_t,
+        pub __ospeed: ::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: ::sighandler_t,
+        pub sa_mask: __sigset_t,
+        pub sa_flags: ::c_int,
+    }
+
+    pub struct sigevent {
+        pub sigev_value: ::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: ::sigval,
+    }
+
+    pub struct timespec {
+        pub tv_sec: __time_t,
+        pub tv_nsec: __syscall_slong_t,
+    }
+
+    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: ::timespec,
+        pub st_mtim: ::timespec,
+        pub st_ctim: ::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_fsid: __fsid_t,
+        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: ::timespec,
+        pub st_mtim: ::timespec,
+        pub st_ctim: ::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: ::statx_timestamp,
+        pub stx_btime: ::statx_timestamp,
+        pub stx_ctime: ::statx_timestamp,
+        pub stx_mtime: ::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: ::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: ::timespec,
+        pub it_value: ::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 ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct arpreq {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::sockaddr,
+        pub arp_dev: [::c_char; 16],
+    }
+
+    pub struct arpreq_old {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::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; ::MAX_ADDR_LEN],
+    }
+
+    pub struct mmsghdr {
+        pub msg_hdr: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+
+    pub struct ifreq {
+        /// interface name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        pub ifr_ifru: ::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; 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 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: ::pid_t,
+        __sd: ::sigset_t,
+        __ss: ::sigset_t,
+        __sp: ::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: ::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: ::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<H: ::hash::Hasher>(&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) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::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: ::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: ::rlim_t = 2147483647;
+pub const RLIM64_INFINITY: ::rlim64_t = 9223372036854775807;
+pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::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: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC_COARSE: ::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: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::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 ::sem_t = 0 as *mut sem_t;
+
+// termios.h
+pub const IGNBRK: ::tcflag_t = 1;
+pub const BRKINT: ::tcflag_t = 2;
+pub const IGNPAR: ::tcflag_t = 4;
+pub const PARMRK: ::tcflag_t = 8;
+pub const INPCK: ::tcflag_t = 16;
+pub const ISTRIP: ::tcflag_t = 32;
+pub const INLCR: ::tcflag_t = 64;
+pub const IGNCR: ::tcflag_t = 128;
+pub const ICRNL: ::tcflag_t = 256;
+pub const IXON: ::tcflag_t = 512;
+pub const IXOFF: ::tcflag_t = 1024;
+pub const IXANY: ::tcflag_t = 2048;
+pub const IMAXBEL: ::tcflag_t = 8192;
+pub const IUCLC: ::tcflag_t = 16384;
+pub const OPOST: ::tcflag_t = 1;
+pub const ONLCR: ::tcflag_t = 2;
+pub const ONOEOT: ::tcflag_t = 8;
+pub const OCRNL: ::tcflag_t = 16;
+pub const ONOCR: ::tcflag_t = 32;
+pub const ONLRET: ::tcflag_t = 64;
+pub const NLDLY: ::tcflag_t = 768;
+pub const NL0: ::tcflag_t = 0;
+pub const NL1: ::tcflag_t = 256;
+pub const TABDLY: ::tcflag_t = 3076;
+pub const TAB0: ::tcflag_t = 0;
+pub const TAB1: ::tcflag_t = 1024;
+pub const TAB2: ::tcflag_t = 2048;
+pub const TAB3: ::tcflag_t = 4;
+pub const CRDLY: ::tcflag_t = 12288;
+pub const CR0: ::tcflag_t = 0;
+pub const CR1: ::tcflag_t = 4096;
+pub const CR2: ::tcflag_t = 8192;
+pub const CR3: ::tcflag_t = 12288;
+pub const FFDLY: ::tcflag_t = 16384;
+pub const FF0: ::tcflag_t = 0;
+pub const FF1: ::tcflag_t = 16384;
+pub const BSDLY: ::tcflag_t = 32768;
+pub const BS0: ::tcflag_t = 0;
+pub const BS1: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 65536;
+pub const VT0: ::tcflag_t = 0;
+pub const VT1: ::tcflag_t = 65536;
+pub const OLCUC: ::tcflag_t = 131072;
+pub const OFILL: ::tcflag_t = 262144;
+pub const OFDEL: ::tcflag_t = 524288;
+pub const CIGNORE: ::tcflag_t = 1;
+pub const CSIZE: ::tcflag_t = 768;
+pub const CS5: ::tcflag_t = 0;
+pub const CS6: ::tcflag_t = 256;
+pub const CS7: ::tcflag_t = 512;
+pub const CS8: ::tcflag_t = 768;
+pub const CSTOPB: ::tcflag_t = 1024;
+pub const CREAD: ::tcflag_t = 2048;
+pub const PARENB: ::tcflag_t = 4096;
+pub const PARODD: ::tcflag_t = 8192;
+pub const HUPCL: ::tcflag_t = 16384;
+pub const CLOCAL: ::tcflag_t = 32768;
+pub const CRTSCTS: ::tcflag_t = 65536;
+pub const CRTS_IFLOW: ::tcflag_t = 65536;
+pub const CCTS_OFLOW: ::tcflag_t = 65536;
+pub const CDTRCTS: ::tcflag_t = 131072;
+pub const MDMBUF: ::tcflag_t = 1048576;
+pub const CHWFLOW: ::tcflag_t = 1245184;
+pub const ECHOKE: ::tcflag_t = 1;
+pub const _ECHOE: ::tcflag_t = 2;
+pub const ECHOE: ::tcflag_t = 2;
+pub const _ECHOK: ::tcflag_t = 4;
+pub const ECHOK: ::tcflag_t = 4;
+pub const _ECHO: ::tcflag_t = 8;
+pub const ECHO: ::tcflag_t = 8;
+pub const _ECHONL: ::tcflag_t = 16;
+pub const ECHONL: ::tcflag_t = 16;
+pub const ECHOPRT: ::tcflag_t = 32;
+pub const ECHOCTL: ::tcflag_t = 64;
+pub const _ISIG: ::tcflag_t = 128;
+pub const ISIG: ::tcflag_t = 128;
+pub const _ICANON: ::tcflag_t = 256;
+pub const ICANON: ::tcflag_t = 256;
+pub const ALTWERASE: ::tcflag_t = 512;
+pub const _IEXTEN: ::tcflag_t = 1024;
+pub const IEXTEN: ::tcflag_t = 1024;
+pub const EXTPROC: ::tcflag_t = 2048;
+pub const _TOSTOP: ::tcflag_t = 4194304;
+pub const TOSTOP: ::tcflag_t = 4194304;
+pub const FLUSHO: ::tcflag_t = 8388608;
+pub const NOKERNINFO: ::tcflag_t = 33554432;
+pub const PENDIN: ::tcflag_t = 536870912;
+pub const _NOFLSH: ::tcflag_t = 2147483648;
+pub const NOFLSH: ::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: ::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 B7200: ::speed_t = 7200;
+pub const B14400: ::speed_t = 14400;
+pub const B19200: ::speed_t = 19200;
+pub const B28800: ::speed_t = 28800;
+pub const B38400: ::speed_t = 38400;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+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 B460800: ::speed_t = 460800;
+pub const B500000: ::speed_t = 500000;
+pub const B576000: ::speed_t = 576000;
+pub const B921600: ::speed_t = 921600;
+pub const B1000000: ::speed_t = 1000000;
+pub const B1152000: ::speed_t = 1152000;
+pub const B1500000: ::speed_t = 1500000;
+pub const B2000000: ::speed_t = 2000000;
+pub const B2500000: ::speed_t = 2500000;
+pub const B3000000: ::speed_t = 3000000;
+pub const B3500000: ::speed_t = 3500000;
+pub const B4000000: ::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: ::tcflag_t = 11042;
+pub const TTYDEF_LFLAG: ::tcflag_t = 1483;
+pub const TTYDEF_CFLAG: ::tcflag_t = 23040;
+pub const TTYDEF_SPEED: ::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 = 61440;
+pub const __S_IFDIR: mode_t = 16384;
+pub const __S_IFCHR: mode_t = 8192;
+pub const __S_IFBLK: mode_t = 24576;
+pub const __S_IFREG: mode_t = 32768;
+pub const __S_IFLNK: mode_t = 40960;
+pub const __S_IFSOCK: mode_t = 49152;
+pub const __S_IFIFO: mode_t = 4096;
+pub const __S_ISUID: mode_t = 2048;
+pub const __S_ISGID: mode_t = 1024;
+pub const __S_ISVTX: mode_t = 512;
+pub const __S_IREAD: mode_t = 256;
+pub const __S_IWRITE: mode_t = 128;
+pub const __S_IEXEC: mode_t = 64;
+pub const S_INOCACHE: mode_t = 65536;
+pub const S_IUSEUNK: mode_t = 131072;
+pub const S_IUNKNOWN: mode_t = 1835008;
+pub const S_IUNKSHIFT: mode_t = 12;
+pub const S_IPTRANS: mode_t = 2097152;
+pub const S_IATRANS: mode_t = 4194304;
+pub const S_IROOT: mode_t = 8388608;
+pub const S_ITRANS: mode_t = 14680064;
+pub const S_IMMAP0: mode_t = 16777216;
+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: ::mode_t = 61440;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_ISUID: ::mode_t = 2048;
+pub const S_ISGID: ::mode_t = 1024;
+pub const S_ISVTX: ::mode_t = 512;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IREAD: ::mode_t = 256;
+pub const S_IWRITE: ::mode_t = 128;
+pub const S_IEXEC: ::mode_t = 64;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IRWXG: ::mode_t = 56;
+pub const S_IROTH: ::mode_t = 4;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IRWXO: ::mode_t = 7;
+pub const ACCESSPERMS: ::mode_t = 511;
+pub const ALLPERMS: ::mode_t = 4095;
+pub const DEFFILEMODE: ::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: ::tcflag_t = 1;
+pub const CBREAK: ::tcflag_t = 2;
+pub const LCASE: ::tcflag_t = 4;
+pub const CRMOD: ::tcflag_t = 16;
+pub const RAW: ::tcflag_t = 32;
+pub const ODDP: ::tcflag_t = 64;
+pub const EVENP: ::tcflag_t = 128;
+pub const ANYP: ::tcflag_t = 192;
+pub const NLDELAY: ::tcflag_t = 768;
+pub const NL2: ::tcflag_t = 512;
+pub const NL3: ::tcflag_t = 768;
+pub const TBDELAY: ::tcflag_t = 3072;
+pub const XTABS: ::tcflag_t = 3072;
+pub const CRDELAY: ::tcflag_t = 12288;
+pub const VTDELAY: ::tcflag_t = 16384;
+pub const BSDELAY: ::tcflag_t = 32768;
+pub const ALLDELAY: ::tcflag_t = 65280;
+pub const CRTBS: ::tcflag_t = 65536;
+pub const PRTERA: ::tcflag_t = 131072;
+pub const CRTERA: ::tcflag_t = 262144;
+pub const TILDE: ::tcflag_t = 524288;
+pub const LITOUT: ::tcflag_t = 2097152;
+pub const NOHANG: ::tcflag_t = 16777216;
+pub const L001000: ::tcflag_t = 33554432;
+pub const CRTKIL: ::tcflag_t = 67108864;
+pub const PASS8: ::tcflag_t = 134217728;
+pub const CTLECH: ::tcflag_t = 268435456;
+pub const DECCTQ: ::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_HASSEMPHORE: ::c_int = 1024;
+pub const MAP_INHERIT: ::c_int = 2048;
+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;
+
+// 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: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 6;
+pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
+pub const RLIMIT_OFILE: ::__rlimit_resource_t = 8;
+pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 8;
+pub const RLIMIT_SBSIZE: ::__rlimit_resource_t = 9;
+pub const RLIMIT_AS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_VMEM: ::__rlimit_resource_t = 10;
+pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 11;
+pub const RLIM_NLIMITS: ::__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;
+
+const_fn! {
+    {const} fn CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+}
+
+// functions
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*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::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) 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::<cmsghdr>() {
+            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::<cpu_set_t>(), cpuset)
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.bits == set2.bits
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+         ((dev >> 8) & 0xff) as ::c_uint
+    }
+
+    pub fn minor(dev: ::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 ::timeval) -> ::c_int;
+
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+    pub fn futimens(__fd: ::c_int, __times: *const ::timespec) -> ::c_int;
+
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::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: ::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: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::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 ::sigset_t) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        info: *mut siginfo_t,
+        timeout: *const ::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 ::iovec, __count: ::c_int) -> ::ssize_t;
+    pub fn writev(__fd: ::c_int, __iovec: *const ::iovec, __count: ::c_int) -> ::ssize_t;
+
+    pub fn preadv(
+        __fd: ::c_int,
+        __iovec: *const ::iovec,
+        __count: ::c_int,
+        __offset: __off_t,
+    ) -> ssize_t;
+    pub fn pwritev(
+        __fd: ::c_int,
+        __iovec: *const ::iovec,
+        __count: ::c_int,
+        __offset: __off_t,
+    ) -> ssize_t;
+
+    pub fn preadv64(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+    ) -> ::ssize_t;
+    pub fn pwritev64(
+        fd: ::c_int,
+        iov: *const ::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 ::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 ::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;
+
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::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 ::FILE, ptr: *mut fpos64_t) -> ::c_int;
+    pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+    pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+    pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
+
+    pub fn bind(__fd: ::c_int, __addr: *const sockaddr, __len: socklen_t) -> ::c_int;
+
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::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 ::sockaddr,
+        addrlen: *mut ::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 ::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 getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
+    pub fn uname(buf: *mut ::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 ::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 ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn fgetpwent_r(
+        stream: *mut ::FILE,
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn fgetgrent_r(
+        stream: *mut ::FILE,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int;
+    pub fn putgrent(grp: *const ::group, stream: *mut ::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: ::uid_t,
+        pwd: *mut passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut passwd,
+    ) -> ::c_int;
+
+    pub fn fgetspent_r(
+        fp: *mut ::FILE,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn sgetspent_r(
+        s: *const ::c_char,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn getspent_r(
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::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 ::FILE,
+        mntbuf: *mut ::mntent,
+        buf: *mut ::c_char,
+        buflen: ::c_int,
+    ) -> *mut ::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 ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
+
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn setgroups(ngroups: ::size_t, ptr: *const ::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 ::FILE;
+    pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+    pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int;
+    pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
+    pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+
+    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_kill(__threadid: ::pthread_t, __signo: ::c_int) -> ::c_int;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn __pthread_equal(__t1: __pthread_t, __t2: __pthread_t) -> ::c_int;
+
+    pub fn pthread_getattr_np(__thr: ::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 ::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 ::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 ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::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 ::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_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+
+    pub fn pthread_sigmask(
+        __how: ::c_int,
+        __newmask: *const __sigset_t,
+        __oldmask: *mut __sigset_t,
+    ) -> ::c_int;
+
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::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 ::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 ::timespec) -> ::c_int;
+    pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(__clock_id: clockid_t, __tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+
+    pub fn asctime_r(tm: *const ::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 ::tm,
+    ) -> ::size_t;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *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, curr_value: *mut ::itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::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 ::FILE;
+    pub fn freopen64(
+        filename: *const c_char,
+        mode: *const c_char,
+        file: *mut ::FILE,
+    ) -> *mut ::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 ::FILE;
+
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::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 ::winsize,
+    ) -> ::c_int;
+
+    pub fn forkpty(
+        __amaster: *mut ::c_int,
+        __name: *mut ::c_char,
+        __termp: *const termios,
+        __winp: *const ::winsize,
+    ) -> ::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;
+    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 ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::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 ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::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: ::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 ::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 ::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 ::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 ::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 ::DIR) -> *mut ::dirent;
+    pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
+    pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+        -> ::c_int;
+    pub fn readdir64_r(
+        dirp: *mut ::DIR,
+        entry: *mut ::dirent64,
+        result: *mut *mut ::dirent64,
+    ) -> ::c_int;
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+
+    pub fn dirfd(dirp: *mut ::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: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+    pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+    pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+
+    pub fn getpriority(which: ::__priority_which, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::__priority_which, who: ::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<
+            unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::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() -> ::mallinfo;
+    pub fn mallinfo2() -> ::mallinfo2;
+    pub fn malloc_info(options: ::c_int, stream: *mut ::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 ::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 glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn glob64(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::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 ::Dl_info,
+        extra_info: *mut *mut ::c_void,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+
+    pub fn dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut ::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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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 & ::IPTOS_ECN_MASK
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else {
+        mod b32;
+        pub use self::b32::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/hurd/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/no_align.rs
new file mode 100644
index 00000000000..1dd7d8e541d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/hurd/no_align.rs
@@ -0,0 +1 @@
+// Placeholder file
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/arm.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/arm.rs
new file mode 100644
index 00000000000..a062175eef7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/arm.rs
@@ -0,0 +1,550 @@
+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,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub struct __c_anonymous_uc_sigmask_with_padding {
+                pub uc_sigmask: ::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: ::sigset64_t,
+            }
+
+            pub struct ucontext_t {
+                pub uc_flags: ::c_ulong,
+                pub uc_link: *mut ucontext_t,
+                pub uc_stack: ::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<H: ::hash::Hasher>(&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 ::fmt::Debug for __c_anonymous_uc_sigmask {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask")
+                            .field("uc_sigmask", unsafe { &self.uc_sigmask })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask {
+                    fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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;
+
+// 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;
+
+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 ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int
+    ) -> ::c_int {
+        ::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/mod.rs
new file mode 100644
index 00000000000..1f4f796f2a9
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/mod.rs
@@ -0,0 +1,244 @@
+// 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;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    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: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        __pad3: [::c_uchar; 4],
+        pub st_size: ::c_longlong,
+        pub st_blksize: ::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: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        __pad3: [::c_uchar; 4],
+        pub st_size: ::c_longlong,
+        pub st_blksize: ::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: ::__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: ::uid_t,
+        pub pw_gid: ::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: ::__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 ::tm) -> ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs
new file mode 100644
index 00000000000..04df4a05d19
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f64; 2]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
new file mode 100644
index 00000000000..e549f3b5168
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs
@@ -0,0 +1,622 @@
+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,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub struct __c_anonymous_uc_sigmask_with_padding {
+                pub uc_sigmask: ::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: ::sigset64_t,
+            }
+
+            pub struct ucontext_t {
+                pub uc_flags: ::c_ulong,
+                pub uc_link: *mut ucontext_t,
+                pub uc_stack: ::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,
+            }
+        }
+
+        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<H: ::hash::Hasher>(&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 ::fmt::Debug for __c_anonymous_uc_sigmask {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask")
+                            .field("uc_sigmask", unsafe { &self.uc_sigmask })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask {
+                    fn hash<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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;
+
+// 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;
+
+// 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 ::sockaddr,
+        len: *mut ::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,
+        ];
+        ::syscall(SYS_socketcall, SYS_ACCEPT4, args[..].as_mut_ptr())
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs
new file mode 100644
index 00000000000..154c2c54ce6
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs
@@ -0,0 +1,29 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::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,
+        // nested arrays to get the right size/length while being able to
+        // auto-derive traits like Debug
+        __reserved: [[u64; 32]; 16],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs
new file mode 100644
index 00000000000..4535e73eedd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+    pub struct user_fpsimd_struct {
+        pub vregs: [::__uint128_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
new file mode 100644
index 00000000000..ac67fddabec
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -0,0 +1,430 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::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: ::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,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::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: ::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,
+        __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 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_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_syscalls: ::c_long = 436;
+
+pub const PROT_BTI: ::c_int = 0x10;
+pub const PROT_MTE: ::c_int = 0x20;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_int128)] {
+        mod int128;
+        pub use self::int128::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/mod.rs
new file mode 100644
index 00000000000..67d0dacf17e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/mod.rs
@@ -0,0 +1,355 @@
+// 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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    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: ::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 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: ::__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: ::__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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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;
+
+// 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_EXECFN: ::c_ulong = 31;
+
+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 ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int
+    ) -> ::c_int {
+        ::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 ::prop_info,
+        __old_serial: u32,
+        __new_serial_ptr: *mut u32,
+        __relative_timeout: *const ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs
new file mode 100644
index 00000000000..8e949963a63
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
new file mode 100644
index 00000000000..9d414dc15fb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs
@@ -0,0 +1,353 @@
+pub type c_char = i8;
+pub type wchar_t = u32;
+pub type greg_t = i64;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::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: ::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,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::c_uint,
+        pub st_nlink: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::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: ::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,
+        __unused4: ::c_uint,
+        __unused5: ::c_uint,
+    }
+}
+
+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_syscalls: ::c_long = 436;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs
new file mode 100644
index 00000000000..7ca870fd02b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
new file mode 100644
index 00000000000..be6b5011c21
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs
@@ -0,0 +1,802 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type greg_t = i64;
+pub type __u64 = ::c_ulonglong;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::c_ulong,
+        pub st_mode: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::c_ulong,
+        pub st_mode: ::c_uint,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::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,
+    }
+
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            pub union __c_anonymous_uc_sigmask {
+                uc_sigmask: ::sigset_t,
+                uc_sigmask64: ::sigset64_t,
+            }
+        }
+
+        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 ::fmt::Debug for __c_anonymous_uc_sigmask {
+                    fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                        f.debug_struct("uc_sigmask")
+                            .field("uc_sigmask", unsafe { &self.uc_sigmask })
+                            .finish()
+                    }
+                }
+                impl ::hash::Hash for __c_anonymous_uc_sigmask {
+                    fn hash<H: ::hash::Hasher>(&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: ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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;
+
+// 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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/mod.rs
new file mode 100644
index 00000000000..94c4eace855
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/android/mod.rs
@@ -0,0 +1,4143 @@
+//! Android-specific definitions for linux-like values
+
+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;
+
+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: ::socklen_t,
+        pub msg_iov: *mut ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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: ::pid_t,
+    }
+
+    pub struct flock64 {
+        pub l_type: ::c_short,
+        pub l_whence: ::c_short,
+        pub l_start: ::__kernel_loff_t,
+        pub l_len: ::__kernel_loff_t,
+        pub l_pid: ::__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: ::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,
+        #[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: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::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: ::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: ::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: ::__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: ::__u64,
+        pub args: [::__u64; 6],
+    }
+
+    pub struct seccomp_metadata {
+        pub filter_off: ::__u64,
+        pub flags: ::__u64,
+    }
+
+    pub struct ptrace_peeksiginfo_args {
+        pub off: ::__u64,
+        pub flags: ::__u32,
+        pub nr: ::__s32,
+    }
+
+    // linux/input.h
+    pub struct input_event {
+        pub time: ::timeval,
+        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: ::__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 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: ::__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 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: ::in6_addr,
+       pub ifr6_prefixlen: u32,
+       pub ifr6_ifindex: ::c_int,
+   }
+
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_nl {
+        pub nl_family: ::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: ::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: ::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: ::timeval,
+        pub ut_addr_v6: [i32; 4],
+        unused: [::c_char; 20],
+    }
+
+    pub struct sockaddr_alg {
+        pub salg_family: ::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],
+    }
+
+    pub struct prop_info {
+        __name: [::c_char; 32],
+        __serial: ::c_uint,
+        __value: [[::c_char; 4]; 23],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_netmask: ::sockaddr,
+        pub ifru_hwaddr: ::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; ::IFNAMSIZ],
+        pub ifru_newname: [::c_char; ::IFNAMSIZ],
+        pub ifru_data: *mut ::c_char,
+    }
+
+    pub struct ifreq {
+        /// interface name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_char,
+        pub ifcu_req: *mut ::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.  */
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ::ifreq,
+    }
+
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_netmask", unsafe { &self.ifru_netmask })
+                    .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_ifindex", unsafe { &self.ifru_ifindex })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_map", unsafe { &self.ifru_map })
+                    .field("ifru_slave", unsafe { &self.ifru_slave })
+                    .field("ifru_newname", unsafe { &self.ifru_newname })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .finish()
+            }
+        }
+        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()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .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<H: ::hash::Hasher>(&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: ::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 = 0;
+pub const _SC_BC_BASE_MAX: ::c_int = 1;
+pub const _SC_BC_DIM_MAX: ::c_int = 2;
+pub const _SC_BC_SCALE_MAX: ::c_int = 3;
+pub const _SC_BC_STRING_MAX: ::c_int = 4;
+pub const _SC_CHILD_MAX: ::c_int = 5;
+pub const _SC_CLK_TCK: ::c_int = 6;
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 7;
+pub const _SC_EXPR_NEST_MAX: ::c_int = 8;
+pub const _SC_LINE_MAX: ::c_int = 9;
+pub const _SC_NGROUPS_MAX: ::c_int = 10;
+pub const _SC_OPEN_MAX: ::c_int = 11;
+pub const _SC_PASS_MAX: ::c_int = 12;
+pub const _SC_2_C_BIND: ::c_int = 13;
+pub const _SC_2_C_DEV: ::c_int = 14;
+pub const _SC_2_C_VERSION: ::c_int = 15;
+pub const _SC_2_CHAR_TERM: ::c_int = 16;
+pub const _SC_2_FORT_DEV: ::c_int = 17;
+pub const _SC_2_FORT_RUN: ::c_int = 18;
+pub const _SC_2_LOCALEDEF: ::c_int = 19;
+pub const _SC_2_SW_DEV: ::c_int = 20;
+pub const _SC_2_UPE: ::c_int = 21;
+pub const _SC_2_VERSION: ::c_int = 22;
+pub const _SC_JOB_CONTROL: ::c_int = 23;
+pub const _SC_SAVED_IDS: ::c_int = 24;
+pub const _SC_VERSION: ::c_int = 25;
+pub const _SC_RE_DUP_MAX: ::c_int = 26;
+pub const _SC_STREAM_MAX: ::c_int = 27;
+pub const _SC_TZNAME_MAX: ::c_int = 28;
+pub const _SC_XOPEN_CRYPT: ::c_int = 29;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 30;
+pub const _SC_XOPEN_SHM: ::c_int = 31;
+pub const _SC_XOPEN_VERSION: ::c_int = 32;
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 33;
+pub const _SC_XOPEN_REALTIME: ::c_int = 34;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 35;
+pub const _SC_XOPEN_LEGACY: ::c_int = 36;
+pub const _SC_ATEXIT_MAX: ::c_int = 37;
+pub const _SC_IOV_MAX: ::c_int = 38;
+pub const _SC_PAGESIZE: ::c_int = 39;
+pub const _SC_PAGE_SIZE: ::c_int = 40;
+pub const _SC_XOPEN_UNIX: ::c_int = 41;
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 42;
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 43;
+pub const _SC_XBS5_LP64_OFF64: ::c_int = 44;
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 45;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 46;
+pub const _SC_AIO_MAX: ::c_int = 47;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 48;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 49;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 50;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 51;
+pub const _SC_RTSIG_MAX: ::c_int = 52;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 53;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 54;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 55;
+pub const _SC_TIMER_MAX: ::c_int = 56;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 57;
+pub const _SC_FSYNC: ::c_int = 58;
+pub const _SC_MAPPED_FILES: ::c_int = 59;
+pub const _SC_MEMLOCK: ::c_int = 60;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 61;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 62;
+pub const _SC_MESSAGE_PASSING: ::c_int = 63;
+pub const _SC_PRIORITIZED_IO: ::c_int = 64;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 65;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 66;
+pub const _SC_SEMAPHORES: ::c_int = 67;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 69;
+pub const _SC_TIMERS: ::c_int = 70;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 71;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 72;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 74;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 75;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 76;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 77;
+pub const _SC_TTY_NAME_MAX: ::c_int = 78;
+pub const _SC_THREADS: ::c_int = 79;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 80;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 81;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 82;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 83;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 84;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 85;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 96;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 97;
+pub const _SC_PHYS_PAGES: ::c_int = 98;
+pub const _SC_AVPHYS_PAGES: ::c_int = 99;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 100;
+
+pub const _SC_2_PBS: ::c_int = 101;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 102;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 103;
+pub const _SC_2_PBS_LOCATE: ::c_int = 104;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 105;
+pub const _SC_2_PBS_TRACK: ::c_int = 106;
+pub const _SC_ADVISORY_INFO: ::c_int = 107;
+pub const _SC_BARRIERS: ::c_int = 108;
+pub const _SC_CLOCK_SELECTION: ::c_int = 109;
+pub const _SC_CPUTIME: ::c_int = 110;
+pub const _SC_HOST_NAME_MAX: ::c_int = 111;
+pub const _SC_IPV6: ::c_int = 112;
+pub const _SC_RAW_SOCKETS: ::c_int = 113;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 114;
+pub const _SC_REGEXP: ::c_int = 115;
+pub const _SC_SHELL: ::c_int = 116;
+pub const _SC_SPAWN: ::c_int = 117;
+pub const _SC_SPIN_LOCKS: ::c_int = 118;
+pub const _SC_SPORADIC_SERVER: ::c_int = 119;
+pub const _SC_SS_REPL_MAX: ::c_int = 120;
+pub const _SC_SYMLOOP_MAX: ::c_int = 121;
+pub const _SC_THREAD_CPUTIME: ::c_int = 122;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 123;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 124;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 125;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 126;
+pub const _SC_TIMEOUTS: ::c_int = 127;
+pub const _SC_TRACE: ::c_int = 128;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 129;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 130;
+pub const _SC_TRACE_INHERIT: ::c_int = 131;
+pub const _SC_TRACE_LOG: ::c_int = 132;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 133;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 134;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 135;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 136;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 137;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 138;
+pub const _SC_V7_LP64_OFF64: ::c_int = 139;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 140;
+pub const _SC_XOPEN_STREAMS: ::c_int = 141;
+pub const _SC_XOPEN_UUCP: ::c_int = 142;
+
+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_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 = ::LC_CTYPE_MASK
+    | ::LC_NUMERIC_MASK
+    | ::LC_TIME_MASK
+    | ::LC_COLLATE_MASK
+    | ::LC_MONETARY_MASK
+    | ::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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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: ::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 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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const BOTHER: ::speed_t = 0o010000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const IBSHIFT: ::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: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::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: ::tcflag_t = 0x00004000;
+pub const CMSPAR: ::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_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_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+
+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_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 = ::INT_MIN;
+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 = ::INT_MAX;
+pub const NF_IP_PRI_LAST: ::c_int = ::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 = ::INT_MIN;
+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 = ::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_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 = 0x0f;
+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;
+
+// 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 = ::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_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;
+
+// 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;
+
+// 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::<cpu_set_t>(), cpuset)
+    }
+
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
+        set1.__bits == set2.__bits
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_int {
+        ((dev >> 8) & 0xfff) as ::c_int
+    }
+    pub fn minor(dev: ::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 ::sock_extended_err) -> *mut ::sockaddr {
+        ee.offset(1) as *mut ::sockaddr
+    }
+}
+
+safe_f! {
+    pub {const} fn makedev(ma: ::c_uint, mi: ::c_uint) -> ::dev_t {
+        let ma = ma as ::dev_t;
+        let mi = mi as ::dev_t;
+        ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
+    }
+
+}
+
+extern "C" {
+    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 ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn prlimit(
+        pid: ::pid_t,
+        resource: ::c_int,
+        new_limit: *const ::rlimit,
+        old_limit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn prlimit64(
+        pid: ::pid_t,
+        resource: ::c_int,
+        new_limit: *const ::rlimit64,
+        old_limit: *mut ::rlimit64,
+    ) -> ::c_int;
+    pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::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 ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn getnameinfo(
+        sa: *const ::sockaddr,
+        salen: ::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 ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn process_vm_readv(
+        pid: ::pid_t,
+        local_iov: *const ::iovec,
+        local_iov_count: ::c_ulong,
+        remote_iov: *const ::iovec,
+        remote_iov_count: ::c_ulong,
+        flags: ::c_ulong,
+    ) -> ::ssize_t;
+    pub fn process_vm_writev(
+        pid: ::pid_t,
+        local_iov: *const ::iovec,
+        local_iov_count: ::c_ulong,
+        remote_iov: *const ::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: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t;
+    pub fn __sched_cpufree(set: *mut ::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() -> ::mallinfo;
+    // available from API 23
+    pub fn malloc_info(options: ::c_int, stream: *mut ::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 ::DIR, loc: ::c_long);
+    pub fn telldir(dirp: *mut ::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 ::sigset_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_create(clock: ::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: ::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;
+    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 ::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 ::epoll_event)
+        -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::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 ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn splice(
+        fd_in: ::c_int,
+        off_in: *mut ::loff_t,
+        fd_out: ::c_int,
+        off_out: *mut ::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: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::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 ::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: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::timespec,
+        sigmask: *const sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::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 ::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 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: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::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 ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getinheritsched(
+        attr: *const ::pthread_attr_t,
+        flag: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_setinheritsched(attr: *mut ::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 ::sysinfo) -> ::c_int;
+    pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::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: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group;
+    pub fn pthread_kill(thread: ::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: ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::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 ::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 ::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 __errno() -> *mut ::c_int;
+    pub fn inotify_rm_watch(fd: ::c_int, wd: u32) -> ::c_int;
+    pub fn sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *const ::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: *const ::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 ::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 android_set_abort_message(msg: *const ::c_char);
+
+    pub fn gettid() -> ::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: ::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 <link.h>
+    /// 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: ::pthread_t, clk_id: *mut ::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 ::FILE,
+    ) -> ::size_t;
+    pub fn fwrite_unlocked(
+        buf: *const ::c_void,
+        size: ::size_t,
+        nobj: ::size_t,
+        stream: *mut ::FILE,
+    ) -> ::size_t;
+    pub fn fflush_unlocked(stream: *mut ::FILE) -> ::c_int;
+    pub fn fgets_unlocked(buf: *mut ::c_char, size: ::c_int, stream: *mut ::FILE) -> *mut ::c_char;
+}
+
+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) -> ::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: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        struct sifields_sigchld {
+            si_pid: ::pid_t,
+            si_uid: ::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) -> ::pid_t {
+                self.sifields().sigchld.si_pid
+            }
+
+            pub unsafe fn si_uid(&self) -> ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/align.rs
new file mode 100644
index 00000000000..b9ea3f39efd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/align.rs
@@ -0,0 +1,74 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[allow(missing_debug_implementations)]
+            #[repr(align(4))]
+            pub struct pthread_mutex_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_rwlock_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_mutexattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_rwlockattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            #[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; ::__SIZEOF_PTHREAD_COND_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 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<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/lfs64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/lfs64.rs
new file mode 100644
index 00000000000..1616cc90494
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/lfs64.rs
@@ -0,0 +1,213 @@
+// 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: ::mode_t) -> ::c_int {
+    ::creat(path, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
+    ::fgetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
+    ::fopen(pathname, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn freopen64(
+    pathname: *const ::c_char,
+    mode: *const ::c_char,
+    stream: *mut ::FILE,
+) -> *mut ::FILE {
+    ::freopen(pathname, mode, stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn fseeko64(
+    stream: *mut ::FILE,
+    offset: ::off64_t,
+    whence: ::c_int,
+) -> ::c_int {
+    ::fseeko(stream, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
+    ::fsetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
+    ::fstat(fildes, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatat64(
+    fd: ::c_int,
+    path: *const ::c_char,
+    buf: *mut ::stat64,
+    flag: ::c_int,
+) -> ::c_int {
+    ::fstatat(fd, path, buf as *mut _, flag)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
+    ::fstatfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
+    ::fstatvfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
+    ::ftello(stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
+    ::ftruncate(fd, length)
+}
+
+#[inline]
+pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
+    ::getrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
+    ::lseek(fd, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
+    ::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 {
+    ::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 open as open64;
+pub use 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 {
+    ::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 {
+    ::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 {
+    ::pread(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn preadv64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::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 {
+    ::pwrite(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn pwritev64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pwritev(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
+    ::readdir(dirp) as *mut _
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64_r(
+    dirp: *mut ::DIR,
+    entry: *mut ::dirent64,
+    result: *mut *mut ::dirent64,
+) -> ::c_int {
+    ::readdir_r(dirp, entry as *mut _, result as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
+    ::setrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
+    ::stat(pathname, statbuf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
+    ::statfs(pathname, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
+    ::statvfs(path, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
+    ::tmpfile()
+}
+
+#[inline]
+pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
+    ::truncate(path, length)
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/mod.rs
new file mode 100644
index 00000000000..1dc607496a2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/mod.rs
@@ -0,0 +1,1794 @@
+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 = c_long;
+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 = ::ino_t;
+pub type off64_t = ::off_t;
+pub type blkcnt64_t = ::blkcnt_t;
+pub type rlim64_t = ::rlim_t;
+
+pub type rlimit64 = ::rlimit;
+pub type flock64 = ::flock;
+pub type stat64 = ::stat;
+pub type statfs64 = ::statfs;
+pub type statvfs64 = ::statvfs;
+pub type dirent64 = ::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: ::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 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,
+        __f_unused: ::c_int,
+        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 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 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: ::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,
+        __dummy4: [::c_char; 24],
+    }
+
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    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_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub __c_ispeed: ::speed_t,
+        pub __c_ospeed: ::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: ::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: ::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,
+    }
+
+    pub struct sem_t {
+        __val: [::c_int; 4],
+    }
+    pub struct stat {
+        pub st_dev: ::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: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        #[cfg(not(emscripten_new_stat_abi))]
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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_ino: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_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; ::MAX_ADDR_LEN],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct dirent {
+        pub d_ino: ::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_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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_flags.hash(state);
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_curmsgs.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: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::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: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::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 = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+
+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;
+
+align_const! {
+    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: ::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 QFMT_VFS_OLD: ::c_int = 1;
+pub const QFMT_VFS_V0: ::c_int = 2;
+
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
+
+pub const LOG_NFACILITIES: ::c_int = 24;
+
+pub const SEM_FAILED: *mut ::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 _POSIX_VDISABLE: ::cc_t = 0;
+
+pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
+pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
+
+// 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 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;
+
+// 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 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 = 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: ::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 = 0;
+
+pub const RLIM_INFINITY: ::rlim_t = !0;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIMIT_NLIMITS: ::c_int = 15;
+#[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 = ::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 QFMT_VFS_V1: ::c_int = 4;
+
+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_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_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_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 EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+
+pub const SFD_NONBLOCK: ::c_int = ::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 = ::FIONREAD;
+
+pub const RTLD_GLOBAL: ::c_int = 0x100;
+pub const RTLD_NOLOAD: ::c_int = 0x4;
+
+pub const CLOCK_SGI_CYCLE: ::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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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 __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 28;
+
+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 = 256;
+
+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 = 20;
+pub const SO_SNDTIMEO: ::c_int = 21;
+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: ::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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::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 = 0x400000;
+
+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::<cmsghdr>() {
+            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: ::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: ::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) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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 ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::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 ::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 ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::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 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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+    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 getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
+
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::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<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::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 ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::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 ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+    pub fn nl_langinfo(item: ::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 ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn sync();
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::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 getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+}
+
+// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
+mod lfs64;
+pub use self::lfs64::*;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/no_align.rs
new file mode 100644
index 00000000000..768dc73a434
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/emscripten/no_align.rs
@@ -0,0 +1,63 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutex_t {
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_mutexattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_rwlockattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+
+        s_no_extra_traits! {
+            pub struct pthread_cond_t {
+                __align: [*const ::c_void; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+        }
+
+        cfg_if! {
+            if #[cfg(feature = "extra_traits")] {
+                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<H: ::hash::Hasher>(&self, state: &mut H) {
+                        self.size.hash(state);
+                    }
+                }
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/align.rs
new file mode 100644
index 00000000000..1036e23dc8f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/align.rs
@@ -0,0 +1,205 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[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; ::__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; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                #[doc(hidden)]
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_barrierattr_t {
+                #[doc(hidden)]
+                size: [u8; ::__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,
+            }
+        }
+
+        s_no_extra_traits! {
+            #[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; ::__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; ::__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; ::__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; ::__SIZEOF_PTHREAD_BARRIER_T],
+            }
+
+            // linux/can.h
+            #[repr(align(8))]
+            #[allow(missing_debug_implementations)]
+            pub struct can_frame {
+                pub can_id: canid_t,
+                pub can_dlc: u8,
+                __pad: u8,
+                __res0: u8,
+                __res1: 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],
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
new file mode 100644
index 00000000000..b8e459631e4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -0,0 +1,329 @@
+s! {
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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_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;
+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_TIMESTAMP: ::c_int = 29;
+// pub const SO_TIMESTAMP_OLD: ::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_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;
+
+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: ::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;
+    } else if #[cfg(any(target_arch = "x86_64", target_arch = "riscv64", target_arch = "aarch64", target_arch = "s390x"))] {
+        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;
+    }
+}
+
+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: ::speed_t = 0o010000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+    if #[cfg(any(target_env = "gnu",
+                 target_env = "uclibc"))] {
+
+        pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+        pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+        pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+        pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+        pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+        pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+        pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+        pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+        pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+        pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+        pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+        pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+        pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+        pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+        pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+        pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::__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")]
+        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;
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_env = "gnu")] {
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__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: ::__rlimit_resource_t = 15;
+    }
+}
+
+pub const RLIM_INFINITY: ::rlim_t = !0;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs
new file mode 100644
index 00000000000..7699677026f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs
@@ -0,0 +1,323 @@
+s! {
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 23],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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
+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
+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;
+
+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 = "mips")] {
+        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;
+    } else if #[cfg(target_arch = "mips64")] {
+        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;
+    }
+}
+
+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: ::speed_t = 0o010000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+    if #[cfg(any(target_env = "gnu",
+                 target_env = "uclibc"))] {
+
+        pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+        pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+        pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+        pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+        pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+        pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5;
+        pub const RLIMIT_AS: ::__rlimit_resource_t = 6;
+        pub const RLIMIT_RSS: ::__rlimit_resource_t = 7;
+        pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8;
+        pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9;
+        pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+        pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+        pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+        pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+        pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+        pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::__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: ::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: ::__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: ::__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: ::rlim_t = !0;
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"),
+         any(target_env = "gnu",
+             target_env = "uclibc"))] {
+        pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mod.rs
new file mode 100644
index 00000000000..7f6ddc5a764
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/mod.rs
@@ -0,0 +1,18 @@
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs
new file mode 100644
index 00000000000..27834dbfeab
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs
@@ -0,0 +1,277 @@
+// 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;
+pub const SO_RCVTIMEO: ::c_int = 18;
+pub const SO_SNDTIMEO: ::c_int = 19;
+// 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;
+pub const SO_TIMESTAMP: ::c_int = 29;
+// pub const SO_TIMESTAMP_OLD: ::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_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;
+
+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;
+    } 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 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: ::speed_t = 0o0037;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+cfg_if! {
+    if #[cfg(target_env = "gnu")] {
+
+        pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+        pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+        pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+        pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+        pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+        pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+        pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
+        pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+        pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+        pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+        pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+        pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+        pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+        pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+        pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+        pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+        #[allow(deprecated)]
+        #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+        pub const RLIMIT_NLIMITS: ::__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: ::rlim_t = !0;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs
new file mode 100644
index 00000000000..fce466c7789
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs
@@ -0,0 +1,259 @@
+s! {
+    pub struct termios2 {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; 19],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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;
+
+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: ::speed_t = 0x1000;
+pub const IBSHIFT: ::tcflag_t = 16;
+
+// RLIMIT Constants
+
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
+pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
+pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
+#[allow(deprecated)]
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
+pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
+
+cfg_if! {
+    if #[cfg(target_arch = "sparc64")] {
+        pub const RLIM_INFINITY: ::rlim_t = !0;
+    } else if #[cfg(target_arch = "sparc")] {
+        pub const RLIM_INFINITY: ::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;
+    } 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;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/align.rs
new file mode 100644
index 00000000000..4a0e07460eb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/align.rs
@@ -0,0 +1,13 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs
new file mode 100644
index 00000000000..2645ec4c3d4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs
@@ -0,0 +1,53 @@
+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: ::stack_t,
+        pub uc_mcontext: ::mcontext_t,
+        pub uc_sigmask: ::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<H: ::hash::Hasher>(&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);
+            }
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
new file mode 100644
index 00000000000..89c93aba881
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -0,0 +1,864 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::dev_t,
+        __pad1: ::c_uint,
+        __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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,
+    }
+}
+
+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;
+
+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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs
new file mode 100644
index 00000000000..825546be90a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [i64; 2]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
new file mode 100644
index 00000000000..5e92e30073b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
@@ -0,0 +1,741 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::dev_t,
+        __pad1: ::c_uint,
+        __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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 = 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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs
new file mode 100644
index 00000000000..639394a309e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(2))]
+    pub struct max_align_t {
+        priv_: [i8; 20]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
new file mode 100644
index 00000000000..8ca7d3d2140
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
@@ -0,0 +1,850 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        f_spare: [::__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: ::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: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __glibc_reserved1: ::c_ulong,
+        __glibc_reserved2: ::c_ulong,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: ::c_ushort,
+        pub __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_ulong,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_ulong,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_ulong,
+        pub st_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::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_favail: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __glibc_reserved1: ::c_long,
+        pub shm_dtime: ::time_t,
+        __glibc_reserved2: ::c_long,
+        pub shm_ctime: ::time_t,
+        __glibc_reserved3: ::c_long,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __glibc_reserved5: ::c_ulong,
+        __glibc_reserved6: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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
+    }
+}
+
+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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs
new file mode 100644
index 00000000000..8c228ebab72
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f32; 4]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
new file mode 100644
index 00000000000..fa2707500db
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs
@@ -0,0 +1,819 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 3],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_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_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        pub f_frsize: ::c_long,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::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: u64,
+        pub f_bfree: u64,
+        pub f_files: u64,
+        pub f_ffree: u64,
+        pub f_bavail: u64,
+        pub f_fsid: ::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,
+        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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_restorer: ::Option<extern fn()>,
+        _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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved1: ::c_ulong,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved1: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved2: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved2: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved3: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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: ::pid_t,
+        pad: [::c_long; 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: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const EXTPROC: ::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;
+
+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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EHWPOISON: ::c_int = 168;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
new file mode 100644
index 00000000000..d5b11347eb8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
@@ -0,0 +1,361 @@
+//! 32-bit specific definitions for linux-like values
+
+use 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;
+
+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 {
+        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;
+    }
+}
+
+s! {
+    pub struct stat {
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_dev: ::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: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_rdev: ::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: ::blksize_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
+        pub st_blocks: ::blkcnt_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,
+        #[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: ::blksize_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        pub st_blocks: ::blkcnt_t,
+        #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
+        st_pad5: [::c_long; 14],
+    }
+
+    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,
+        __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(target_arch = "powerpc")]
+        __reserved: ::__syscall_ulong_t,
+        pub sem_otime: ::time_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc")))]
+        __reserved: ::__syscall_ulong_t,
+        #[cfg(target_arch = "powerpc")]
+        __reserved2: ::__syscall_ulong_t,
+        pub sem_ctime: ::time_t,
+        #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc")))]
+        __reserved2: ::__syscall_ulong_t,
+        pub sem_nsems: ::__syscall_ulong_t,
+        __glibc_reserved3: ::__syscall_ulong_t,
+        __glibc_reserved4: ::__syscall_ulong_t,
+    }
+}
+
+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_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;
+
+        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_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 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;
+    }
+}
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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_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
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs
new file mode 100644
index 00000000000..dd5732e0dcc
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs
@@ -0,0 +1,825 @@
+pub type c_char = u8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::pid_t,
+    }
+
+    pub struct ipc_perm {
+        __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        __seq: u32,
+        __pad1: u32,
+        __glibc_reserved1: u64,
+        __glibc_reserved2: u64,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__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: ::ipc_perm,
+        __glibc_reserved1: ::c_uint,
+        pub shm_atime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub shm_dtime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        pub shm_ctime: ::time_t,
+        __glibc_reserved4: ::c_uint,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __glibc_reserved5: ::c_ulong,
+        __glibc_reserved6: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __glibc_reserved1: ::c_uint,
+        pub msg_stime: ::time_t,
+        __glibc_reserved2: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved3: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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;
+
+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: ::tcflag_t = 0xff;
+pub const TAB1: ::tcflag_t = 0x400;
+pub const TAB2: ::tcflag_t = 0x800;
+pub const TAB3: ::tcflag_t = 0xc00;
+pub const CR1: ::tcflag_t = 0x1000;
+pub const CR2: ::tcflag_t = 0x2000;
+pub const CR3: ::tcflag_t = 0x3000;
+pub const FF1: ::tcflag_t = 0x4000;
+pub const BS1: ::tcflag_t = 0x8000;
+pub const VT1: ::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: ::tcflag_t = 0x200;
+pub const IXOFF: ::tcflag_t = 0x400;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const CSIZE: ::tcflag_t = 0x300;
+pub const CS6: ::tcflag_t = 0x100;
+pub const CS7: ::tcflag_t = 0x200;
+pub const CS8: ::tcflag_t = 0x300;
+pub const CSTOPB: ::tcflag_t = 0x400;
+pub const CREAD: ::tcflag_t = 0x800;
+pub const PARENB: ::tcflag_t = 0x1000;
+pub const PARODD: ::tcflag_t = 0x2000;
+pub const HUPCL: ::tcflag_t = 0x4000;
+pub const CLOCAL: ::tcflag_t = 0x8000;
+pub const ECHOKE: ::tcflag_t = 0x1;
+pub const ECHOE: ::tcflag_t = 0x2;
+pub const ECHOK: ::tcflag_t = 0x4;
+pub const ECHONL: ::tcflag_t = 0x10;
+pub const ECHOPRT: ::tcflag_t = 0x20;
+pub const ECHOCTL: ::tcflag_t = 0x40;
+pub const ISIG: ::tcflag_t = 0x80;
+pub const ICANON: ::tcflag_t = 0x100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o001400;
+pub const CRDLY: ::tcflag_t = 0o030000;
+pub const TABDLY: ::tcflag_t = 0o006000;
+pub const BSDLY: ::tcflag_t = 0o100000;
+pub const FFDLY: ::tcflag_t = 0o040000;
+pub const VTDLY: ::tcflag_t = 0o200000;
+pub const XTABS: ::tcflag_t = 0o006000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const CBAUDEX: ::speed_t = 0o000020;
+pub const B57600: ::speed_t = 0o0020;
+pub const B115200: ::speed_t = 0o0021;
+pub const B230400: ::speed_t = 0o0022;
+pub const B460800: ::speed_t = 0o0023;
+pub const B500000: ::speed_t = 0o0024;
+pub const B576000: ::speed_t = 0o0025;
+pub const B921600: ::speed_t = 0o0026;
+pub const B1000000: ::speed_t = 0o0027;
+pub const B1152000: ::speed_t = 0o0030;
+pub const B1500000: ::speed_t = 0o0031;
+pub const B2000000: ::speed_t = 0o0032;
+pub const B2500000: ::speed_t = 0o0033;
+pub const B3000000: ::speed_t = 0o0034;
+pub const B3500000: ::speed_t = 0o0035;
+pub const B4000000: ::speed_t = 0o0036;
+
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x400;
+pub const TOSTOP: ::tcflag_t = 0x400000;
+pub const FLUSHO: ::tcflag_t = 0x800000;
+pub const EXTPROC: ::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;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs
new file mode 100644
index 00000000000..48d152a5721
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs
@@ -0,0 +1,44 @@
+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: ::stack_t,
+        pub uc_sigmask: ::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,
+    }
+
+    #[allow(missing_debug_implementations)]
+    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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
new file mode 100644
index 00000000000..65b7aaa7835
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
@@ -0,0 +1,813 @@
+//! RISC-V-specific definitions for 32-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: ::c_ulong,
+        __glibc_reserved5: ::c_ulong,
+    }
+
+    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: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt64_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        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_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: ::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_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: ::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 __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::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_favail: ::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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::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: ::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: ::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,
+    }
+}
+
+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: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::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: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+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 EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs
new file mode 100644
index 00000000000..98fda883cd3
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [i64; 3]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
new file mode 100644
index 00000000000..da9cf29c486
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
@@ -0,0 +1,857 @@
+//! SPARC-specific definitions for 32-bit linux-like values
+
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::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: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __unused: [::c_long; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_ushort,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __reserved: [::c_long; 2],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    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,
+        __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 ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        __pad1: ::c_uint,
+        pub shm_atime: ::time_t,
+        __pad2: ::c_uint,
+        pub shm_dtime: ::time_t,
+        __pad3: ::c_uint,
+        pub shm_ctime: ::time_t,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __reserved1: ::c_ulong,
+        __reserved2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __pad1: ::c_uint,
+        pub msg_stime: ::time_t,
+        __pad2: ::c_uint,
+        pub msg_rtime: ::time_t,
+        __pad3: ::c_uint,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ushort,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved1: ::c_ulong,
+        __glibc_reserved2: ::c_ulong,
+    }
+}
+
+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: ::tcflag_t = 0x0000100f;
+pub const TAB1: ::tcflag_t = 0x800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::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: ::tcflag_t = 0x400;
+pub const IXOFF: ::tcflag_t = 0x1000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x30;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x40;
+pub const CREAD: ::tcflag_t = 0x80;
+pub const PARENB: ::tcflag_t = 0x100;
+pub const PARODD: ::tcflag_t = 0x200;
+pub const HUPCL: ::tcflag_t = 0x400;
+pub const CLOCAL: ::tcflag_t = 0x800;
+pub const ECHOKE: ::tcflag_t = 0x800;
+pub const ECHOE: ::tcflag_t = 0x10;
+pub const ECHOK: ::tcflag_t = 0x20;
+pub const ECHONL: ::tcflag_t = 0x40;
+pub const ECHOPRT: ::tcflag_t = 0x400;
+pub const ECHOCTL: ::tcflag_t = 0x200;
+pub const ISIG: ::tcflag_t = 0x1;
+pub const ICANON: ::tcflag_t = 0x2;
+pub const PENDIN: ::tcflag_t = 0x4000;
+pub const NOFLSH: ::tcflag_t = 0x80;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0x00001000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0x1001;
+pub const B115200: ::speed_t = 0x1002;
+pub const B230400: ::speed_t = 0x1003;
+pub const B460800: ::speed_t = 0x1004;
+pub const B76800: ::speed_t = 0x1005;
+pub const B153600: ::speed_t = 0x1006;
+pub const B307200: ::speed_t = 0x1007;
+pub const B614400: ::speed_t = 0x1008;
+pub const B921600: ::speed_t = 0x1009;
+pub const B500000: ::speed_t = 0x100a;
+pub const B576000: ::speed_t = 0x100b;
+pub const B1000000: ::speed_t = 0x100c;
+pub const B1152000: ::speed_t = 0x100d;
+pub const B1500000: ::speed_t = 0x100e;
+pub const B2000000: ::speed_t = 0x100f;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x8000;
+pub const TOSTOP: ::tcflag_t = 0x100;
+pub const FLUSHO: ::tcflag_t = 0x1000;
+pub const EXTPROC: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs
new file mode 100644
index 00000000000..96634749f53
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 6]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
new file mode 100644
index 00000000000..27f477bb48f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
@@ -0,0 +1,1100 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+pub type greg_t = i32;
+
+s! {
+    pub struct sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::dev_t,
+        __pad1: ::c_uint,
+        __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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_ino: ::ino64_t,
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __glibc_reserved1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __glibc_reserved2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 112],
+        __ssp: [::c_ulong; 4],
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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;
+
+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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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;
+
+// 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;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
new file mode 100644
index 00000000000..a035773c716
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
@@ -0,0 +1,51 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::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,
+        // nested arrays to get the right size/length while being able to
+        // auto-derive traits like Debug
+        __reserved: [[u64; 32]; 16],
+    }
+
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs
new file mode 100644
index 00000000000..398fbb53755
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs
@@ -0,0 +1,8 @@
+s! {
+    #[repr(align(16))]
+    pub struct user_fpsimd_struct {
+        pub vregs: [[u64; 2]; 32],
+        pub fpsr: ::c_uint,
+        pub fpcr: ::c_uint,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
new file mode 100644
index 00000000000..0848fb58801
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs
@@ -0,0 +1,64 @@
+use 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;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
new file mode 100644
index 00000000000..4535e73eedd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+    pub struct user_fpsimd_struct {
+        pub vregs: [::__uint128_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
new file mode 100644
index 00000000000..3802caf644f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs
@@ -0,0 +1,73 @@
+use 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;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
new file mode 100644
index 00000000000..284a1788f44
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -0,0 +1,937 @@
+//! AArch64-specific definitions for 64-bit linux-like values
+
+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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::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: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2],
+    }
+
+    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_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt64_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    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,
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::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 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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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 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;
+}
+
+cfg_if! {
+    if #[cfg(target_pointer_width = "32")] {
+        mod ilp32;
+        pub use self::ilp32::*;
+    } else {
+        mod lp64;
+        pub use self::lp64::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+
+
+}
+
+cfg_if! {
+    if #[cfg(libc_int128)] {
+        mod int128;
+        pub use self::int128::*;
+    } else if #[cfg(libc_align)] {
+        mod fallback;
+        pub use self::fallback::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs
new file mode 100644
index 00000000000..dc191f51fdb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs
@@ -0,0 +1,40 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::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,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
new file mode 100644
index 00000000000..3e1719a76db
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
@@ -0,0 +1,900 @@
+use 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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+        pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__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: ::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: ::pid_t,
+    }
+
+    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,
+        __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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::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 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;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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_CPUCFG: ::c_ulong = 1 << 0;
+pub const HWCAP_LAM: ::c_ulong = 1 << 1;
+pub const HWCAP_UAL: ::c_ulong = 1 << 2;
+pub const HWCAP_FPU: ::c_ulong = 1 << 3;
+pub const HWCAP_LSX: ::c_ulong = 1 << 4;
+pub const HWCAP_LASX: ::c_ulong = 1 << 5;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 6;
+pub const HWCAP_COMPLEX: ::c_ulong = 1 << 7;
+pub const HWCAP_CRYPTO: ::c_ulong = 1 << 8;
+pub const HWCAP_LVZ: ::c_ulong = 1 << 9;
+pub const HWCAP_LBT_X86: ::c_ulong = 1 << 10;
+pub const HWCAP_LBT_ARM: ::c_ulong = 1 << 11;
+pub const HWCAP_LBT_MIPS: ::c_ulong = 1 << 12;
+pub const HWCAP_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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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: ::tcflag_t = 0o0010017;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const IXON: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const XCASE: ::tcflag_t = 0x00000004;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs
new file mode 100644
index 00000000000..7ca870fd02b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
new file mode 100644
index 00000000000..f7b52be805c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
@@ -0,0 +1,934 @@
+use 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: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_ulong; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        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_blksize: ::blksize_t,
+        st_pad4: ::c_long,
+        pub st_blocks: ::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: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::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: ::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: ::pid_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_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_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::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: ::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: ::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,
+        __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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+}
+
+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;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const EXTPROC: ::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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs
new file mode 100644
index 00000000000..ff394e33a21
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs
@@ -0,0 +1,128 @@
+//! 64-bit specific definitions for linux-like values
+
+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(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 = "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: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: u64,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __glibc_reserved4: u64,
+        __glibc_reserved5: u64,
+    }
+
+    pub struct semid_ds {
+        pub sem_perm: ipc_perm,
+        pub sem_otime: ::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: ::__syscall_ulong_t,
+        pub sem_ctime: ::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: ::__syscall_ulong_t,
+        pub sem_nsems: ::__syscall_ulong_t,
+        __glibc_reserved3: ::__syscall_ulong_t,
+        __glibc_reserved4: ::__syscall_ulong_t,
+    }
+}
+
+pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
+
+pub const O_LARGEFILE: ::c_int = 0;
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs
new file mode 100644
index 00000000000..29d1e1c7b8a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [i64; 4]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
new file mode 100644
index 00000000000..3088c25a264
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
@@ -0,0 +1,979 @@
+//! PowerPC64-specific definitions for 64-bit linux-like values
+
+use 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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::pid_t,
+    }
+
+    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_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    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,
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: u32,
+        __pad1: u32,
+        __unused1: u64,
+        __unused2: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::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 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;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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: ::tcflag_t = 0xff;
+pub const TAB1: ::tcflag_t = 0x400;
+pub const TAB2: ::tcflag_t = 0x800;
+pub const TAB3: ::tcflag_t = 0xc00;
+pub const CR1: ::tcflag_t = 0x1000;
+pub const CR2: ::tcflag_t = 0x2000;
+pub const CR3: ::tcflag_t = 0x3000;
+pub const FF1: ::tcflag_t = 0x4000;
+pub const BS1: ::tcflag_t = 0x8000;
+pub const VT1: ::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: ::tcflag_t = 0x200;
+pub const IXOFF: ::tcflag_t = 0x400;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const CSIZE: ::tcflag_t = 0x300;
+pub const CS6: ::tcflag_t = 0x100;
+pub const CS7: ::tcflag_t = 0x200;
+pub const CS8: ::tcflag_t = 0x300;
+pub const CSTOPB: ::tcflag_t = 0x400;
+pub const CREAD: ::tcflag_t = 0x800;
+pub const PARENB: ::tcflag_t = 0x1000;
+pub const PARODD: ::tcflag_t = 0x2000;
+pub const HUPCL: ::tcflag_t = 0x4000;
+pub const CLOCAL: ::tcflag_t = 0x8000;
+pub const ECHOKE: ::tcflag_t = 0x1;
+pub const ECHOE: ::tcflag_t = 0x2;
+pub const ECHOK: ::tcflag_t = 0x4;
+pub const ECHONL: ::tcflag_t = 0x10;
+pub const ECHOPRT: ::tcflag_t = 0x20;
+pub const ECHOCTL: ::tcflag_t = 0x40;
+pub const ISIG: ::tcflag_t = 0x80;
+pub const ICANON: ::tcflag_t = 0x100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o001400;
+pub const CRDLY: ::tcflag_t = 0o030000;
+pub const TABDLY: ::tcflag_t = 0o006000;
+pub const BSDLY: ::tcflag_t = 0o100000;
+pub const FFDLY: ::tcflag_t = 0o040000;
+pub const VTDLY: ::tcflag_t = 0o200000;
+pub const XTABS: ::tcflag_t = 0o006000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const CBAUDEX: ::speed_t = 0o000020;
+pub const B57600: ::speed_t = 0o0020;
+pub const B115200: ::speed_t = 0o0021;
+pub const B230400: ::speed_t = 0o0022;
+pub const B460800: ::speed_t = 0o0023;
+pub const B500000: ::speed_t = 0o0024;
+pub const B576000: ::speed_t = 0o0025;
+pub const B921600: ::speed_t = 0o0026;
+pub const B1000000: ::speed_t = 0o0027;
+pub const B1152000: ::speed_t = 0o0030;
+pub const B1500000: ::speed_t = 0o0031;
+pub const B2000000: ::speed_t = 0o0032;
+pub const B2500000: ::speed_t = 0o0033;
+pub const B3000000: ::speed_t = 0o0034;
+pub const B3500000: ::speed_t = 0o0035;
+pub const B4000000: ::speed_t = 0o0036;
+
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x400;
+pub const TOSTOP: ::tcflag_t = 0x400000;
+pub const FLUSHO: ::tcflag_t = 0x800000;
+pub const EXTPROC: ::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;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs
new file mode 100644
index 00000000000..48d152a5721
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs
@@ -0,0 +1,44 @@
+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: ::stack_t,
+        pub uc_sigmask: ::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,
+    }
+
+    #[allow(missing_debug_implementations)]
+    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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
new file mode 100644
index 00000000000..8e06a135baa
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
@@ -0,0 +1,852 @@
+//! RISC-V-specific definitions for 64-bit linux-like values
+
+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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        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_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: ::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_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: ::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 __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::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_favail: ::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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::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: ::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: ::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,
+    }
+}
+
+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: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::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: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+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 EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
new file mode 100644
index 00000000000..61ee2dcc9b5
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs
@@ -0,0 +1,964 @@
+//! s390x
+
+use 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: ::sighandler_t,
+        __glibc_reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: ::sigset_t,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        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_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: ::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: ::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: ::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,
+        st_pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        __glibc_reserved: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        __glibc_reserved: [::c_long; 3],
+    }
+
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7]
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __pad1: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    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,
+        __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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::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: ::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<H: ::hash::Hasher>(&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;
+
+align_const! {
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const EXTPROC: ::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: ::tcflag_t = 0o000002;
+pub const ONLCR: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const CBAUD: ::speed_t = 0o010017;
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const CSIZE: ::tcflag_t = 0o000060;
+pub const CS6: ::tcflag_t = 0o000020;
+pub const CS7: ::tcflag_t = 0o000040;
+pub const CS8: ::tcflag_t = 0o000060;
+pub const CSTOPB: ::tcflag_t = 0o000100;
+pub const CREAD: ::tcflag_t = 0o000200;
+pub const PARENB: ::tcflag_t = 0o000400;
+pub const PARODD: ::tcflag_t = 0o001000;
+pub const HUPCL: ::tcflag_t = 0o002000;
+pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+
+pub const ISIG: ::tcflag_t = 0o000001;
+pub const ICANON: ::tcflag_t = 0o000002;
+pub const XCASE: ::tcflag_t = 0o000004;
+pub const ECHOE: ::tcflag_t = 0o000020;
+pub const ECHOK: ::tcflag_t = 0o000040;
+pub const ECHONL: ::tcflag_t = 0o000100;
+pub const NOFLSH: ::tcflag_t = 0o000200;
+pub const ECHOCTL: ::tcflag_t = 0o001000;
+pub const ECHOPRT: ::tcflag_t = 0o002000;
+pub const ECHOKE: ::tcflag_t = 0o004000;
+pub const PENDIN: ::tcflag_t = 0o040000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const IXON: ::tcflag_t = 0o002000;
+pub const IXOFF: ::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;
+
+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;
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs
new file mode 100644
index 00000000000..29d1e1c7b8a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [i64; 4]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
new file mode 100644
index 00000000000..de2f0d6e470
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
@@ -0,0 +1,931 @@
+//! SPARC64-specific definitions for 64-bit linux-like values
+
+use 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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::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: ::dev_t,
+        __pad0: u64,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad1: u64,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 2],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad0: u64,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: ::c_int,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __reserved: [::c_long; 2],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__fsword_t; 4],
+    }
+
+    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,
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        __pad0: u16,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulonglong,
+        __unused2: ::c_ulonglong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __reserved1: ::c_ulong,
+        __reserved2: ::c_ulong
+    }
+}
+
+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;
+
+align_const! {
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::tcflag_t = 0x0000100f;
+pub const TAB1: ::tcflag_t = 0x800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::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: ::tcflag_t = 0x400;
+pub const IXOFF: ::tcflag_t = 0x1000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x30;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x40;
+pub const CREAD: ::tcflag_t = 0x80;
+pub const PARENB: ::tcflag_t = 0x100;
+pub const PARODD: ::tcflag_t = 0x200;
+pub const HUPCL: ::tcflag_t = 0x400;
+pub const CLOCAL: ::tcflag_t = 0x800;
+pub const ECHOKE: ::tcflag_t = 0x800;
+pub const ECHOE: ::tcflag_t = 0x10;
+pub const ECHOK: ::tcflag_t = 0x20;
+pub const ECHONL: ::tcflag_t = 0x40;
+pub const ECHOPRT: ::tcflag_t = 0x400;
+pub const ECHOCTL: ::tcflag_t = 0x200;
+pub const ISIG: ::tcflag_t = 0x1;
+pub const ICANON: ::tcflag_t = 0x2;
+pub const PENDIN: ::tcflag_t = 0x4000;
+pub const NOFLSH: ::tcflag_t = 0x80;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0x00001000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0x1001;
+pub const B115200: ::speed_t = 0x1002;
+pub const B230400: ::speed_t = 0x1003;
+pub const B460800: ::speed_t = 0x1004;
+pub const B76800: ::speed_t = 0x1005;
+pub const B153600: ::speed_t = 0x1006;
+pub const B307200: ::speed_t = 0x1007;
+pub const B614400: ::speed_t = 0x1008;
+pub const B921600: ::speed_t = 0x1009;
+pub const B500000: ::speed_t = 0x100a;
+pub const B576000: ::speed_t = 0x100b;
+pub const B1000000: ::speed_t = 0x100c;
+pub const B1152000: ::speed_t = 0x100d;
+pub const B1500000: ::speed_t = 0x100e;
+pub const B2000000: ::speed_t = 0x100f;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 4;
+pub const IEXTEN: ::tcflag_t = 0x8000;
+pub const TOSTOP: ::tcflag_t = 0x100;
+pub const FLUSHO: ::tcflag_t = 0x1000;
+pub const EXTPROC: ::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;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
new file mode 100644
index 00000000000..ba3075edd7e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
@@ -0,0 +1,24 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+}
+
+s! {
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
new file mode 100644
index 00000000000..609c74429c5
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
@@ -0,0 +1,824 @@
+//! x86_64-specific definitions for 64-bit linux-like values
+
+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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        #[cfg(target_arch = "sparc64")]
+        __reserved0: ::c_int,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    pub struct statfs {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__fsword_t,
+        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_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        f_spare: [::__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: ::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: ::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: ::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_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: i64,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: i64,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: i64,
+        __unused: [i64; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: i64,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: i64,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: i64,
+        __reserved: [i64; 3],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::__fsword_t,
+        pub f_bsize: ::__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: ::fsid_t,
+        pub f_namelen: ::__fsword_t,
+        pub f_frsize: ::__fsword_t,
+        pub f_flags: ::__fsword_t,
+        pub f_spare: [::__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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: u64,
+        __unused5: u64
+    }
+
+    pub struct ptrace_rseq_configuration {
+        pub rseq_abi_pointer: ::__u64,
+        pub rseq_abi_size: ::__u32,
+        pub signature: ::__u32,
+        pub flags: ::__u32,
+        pub pad: ::__u32,
+    }
+}
+
+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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::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],
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::speed_t = B38400;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+pub const EXTPROC: ::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;
+    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(target_pointer_width = "32")] {
+        mod x32;
+        pub use self::x32::*;
+    } else {
+        mod not_x32;
+        pub use self::not_x32::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
new file mode 100644
index 00000000000..3831dfad9d4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
@@ -0,0 +1,451 @@
+use 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: ::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,
+        __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;
+
+align_const! {
+    #[cfg(target_endian = "little")]
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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: ::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: ::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: ::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;
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
new file mode 100644
index 00000000000..06aa0da2d74
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
@@ -0,0 +1,404 @@
+use 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: ::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,
+        __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;
+
+align_const! {
+    pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::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: ::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: ::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_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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
new file mode 100644
index 00000000000..9af519e9077
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs
@@ -0,0 +1,1593 @@
+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 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: ::statx_timestamp,
+        pub stx_btime: ::statx_timestamp,
+        pub stx_ctime: ::statx_timestamp,
+        pub stx_mtime: ::statx_timestamp,
+        pub stx_rdev_major: u32,
+        pub stx_rdev_minor: u32,
+        pub stx_dev_major: u32,
+        pub stx_dev_minor: u32,
+        pub stx_mnt_id: u64,
+        pub stx_dio_mem_align: u32,
+        pub stx_dio_offset_align: u32,
+        __statx_pad3: [u64; 12],
+    }
+
+    pub struct statx_timestamp {
+        pub tv_sec: i64,
+        pub tv_nsec: u32,
+        pub __statx_timestamp_pad1: [i32; 1],
+    }
+
+    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: ::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 __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: ::socklen_t,
+        pub msg_iov: *mut ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::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: ::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: ::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: ::sockaddr,
+        pub rt_gateway: ::sockaddr,
+        pub rt_genmask: ::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 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: ::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: ::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: ::Elf64_Word,
+        pub ch_reserved: ::Elf64_Word,
+        pub ch_size: ::Elf64_Xword,
+        pub ch_addralign: ::Elf64_Xword,
+    }
+
+    pub struct Elf32_Chdr {
+        pub ch_type: ::Elf32_Word,
+        pub ch_size: ::Elf32_Word,
+        pub ch_addralign: ::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: ::__u64,
+        pub flags: ::__u32,
+        pub nr: ::__s32,
+    }
+
+    pub struct __c_anonymous_ptrace_syscall_info_entry {
+        pub nr: ::__u64,
+        pub args: [::__u64; 6],
+    }
+
+    pub struct __c_anonymous_ptrace_syscall_info_exit {
+        pub sval: ::__s64,
+        pub is_error: ::__u8,
+    }
+
+    pub struct __c_anonymous_ptrace_syscall_info_seccomp {
+        pub nr: ::__u64,
+        pub args: [::__u64; 6],
+        pub ret_data: ::__u32,
+    }
+
+    pub struct ptrace_syscall_info {
+        pub op: ::__u8,
+        pub pad: [::__u8; 3],
+        pub arch: ::__u32,
+        pub instruction_pointer: ::__u64,
+        pub stack_pointer: ::__u64,
+        #[cfg(libc_union)]
+        pub u: __c_anonymous_ptrace_syscall_info_data,
+    }
+
+    // linux/if_xdp.h
+
+    pub struct sockaddr_xdp {
+        pub sxdp_family: ::__u16,
+        pub sxdp_flags: ::__u16,
+        pub sxdp_ifindex: ::__u32,
+        pub sxdp_queue_id: ::__u32,
+        pub sxdp_shared_umem_fd: ::__u32,
+    }
+
+    pub struct xdp_ring_offset {
+        pub producer: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__u64,
+        pub flags: ::__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: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__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: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_umem_reg_v1 {
+        pub addr: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+    }
+
+    pub struct xdp_statistics {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+        pub rx_ring_full: ::__u64,
+        pub rx_fill_ring_empty_descs: ::__u64,
+        pub tx_ring_empty_descs: ::__u64,
+    }
+
+    pub struct xdp_statistics_v1 {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+    }
+
+    pub struct xdp_options {
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_desc {
+        pub addr: ::__u64,
+        pub len: ::__u32,
+        pub options: ::__u32,
+    }
+
+    pub struct iocb {
+        pub aio_data: ::__u64,
+        #[cfg(target_endian = "little")]
+        pub aio_key: ::__u32,
+        #[cfg(target_endian = "little")]
+        pub aio_rw_flags: ::__kernel_rwf_t,
+        #[cfg(target_endian = "big")]
+        pub aio_rw_flags: ::__kernel_rwf_t,
+        #[cfg(target_endian = "big")]
+        pub aio_key: ::__u32,
+        pub aio_lio_opcode: ::__u16,
+        pub aio_reqprio: ::__s16,
+        pub aio_fildes: ::__u32,
+        pub aio_buf: ::__u64,
+        pub aio_nbytes: ::__u64,
+        pub aio_offset: ::__s64,
+        aio_reserved2: ::__u64,
+        pub aio_flags: ::__u32,
+        pub aio_resfd: ::__u32,
+    }
+}
+
+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) -> ::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: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        struct sifields_sigchld {
+            si_pid: ::pid_t,
+            si_uid: ::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) -> ::pid_t {
+                self.sifields().sigchld.si_pid
+            }
+
+            pub unsafe fn si_uid(&self) -> ::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: ::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: ::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<H: ::hash::Hasher>(&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);
+            }
+        }
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_ptrace_syscall_info_data {}
+
+        #[cfg(libc_union)]
+        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()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for __c_anonymous_ptrace_syscall_info_data {
+            fn hash<H: ::hash::Hasher>(&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: ::__priority_which_t = 0;
+pub const PRIO_PGRP: ::__priority_which_t = 1;
+pub const PRIO_USER: ::__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 = ::LC_CTYPE_MASK
+    | ::LC_NUMERIC_MASK
+    | ::LC_TIME_MASK
+    | ::LC_COLLATE_MASK
+    | ::LC_MONETARY_MASK
+    | ::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 _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: ::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: ::__u8 = 0;
+pub const PTRACE_SYSCALL_INFO_ENTRY: ::__u8 = 1;
+pub const PTRACE_SYSCALL_INFO_EXIT: ::__u8 = 2;
+pub const PTRACE_SYSCALL_INFO_SECCOMP: ::__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;
+
+// linux/if_addr.h
+pub const IFA_FLAGS: ::c_ushort = 8;
+
+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;
+
+pub const MAX_LINKS: ::c_int = 32;
+
+pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
+
+pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
+pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
+
+// linux/if_xdp.h
+pub const XDP_SHARED_UMEM: ::__u16 = 1 << 0;
+pub const XDP_COPY: ::__u16 = 1 << 1;
+pub const XDP_ZEROCOPY: ::__u16 = 1 << 2;
+pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3;
+pub const XDP_USE_SG: ::__u16 = 1 << 4;
+
+pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0;
+
+pub const XDP_RING_NEED_WAKEUP: ::__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: ::__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: ::__u32 = 1 << 0;
+
+// 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 ELFOSABI_ARM_AEABI: u8 = 64;
+
+// linux/sched.h
+pub const CLONE_NEWTIME: ::c_int = 0x80;
+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 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_MNT_ID: ::c_uint = 0x1000;
+pub const STATX_DIOALIGN: ::c_uint = 0x2000;
+pub const STATX_ALL: ::c_uint = 0x0fff;
+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 = 0x00100000;
+pub const STATX_ATTR_DAX: ::c_int = 0x00200000;
+
+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;
+
+extern "C" {
+    pub fn fgetspent_r(
+        fp: *mut ::FILE,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn sgetspent_r(
+        s: *const ::c_char,
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn getspent_r(
+        spbuf: *mut ::spwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        spbufp: *mut *mut ::spwd,
+    ) -> ::c_int;
+    pub fn qsort_r(
+        base: *mut ::c_void,
+        num: ::size_t,
+        size: ::size_t,
+        compar: ::Option<
+            unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int,
+        >,
+        arg: *mut ::c_void,
+    );
+    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 ::timespec,
+    ) -> ::c_int;
+
+    pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+    pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+    pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+    pub fn prlimit(
+        pid: ::pid_t,
+        resource: ::__rlimit_resource_t,
+        new_limit: *const ::rlimit,
+        old_limit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn prlimit64(
+        pid: ::pid_t,
+        resource: ::__rlimit_resource_t,
+        new_limit: *const ::rlimit64,
+        old_limit: *mut ::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;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::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 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;
+
+    pub fn adjtimex(buf: *mut timex) -> ::c_int;
+    pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+    #[link_name = "ntp_gettimex"]
+    pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+    pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::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 preadv2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn pwritev2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn preadv64v2(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+        flags: ::c_int,
+    ) -> ::ssize_t;
+    pub fn pwritev64v2(
+        fd: ::c_int,
+        iov: *const ::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 ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
+    pub fn glob64(
+        pattern: *const ::c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut glob64_t,
+    ) -> ::c_int;
+    pub fn globfree64(pglob: *mut glob64_t);
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
+    pub fn pthread_attr_getaffinity_np(
+        attr: *const ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *mut ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setaffinity_np(
+        attr: *mut ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *const ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn pthread_rwlockattr_getkind_np(
+        attr: *const ::pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setkind_np(
+        attr: *mut ::pthread_rwlockattr_t,
+        val: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int;
+    pub fn mallinfo() -> ::mallinfo;
+    pub fn mallinfo2() -> ::mallinfo2;
+    pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
+    pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn getgrent_r(
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn fgetpwent_r(
+        stream: *mut ::FILE,
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn fgetgrent_r(
+        stream: *mut ::FILE,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+
+    pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int;
+    pub fn putgrent(grp: *const ::group, stream: *mut ::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 ::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 ::tm,
+    ) -> ::size_t;
+    pub fn strftime_l(
+        s: *mut ::c_char,
+        max: ::size_t,
+        format: *const ::c_char,
+        tm: *const ::tm,
+        locale: ::locale_t,
+    ) -> ::size_t;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *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 ::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 ::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 ::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 ::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 ::posix_spawn_file_actions_t,
+        tcfd: ::c_int,
+    ) -> ::c_int;
+
+    // mntent.h
+    pub fn getmntent_r(
+        stream: *mut ::FILE,
+        mntbuf: *mut ::mntent,
+        buf: *mut ::c_char,
+        buflen: ::c_int,
+    ) -> *mut ::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;
+}
+
+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
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs
new file mode 100644
index 00000000000..e32bf673d14
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs
@@ -0,0 +1,10 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/mod.rs
new file mode 100644
index 00000000000..acb10c603f7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/mod.rs
@@ -0,0 +1,5687 @@
+//! Linux-specific definitions for linux-like values
+
+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 __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 Elf64_Sxword = i64;
+
+pub type Elf32_Section = u16;
+pub type Elf64_Section = u16;
+
+// 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
+}
+
+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: ::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 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: ::timespec,
+        pub it_value: ::timespec,
+    }
+
+    pub struct fsid_t {
+        __val: [::c_int; 2],
+    }
+
+    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 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 {
+        pub time: ::timeval,
+        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: ::__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 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
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_adds: ::c_ulonglong,
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_subs: ::c_ulonglong,
+        #[cfg(not(target_env = "uclibc"))]
+        pub dlpi_tls_modid: ::size_t,
+        #[cfg(not(target_env = "uclibc"))]
+        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 ucred {
+        pub pid: ::pid_t,
+        pub uid: ::uid_t,
+        pub gid: ::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: ::pid_t,
+        __sd: ::sigset_t,
+        __ss: ::sigset_t,
+        #[cfg(any(target_env = "musl", target_env = "ohos"))]
+        __prio: ::c_int,
+        #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
+        __sp: ::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: ::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; ::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 sockaddr_vm {
+        pub svm_family: ::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: ::__u64,
+        pub args: [::__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: ::__u64,
+        pub pid: ::__u32,
+        pub flags: ::__u32,
+        pub data: seccomp_data,
+    }
+
+    pub struct seccomp_notif_resp {
+        pub id: ::__u64,
+        pub val: ::__s64,
+        pub error: ::__s32,
+        pub flags: ::__u32,
+    }
+
+    pub struct seccomp_notif_addfd {
+        pub id: ::__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: ::__s64,
+        pub src_offset: ::__u64,
+        pub src_length: ::__u64,
+        pub dest_offset: ::__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: ::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/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: ::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: ::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: ::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: ::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],
+    }
+}
+
+s_no_extra_traits! {
+    pub struct sockaddr_nl {
+        pub nl_family: ::sa_family_t,
+        nl_pad: ::c_ushort,
+        pub nl_pid: u32,
+        pub nl_groups: u32
+    }
+
+    pub struct dirent {
+        pub d_ino: ::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: ::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],
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifr_ifru {
+        pub ifru_addr: ::sockaddr,
+        pub ifru_dstaddr: ::sockaddr,
+        pub ifru_broadaddr: ::sockaddr,
+        pub ifru_netmask: ::sockaddr,
+        pub ifru_hwaddr: ::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; ::IFNAMSIZ],
+        pub ifru_newname: [::c_char; ::IFNAMSIZ],
+        pub ifru_data: *mut ::c_char,
+    }
+
+    pub struct ifreq {
+        /// interface name, e.g. "en0"
+        pub ifr_name: [::c_char; ::IFNAMSIZ],
+        #[cfg(libc_union)]
+        pub ifr_ifru: __c_anonymous_ifr_ifru,
+        #[cfg(not(libc_union))]
+        pub ifr_ifru: ::sockaddr,
+    }
+
+    #[cfg(libc_union)]
+    pub union __c_anonymous_ifc_ifcu {
+        pub ifcu_buf: *mut ::c_char,
+        pub ifcu_req: *mut ::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.  */
+        #[cfg(libc_union)]
+        pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+        #[cfg(not(libc_union))]
+        pub ifc_ifcu: *mut ::ifreq,
+    }
+
+    pub struct hwtstamp_config {
+        pub flags: ::c_int,
+        pub tx_type: ::c_int,
+        pub rx_filter: ::c_int,
+    }
+
+    pub struct dirent64 {
+        pub d_ino: ::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: ::__u64,
+        pub sched_nice: ::__s32,
+        pub sched_priority: ::__u32,
+        pub sched_runtime: ::__u64,
+        pub sched_deadline: ::__u64,
+        pub sched_period: ::__u64,
+    }
+}
+
+s_no_extra_traits! {
+    // linux/net_tstamp.h
+    #[allow(missing_debug_implementations)]
+    pub struct sock_txtime {
+        pub clockid: ::clockid_t,
+        pub flags: ::__u32,
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        s_no_extra_traits! {
+            // linux/can.h
+            #[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: ::sa_family_t,
+                pub can_ifindex: ::c_int,
+                pub can_addr: __c_anonymous_sockaddr_can_can_addr,
+            }
+        }
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&self, state: &mut H) {
+                self.mq_flags.hash(state);
+                self.mq_maxmsg.hash(state);
+                self.mq_msgsize.hash(state);
+                self.mq_curmsgs.hash(state);
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifru_addr", unsafe { &self.ifru_addr })
+                    .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+                    .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+                    .field("ifru_netmask", unsafe { &self.ifru_netmask })
+                    .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr })
+                    .field("ifru_flags", unsafe { &self.ifru_flags })
+                    .field("ifru_ifindex", unsafe { &self.ifru_ifindex })
+                    .field("ifru_metric", unsafe { &self.ifru_metric })
+                    .field("ifru_mtu", unsafe { &self.ifru_mtu })
+                    .field("ifru_map", unsafe { &self.ifru_map })
+                    .field("ifru_slave", unsafe { &self.ifru_slave })
+                    .field("ifru_newname", unsafe { &self.ifru_newname })
+                    .field("ifru_data", unsafe { &self.ifru_data })
+                    .finish()
+            }
+        }
+        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()
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("ifr_ifru")
+                    .field("ifcu_buf", unsafe { &self.ifcu_buf })
+                    .field("ifcu_req", unsafe { &self.ifcu_req })
+                    .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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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);
+            }
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(any(target_env = "gnu", target_env = "musl", target_env = "ohos"))] {
+        pub const ABDAY_1: ::nl_item = 0x20000;
+        pub const ABDAY_2: ::nl_item = 0x20001;
+        pub const ABDAY_3: ::nl_item = 0x20002;
+        pub const ABDAY_4: ::nl_item = 0x20003;
+        pub const ABDAY_5: ::nl_item = 0x20004;
+        pub const ABDAY_6: ::nl_item = 0x20005;
+        pub const ABDAY_7: ::nl_item = 0x20006;
+
+        pub const DAY_1: ::nl_item = 0x20007;
+        pub const DAY_2: ::nl_item = 0x20008;
+        pub const DAY_3: ::nl_item = 0x20009;
+        pub const DAY_4: ::nl_item = 0x2000A;
+        pub const DAY_5: ::nl_item = 0x2000B;
+        pub const DAY_6: ::nl_item = 0x2000C;
+        pub const DAY_7: ::nl_item = 0x2000D;
+
+        pub const ABMON_1: ::nl_item = 0x2000E;
+        pub const ABMON_2: ::nl_item = 0x2000F;
+        pub const ABMON_3: ::nl_item = 0x20010;
+        pub const ABMON_4: ::nl_item = 0x20011;
+        pub const ABMON_5: ::nl_item = 0x20012;
+        pub const ABMON_6: ::nl_item = 0x20013;
+        pub const ABMON_7: ::nl_item = 0x20014;
+        pub const ABMON_8: ::nl_item = 0x20015;
+        pub const ABMON_9: ::nl_item = 0x20016;
+        pub const ABMON_10: ::nl_item = 0x20017;
+        pub const ABMON_11: ::nl_item = 0x20018;
+        pub const ABMON_12: ::nl_item = 0x20019;
+
+        pub const MON_1: ::nl_item = 0x2001A;
+        pub const MON_2: ::nl_item = 0x2001B;
+        pub const MON_3: ::nl_item = 0x2001C;
+        pub const MON_4: ::nl_item = 0x2001D;
+        pub const MON_5: ::nl_item = 0x2001E;
+        pub const MON_6: ::nl_item = 0x2001F;
+        pub const MON_7: ::nl_item = 0x20020;
+        pub const MON_8: ::nl_item = 0x20021;
+        pub const MON_9: ::nl_item = 0x20022;
+        pub const MON_10: ::nl_item = 0x20023;
+        pub const MON_11: ::nl_item = 0x20024;
+        pub const MON_12: ::nl_item = 0x20025;
+
+        pub const AM_STR: ::nl_item = 0x20026;
+        pub const PM_STR: ::nl_item = 0x20027;
+
+        pub const D_T_FMT: ::nl_item = 0x20028;
+        pub const D_FMT: ::nl_item = 0x20029;
+        pub const T_FMT: ::nl_item = 0x2002A;
+        pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+        pub const ERA: ::nl_item = 0x2002C;
+        pub const ERA_D_FMT: ::nl_item = 0x2002E;
+        pub const ALT_DIGITS: ::nl_item = 0x2002F;
+        pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+        pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+        pub const CODESET: ::nl_item = 14;
+        pub const CRNCYSTR: ::nl_item = 0x4000F;
+        pub const RADIXCHAR: ::nl_item = 0x10000;
+        pub const THOUSEP: ::nl_item = 0x10001;
+        pub const YESEXPR: ::nl_item = 0x50000;
+        pub const NOEXPR: ::nl_item = 0x50001;
+        pub const YESSTR: ::nl_item = 0x50002;
+        pub const NOSTR: ::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 RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
+pub const RLIM_SAVED_CUR: ::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/<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 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 = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+
+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_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_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
+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 = ::IFF_TUN as ::c_short;
+pub const TUN_TAP_DEV: ::c_short = ::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;
+
+align_const! {
+    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_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: ::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 ::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;
+
+// <linux/seccomp.h>
+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: ::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 = ::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: ::tcflag_t = 0x00004000;
+#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
+pub const CMSPAR: ::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_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: ::__u64 = 0x01;
+pub const RESOLVE_NO_MAGICLINKS: ::__u64 = 0x02;
+pub const RESOLVE_NO_SYMLINKS: ::__u64 = 0x04;
+pub const RESOLVE_BENEATH: ::__u64 = 0x08;
+pub const RESOLVE_IN_ROOT: ::__u64 = 0x10;
+pub const RESOLVE_CACHED: ::__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;
+
+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_ADD_MEMBERSHIP: ::c_int = 1;
+pub const PACKET_DROP_MEMBERSHIP: ::c_int = 2;
+
+pub const PACKET_MR_MULTICAST: ::c_int = 0;
+pub const PACKET_MR_PROMISC: ::c_int = 1;
+pub const PACKET_MR_ALLMULTI: ::c_int = 2;
+
+// 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;
+
+// Some NFPROTO are not compatible with musl and are defined in submodules.
+pub const NFPROTO_UNSPEC: ::c_int = 0;
+pub const NFPROTO_IPV4: ::c_int = 2;
+pub const NFPROTO_ARP: ::c_int = 3;
+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;
+pub const NFPROTO_INET: ::c_int = 1;
+pub const NFPROTO_NETDEV: ::c_int = 5;
+
+pub const NF_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+
+// 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 = ::INT_MIN;
+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 = ::INT_MAX;
+pub const NF_IP_PRI_LAST: ::c_int = ::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 = ::INT_MIN;
+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 = ::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_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 = IW_EV_LCP_PK_LEN + ::IFNAMSIZ;
+pub const IW_EV_POINT_PK_LEN: usize = 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 = ::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/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;
+
+// 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_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_0100;
+
+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;
+
+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_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: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        pub const CAN_MTU: usize = ::mem::size_of::<can_frame>();
+        pub const CANFD_MTU: usize = ::mem::size_of::<canfd_frame>();
+        pub const CANXL_MTU: usize = ::mem::size_of::<canxl_frame>();
+        // FIXME: 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 = ::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
+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 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;
+
+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;
+
+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) < ::mem::size_of::<cmsghdr>() {
+            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 ||
+            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(::mem::size_of::<cpu_set_t>(), 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: ::dev_t) -> ::c_uint {
+        let mut major = 0;
+        major |= (dev & 0x00000000000fff00) >> 8;
+        major |= (dev & 0xfffff00000000000) >> 32;
+        major as ::c_uint
+    }
+
+    pub fn minor(dev: ::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 & ::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 ::sock_extended_err) -> *mut ::sockaddr {
+        ee.offset(1) as *mut ::sockaddr
+    }
+
+    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}
+    }
+}
+
+safe_f! {
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        let major = major as ::dev_t;
+        let minor = minor as ::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" {
+            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 ::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;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(not(target_env = "uclibc"))] {
+        extern "C" {
+            pub fn pwritev(
+                fd: ::c_int,
+                iov: *const ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off_t,
+            ) -> ::ssize_t;
+            pub fn preadv(
+                fd: ::c_int,
+                iov: *const ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off_t,
+            ) -> ::ssize_t;
+            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 getloadavg(
+                loadavg: *mut ::c_double,
+                nelem: ::c_int
+            ) -> ::c_int;
+            pub fn process_vm_readv(
+                pid: ::pid_t,
+                local_iov: *const ::iovec,
+                liovcnt: ::c_ulong,
+                remote_iov: *const ::iovec,
+                riovcnt: ::c_ulong,
+                flags: ::c_ulong,
+            ) -> isize;
+            pub fn process_vm_writev(
+                pid: ::pid_t,
+                local_iov: *const ::iovec,
+                liovcnt: ::c_ulong,
+                remote_iov: *const ::iovec,
+                riovcnt: ::c_ulong,
+                flags: ::c_ulong,
+            ) -> isize;
+            pub fn futimes(
+                fd: ::c_int,
+                times: *const ::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 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 mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+            pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+            pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+            pub fn mq_receive(
+                mqd: ::mqd_t,
+                msg_ptr: *mut ::c_char,
+                msg_len: ::size_t,
+                msg_prio: *mut ::c_uint,
+            ) -> ::ssize_t;
+            pub fn mq_timedreceive(
+                mqd: ::mqd_t,
+                msg_ptr: *mut ::c_char,
+                msg_len: ::size_t,
+                msg_prio: *mut ::c_uint,
+                abs_timeout: *const ::timespec,
+            ) -> ::ssize_t;
+            pub fn mq_send(
+                mqd: ::mqd_t,
+                msg_ptr: *const ::c_char,
+                msg_len: ::size_t,
+                msg_prio: ::c_uint,
+            ) -> ::c_int;
+            pub fn mq_timedsend(
+                mqd: ::mqd_t,
+                msg_ptr: *const ::c_char,
+                msg_len: ::size_t,
+                msg_prio: ::c_uint,
+                abs_timeout: *const ::timespec,
+            ) -> ::c_int;
+            pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+            pub fn mq_setattr(
+                mqd: ::mqd_t,
+                newattr: *const ::mq_attr,
+                oldattr: *mut ::mq_attr
+            ) -> ::c_int;
+
+            pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
+            pub fn pthread_cancel(thread: ::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);
+
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+
+    pub fn setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn setspent();
+    pub fn endspent();
+    pub fn getspent() -> *mut spwd;
+
+    pub fn getspnam(name: *const ::c_char) -> *mut spwd;
+
+    // System V IPC
+    pub fn shmget(key: ::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 ::shmid_ds) -> ::c_int;
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+    pub fn semget(key: ::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 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: ::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 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 ::sigset_t, flags: ::c_int) -> ::c_int;
+    pub fn timerfd_create(clockid: ::clockid_t, 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 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 ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+        sigmask: *const ::sigset_t,
+    ) -> ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_getaffinity_np(
+        thread: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpuset: *mut ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_setaffinity_np(
+        thread: ::pthread_t,
+        cpusetsize: ::size_t,
+        cpuset: *const ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+    pub fn reboot(how_to: ::c_int) -> ::c_int;
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
+
+    // Not available now on Android
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::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;
+
+    pub fn glob(
+        pattern: *const c_char,
+        flags: ::c_int,
+        errfunc: ::Option<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::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 ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+
+    pub fn nl_langinfo(item: ::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: ::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;
+    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 ::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 ::epoll_event)
+        -> ::c_int;
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::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 ::timeval, tz: *const ::timezone) -> ::c_int;
+    pub fn splice(
+        fd_in: ::c_int,
+        off_in: *mut ::loff_t,
+        fd_out: ::c_int,
+        off_out: *mut ::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: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::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 ::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 prctl(option: ::c_int, ...) -> ::c_int;
+    pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
+    pub fn ppoll(
+        fds: *mut ::pollfd,
+        nfds: nfds_t,
+        timeout: *const ::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;
+
+    pub fn pthread_mutex_timedlock(
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        attr: *const ::pthread_barrierattr_t,
+        shared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        attr: *mut ::pthread_barrierattr_t,
+        shared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        barrier: *mut pthread_barrier_t,
+        attr: *const ::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 ::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 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: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::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 ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
+    pub fn pthread_attr_getinheritsched(
+        attr: *const ::pthread_attr_t,
+        inheritsched: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_setinheritsched(
+        attr: *mut ::pthread_attr_t,
+        inheritsched: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_getschedpolicy(
+        attr: *const ::pthread_attr_t,
+        policy: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedpolicy(attr: *mut ::pthread_attr_t, policy: ::c_int) -> ::c_int;
+    pub fn pthread_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const ::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 ::sysinfo) -> ::c_int;
+    pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::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 sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::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 ::group;
+    pub fn pthread_kill(thread: ::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: ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::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 ::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 ::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 dl_iterate_phdr(
+        callback: ::Option<
+            unsafe extern "C" fn(
+                info: *mut ::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 ::FILE;
+    pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+    pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int;
+    pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
+    pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::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 ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::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: ::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 ::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 ::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 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() -> ::pid_t;
+
+    pub fn timer_create(
+        clockid: ::clockid_t,
+        sevp: *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, curr_value: *mut ::itimerspec) -> ::c_int;
+    pub fn timer_settime(
+        timerid: ::timer_t,
+        flags: ::c_int,
+        new_value: *const ::itimerspec,
+        old_value: *mut ::itimerspec,
+    ) -> ::c_int;
+
+    pub fn gethostid() -> ::c_long;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::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: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::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;
+}
+
+// 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 ::FILE, ptr: *mut fpos64_t) -> ::c_int;
+            pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+            pub fn freopen64(
+                filename: *const c_char,
+                mode: *const c_char,
+                file: *mut ::FILE,
+            ) -> *mut ::FILE;
+            pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+            pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+            pub fn ftello64(stream: *mut ::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 ::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::*;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
+
+cfg_if! {
+    if #[cfg(libc_non_exhaustive)] {
+        mod non_exhaustive;
+        pub use self::non_exhaustive::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs
new file mode 100644
index 00000000000..aedbf7a99eb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: (i64, i64)
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs
new file mode 100644
index 00000000000..8225f26adb4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs
@@ -0,0 +1,853 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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_ino: ::ino_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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_ino: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_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 statfs64 {
+        pub f_type: ::c_ulong,
+        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_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,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+
+    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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_regspace: [::c_ulonglong; 64],
+    }
+}
+
+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<H: ::hash::Hasher>(&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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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: ::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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::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;
+
+extern "C" {
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs
new file mode 100644
index 00000000000..089c06f859e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs
@@ -0,0 +1,667 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+pub type stat64 = ::stat;
+
+s! {
+
+    pub struct stat {
+        pub st_dev: ::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: ::blksize_t,
+        __st_blksize_padding: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_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 statfs64 {
+        pub f_type: ::c_ulong,
+        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_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,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs
new file mode 100644
index 00000000000..8c228ebab72
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f32; 4]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs
new file mode 100644
index 00000000000..2fb405bbc6c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs
@@ -0,0 +1,788 @@
+pub type c_char = i8;
+pub type wchar_t = ::c_int;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __st_padding1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_padding2: [::c_long; 2],
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        __st_padding3: ::c_long,
+        pub st_blocks: ::blkcnt_t,
+        __st_padding4: [::c_long; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __st_padding1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_padding2: [::c_long; 2],
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        __st_padding3: ::c_long,
+        pub st_blocks: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __unused1: ::c_int,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused1: ::c_int,
+        #[cfg(target_endian = "big")]
+        __unused2: ::c_int,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused2: ::c_int,
+        #[cfg(target_endian = "big")]
+        __unused3: ::c_int,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 5],
+    }
+
+    pub struct siginfo_t {
+        pub si_signo: ::c_int,
+        pub si_code: ::c_int,
+        pub si_errno: ::c_int,
+        pub _pad: [::c_int; 29],
+        _align: [usize; 0],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_blocks: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsfilcnt_t,
+        pub f_ffree: ::fsfilcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+        pub f_namelen: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 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,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        __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 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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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 = ::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: ::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: ::tcflag_t = 0o000400;
+pub const TOSTOP: ::tcflag_t = 0o100000;
+pub const FLUSHO: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
new file mode 100644
index 00000000000..cecd6dcab7d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs
@@ -0,0 +1,65 @@
+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: ::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,
+    }
+
+    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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs
new file mode 100644
index 00000000000..bdf25455fd8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs
@@ -0,0 +1,802 @@
+pub type c_char = u8;
+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: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_short,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 2],
+    }
+
+    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_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_short,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __pad1: ::c_int,
+        __pad2: ::c_longlong,
+        __pad3: ::c_longlong
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        __unused1: ::c_int,
+        pub shm_atime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused4: ::c_int,
+        pub shm_segsz: ::size_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        __unused1: ::c_int,
+        pub msg_stime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused3: ::c_int,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_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 statfs64 {
+        pub f_type: ::c_ulong,
+        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_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,
+        #[cfg(target_endian = "little")]
+        pub f_fsid: ::c_ulong,
+        __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 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: ::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: ::tcflag_t = 0x00000200;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const ONLCR: ::tcflag_t = 0x00000002;
+pub const CSIZE: ::tcflag_t = 0x00000300;
+pub const CS6: ::tcflag_t = 0x00000100;
+pub const CS7: ::tcflag_t = 0x00000200;
+pub const CS8: ::tcflag_t = 0x00000300;
+pub const CSTOPB: ::tcflag_t = 0x00000400;
+pub const CREAD: ::tcflag_t = 0x00000800;
+pub const PARENB: ::tcflag_t = 0x00001000;
+pub const PARODD: ::tcflag_t = 0x00002000;
+pub const HUPCL: ::tcflag_t = 0x00004000;
+pub const CLOCAL: ::tcflag_t = 0x00008000;
+pub const ECHOKE: ::tcflag_t = 0x00000001;
+pub const ECHOE: ::tcflag_t = 0x00000002;
+pub const ECHOK: ::tcflag_t = 0x00000004;
+pub const ECHONL: ::tcflag_t = 0x00000010;
+pub const ECHOPRT: ::tcflag_t = 0x00000020;
+pub const ECHOCTL: ::tcflag_t = 0x00000040;
+pub const ISIG: ::tcflag_t = 0x00000080;
+pub const ICANON: ::tcflag_t = 0x00000100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+pub const CIBAUD: ::tcflag_t = 0o00077600000;
+pub const CBAUDEX: ::tcflag_t = 0o000020;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o001400;
+pub const CRDLY: ::tcflag_t = 0o030000;
+pub const TABDLY: ::tcflag_t = 0o006000;
+pub const BSDLY: ::tcflag_t = 0o100000;
+pub const FFDLY: ::tcflag_t = 0o040000;
+pub const VTDLY: ::tcflag_t = 0o200000;
+pub const XTABS: ::tcflag_t = 0o006000;
+pub const B57600: ::speed_t = 0o000020;
+pub const B115200: ::speed_t = 0o000021;
+pub const B230400: ::speed_t = 0o000022;
+pub const B460800: ::speed_t = 0o000023;
+pub const B500000: ::speed_t = 0o000024;
+pub const B576000: ::speed_t = 0o000025;
+pub const B921600: ::speed_t = 0o000026;
+pub const B1000000: ::speed_t = 0o000027;
+pub const B1152000: ::speed_t = 0o000030;
+pub const B1500000: ::speed_t = 0o000031;
+pub const B2000000: ::speed_t = 0o000032;
+pub const B2500000: ::speed_t = 0o000033;
+pub const B3000000: ::speed_t = 0o000034;
+pub const B3500000: ::speed_t = 0o000035;
+pub const B4000000: ::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: ::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: ::tcflag_t = 0x00000400;
+pub const TOSTOP: ::tcflag_t = 0x00400000;
+pub const FLUSHO: ::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;
+
+extern "C" {
+    pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs
new file mode 100644
index 00000000000..048268c96b7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: (i64, f64)
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
new file mode 100644
index 00000000000..f963f645a9f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
@@ -0,0 +1,798 @@
+//! RISC-V-specific definitions for 32-bit linux-like values
+
+pub type c_char = u8;
+pub type wchar_t = ::c_int;
+
+s! {
+    pub struct pthread_attr_t {
+        __size: [::c_ulong; 7],
+    }
+
+    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: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt64_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        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_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: ::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 __f_spare: [::c_int; 6],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        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_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,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused5: ::c_ulong,
+        __unused6: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+}
+
+//pub const RLIM_INFINITY: ::rlim_t = !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 TIOCGSOFTCAR: ::c_ulong = 21529;
+pub const TIOCSSOFTCAR: ::c_ulong = 21530;
+pub const TIOCGRS485: ::c_int = 21550;
+pub const TIOCSRS485: ::c_int = 21551;
+//pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
+//pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
+//pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
+//pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
+//pub const RLIMIT_NPROC: ::__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 O_NDELAY: ::c_int = 2048;
+pub const EFD_NONBLOCK: ::c_int = 2048;
+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 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 TIOCLINUX: ::c_ulong = 21532;
+pub const TIOCGSERIAL: ::c_ulong = 21534;
+pub const TIOCEXCL: ::c_ulong = 21516;
+pub const TIOCNXCL: ::c_ulong = 21517;
+pub const TIOCSCTTY: ::c_ulong = 21518;
+pub const TIOCSTI: ::c_ulong = 21522;
+pub const TIOCMGET: ::c_ulong = 21525;
+pub const TIOCMBIS: ::c_ulong = 21526;
+pub const TIOCMBIC: ::c_ulong = 21527;
+pub const TIOCMSET: ::c_ulong = 21528;
+pub const TIOCCONS: ::c_ulong = 21533;
+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_RNG: ::c_int = 128;
+pub const TIOCM_DSR: ::c_int = 256;
+
+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_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_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 FIOCLEX: ::c_int = 21585;
+pub const FIONCLEX: ::c_int = 21584;
+pub const FIONBIO: ::c_int = 21537;
+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: ::tcflag_t = 4111;
+pub const TAB1: ::tcflag_t = 2048;
+pub const TAB2: ::tcflag_t = 4096;
+pub const TAB3: ::tcflag_t = 6144;
+pub const CR1: ::tcflag_t = 512;
+pub const CR2: ::tcflag_t = 1024;
+pub const CR3: ::tcflag_t = 1536;
+pub const FF1: ::tcflag_t = 32768;
+pub const BS1: ::tcflag_t = 8192;
+pub const VT1: ::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: ::tcflag_t = 1024;
+pub const IXOFF: ::tcflag_t = 4096;
+pub const ONLCR: ::tcflag_t = 4;
+pub const CSIZE: ::tcflag_t = 48;
+pub const CS6: ::tcflag_t = 16;
+pub const CS7: ::tcflag_t = 32;
+pub const CS8: ::tcflag_t = 48;
+pub const CSTOPB: ::tcflag_t = 64;
+pub const CREAD: ::tcflag_t = 128;
+pub const PARENB: ::tcflag_t = 256;
+pub const PARODD: ::tcflag_t = 512;
+pub const HUPCL: ::tcflag_t = 1024;
+pub const CLOCAL: ::tcflag_t = 2048;
+pub const ECHOKE: ::tcflag_t = 2048;
+pub const ECHOE: ::tcflag_t = 16;
+pub const ECHOK: ::tcflag_t = 32;
+pub const ECHONL: ::tcflag_t = 64;
+pub const ECHOPRT: ::tcflag_t = 1024;
+pub const ECHOCTL: ::tcflag_t = 512;
+pub const ISIG: ::tcflag_t = 1;
+pub const ICANON: ::tcflag_t = 2;
+pub const PENDIN: ::tcflag_t = 16384;
+pub const NOFLSH: ::tcflag_t = 128;
+pub const CIBAUD: ::tcflag_t = 269418496;
+pub const CBAUDEX: ::tcflag_t = 4096;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 2;
+pub const NLDLY: ::tcflag_t = 256;
+pub const CRDLY: ::tcflag_t = 1536;
+pub const TABDLY: ::tcflag_t = 6144;
+pub const BSDLY: ::tcflag_t = 8192;
+pub const FFDLY: ::tcflag_t = 32768;
+pub const VTDLY: ::tcflag_t = 16384;
+pub const XTABS: ::tcflag_t = 6144;
+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 EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 4097;
+pub const B115200: ::speed_t = 4098;
+pub const B230400: ::speed_t = 4099;
+pub const B460800: ::speed_t = 4100;
+pub const B500000: ::speed_t = 4101;
+pub const B576000: ::speed_t = 4102;
+pub const B921600: ::speed_t = 4103;
+pub const B1000000: ::speed_t = 4104;
+pub const B1152000: ::speed_t = 4105;
+pub const B1500000: ::speed_t = 4106;
+pub const B2000000: ::speed_t = 4107;
+pub const B2500000: ::speed_t = 4108;
+pub const B3000000: ::speed_t = 4109;
+pub const B3500000: ::speed_t = 4110;
+pub const B4000000: ::speed_t = 4111;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 32768;
+pub const TOSTOP: ::tcflag_t = 256;
+pub const FLUSHO: ::tcflag_t = 4096;
+pub const EXTPROC: ::tcflag_t = 65536;
+pub const TCGETS: ::c_int = 21505;
+pub const TCSETS: ::c_int = 21506;
+pub const TCSETSW: ::c_int = 21507;
+pub const TCSETSF: ::c_int = 21508;
+pub const TCGETA: ::c_int = 21509;
+pub const TCSETA: ::c_int = 21510;
+pub const TCSETAW: ::c_int = 21511;
+pub const TCSETAF: ::c_int = 21512;
+pub const TCSBRK: ::c_int = 21513;
+pub const TCXONC: ::c_int = 21514;
+pub const TCFLSH: ::c_int = 21515;
+pub const TIOCINQ: ::c_int = 21531;
+pub const TIOCGPGRP: ::c_int = 21519;
+pub const TIOCSPGRP: ::c_int = 21520;
+pub const TIOCOUTQ: ::c_int = 21521;
+pub const TIOCGWINSZ: ::c_int = 21523;
+pub const TIOCSWINSZ: ::c_int = 21524;
+pub const FIONREAD: ::c_int = 21531;
+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_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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs
new file mode 100644
index 00000000000..79544176a88
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs
@@ -0,0 +1,7 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(8))]
+    pub struct max_align_t {
+        priv_: [f64; 3]
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs
new file mode 100644
index 00000000000..12280851e74
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs
@@ -0,0 +1,968 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+s! {
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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_ino: ::ino_t,
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __st_dev_padding: ::c_int,
+        __st_ino_truncated: ::c_long,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __st_rdev_padding: ::c_int,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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_ino: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_int,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_int,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_int,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_int,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_int,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_int,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 4],
+    }
+
+    pub struct mcontext_t {
+        __private: [u32; 22]
+    }
+
+    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 statfs64 {
+        pub f_type: ::c_ulong,
+        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_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,
+        __f_unused: ::c_int,
+        pub f_flag: ::c_ulong,
+        pub f_namemax: ::c_ulong,
+        __f_spare: [::c_int; 6],
+    }
+}
+
+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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 112],
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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: ::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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::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;
+
+// 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;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
new file mode 100644
index 00000000000..a4bf9bff4f1
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs
@@ -0,0 +1,42 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f32; 8]
+    }
+}
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::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; 32]; 16],
+    }
+
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
new file mode 100644
index 00000000000..4535e73eedd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+    pub struct user_fpsimd_struct {
+        pub vregs: [::__uint128_t; 32],
+        pub fpsr: u32,
+        pub fpcr: u32,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
new file mode 100644
index 00000000000..54e072b314a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -0,0 +1,658 @@
+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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_uint; 2],
+    }
+
+    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_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad0: ::c_ulong,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        __pad1: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_ushort,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong,
+    }
+}
+
+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_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 MCL_CURRENT: ::c_int = 0x0001;
+pub const MCL_FUTURE: ::c_int = 0x0002;
+pub const MCL_ONFAULT: ::c_int = 0x0004;
+pub const CBAUD: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_int128)] {
+        mod int128;
+        pub use self::int128::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs
new file mode 100644
index 00000000000..18fa6c664c8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs
@@ -0,0 +1,688 @@
+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: ::dev_t,
+        __pad1: [::c_int; 3],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: [::c_uint; 2],
+        pub st_size: ::off_t,
+        __pad3: ::c_int,
+        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_blksize: ::blksize_t,
+        __pad4: ::c_uint,
+        pub st_blocks: ::blkcnt_t,
+        __pad5: [::c_int; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        __pad1: [::c_int; 3],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        __pad2: [::c_uint; 2],
+        pub st_size: ::off_t,
+        __pad3: ::c_int,
+        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_blksize: ::blksize_t,
+        __pad4: ::c_uint,
+        pub st_blocks: ::blkcnt_t,
+        __pad5: [::c_int; 14],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_namelen: ::c_ulong,
+        pub f_frsize: ::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_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_namelen: ::c_ulong,
+        pub f_frsize: ::c_ulong,
+        pub f_flags: ::c_ulong,
+        pub f_spare: [::c_ulong; 5],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::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: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::tcflag_t = 0x00002000;
+pub const EXTPROC: ::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: ::tcflag_t = 0o0010017;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EHWPOISON: ::c_int = 168;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
new file mode 100644
index 00000000000..05586cdb44b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs
@@ -0,0 +1,163 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type regoff_t = ::c_long;
+
+s! {
+    pub struct statfs64 {
+        pub f_type: ::c_ulong,
+        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_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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::c_ulong,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __pad1: ::c_ulong,
+        __pad2: ::c_ulong,
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_ulong,
+        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_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: ::socklen_t,
+        pub msg_iov: *mut ::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: ::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: ::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 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 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 {
+        // Unknown target_arch
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs
new file mode 100644
index 00000000000..202abe8796b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs
@@ -0,0 +1,695 @@
+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: ::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_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __reserved: [::c_long; 3],
+    }
+
+    pub struct ipc_perm {
+        pub __ipc_perm_key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::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_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: ::tcflag_t = 0x10000000;
+pub const VEOL: usize = 6;
+pub const VEOL2: usize = 8;
+pub const VMIN: usize = 5;
+pub const IEXTEN: ::tcflag_t = 0x00000400;
+pub const TOSTOP: ::tcflag_t = 0x00400000;
+pub const FLUSHO: ::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: ::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: ::tcflag_t = 0x00000200;
+pub const IXOFF: ::tcflag_t = 0x00000400;
+pub const ONLCR: ::tcflag_t = 0x2;
+pub const CSIZE: ::tcflag_t = 0x00000300;
+
+pub const CS6: ::tcflag_t = 0x00000100;
+pub const CS7: ::tcflag_t = 0x00000200;
+pub const CS8: ::tcflag_t = 0x00000300;
+pub const CSTOPB: ::tcflag_t = 0x00000400;
+pub const CREAD: ::tcflag_t = 0x00000800;
+pub const PARENB: ::tcflag_t = 0x00001000;
+pub const PARODD: ::tcflag_t = 0x00002000;
+pub const HUPCL: ::tcflag_t = 0x00004000;
+pub const CLOCAL: ::tcflag_t = 0x00008000;
+pub const ECHOKE: ::tcflag_t = 0x00000001;
+pub const ECHOE: ::tcflag_t = 0x00000002;
+pub const ECHOK: ::tcflag_t = 0x00000004;
+pub const ECHONL: ::tcflag_t = 0x00000010;
+pub const ECHOPRT: ::tcflag_t = 0x00000020;
+pub const ECHOCTL: ::tcflag_t = 0x00000040;
+pub const ISIG: ::tcflag_t = 0x00000080;
+pub const ICANON: ::tcflag_t = 0x00000100;
+pub const PENDIN: ::tcflag_t = 0x20000000;
+pub const NOFLSH: ::tcflag_t = 0x80000000;
+
+pub const CIBAUD: ::tcflag_t = 0o77600000;
+pub const CBAUDEX: ::tcflag_t = 0o0000020;
+pub const VSWTC: usize = 9;
+pub const OLCUC: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o0001400;
+pub const CRDLY: ::tcflag_t = 0o0030000;
+pub const TABDLY: ::tcflag_t = 0o0006000;
+pub const BSDLY: ::tcflag_t = 0o0100000;
+pub const FFDLY: ::tcflag_t = 0o0040000;
+pub const VTDLY: ::tcflag_t = 0o0200000;
+pub const XTABS: ::tcflag_t = 0o00006000;
+
+pub const B57600: ::speed_t = 0o00020;
+pub const B115200: ::speed_t = 0o00021;
+pub const B230400: ::speed_t = 0o00022;
+pub const B460800: ::speed_t = 0o00023;
+pub const B500000: ::speed_t = 0o00024;
+pub const B576000: ::speed_t = 0o00025;
+pub const B921600: ::speed_t = 0o00026;
+pub const B1000000: ::speed_t = 0o00027;
+pub const B1152000: ::speed_t = 0o00030;
+pub const B1500000: ::speed_t = 0o00031;
+pub const B2000000: ::speed_t = 0o00032;
+pub const B2500000: ::speed_t = 0o00033;
+pub const B3000000: ::speed_t = 0o00034;
+pub const B3500000: ::speed_t = 0o00035;
+pub const B4000000: ::speed_t = 0o00036;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs
new file mode 100644
index 00000000000..48d152a5721
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs
@@ -0,0 +1,44 @@
+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: ::stack_t,
+        pub uc_sigmask: ::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,
+    }
+
+    #[allow(missing_debug_implementations)]
+    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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
new file mode 100644
index 00000000000..393f54d3ff7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
@@ -0,0 +1,727 @@
+//! RISC-V-specific definitions for 64-bit linux-like values
+
+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 fsblkcnt64_t = ::c_ulong;
+pub type fsfilcnt64_t = ::c_ulong;
+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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2usize],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub __pad1: ::dev_t,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub __pad2: ::c_int,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_int; 2],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_long,
+        pub f_bsize: ::c_long,
+        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_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: ::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_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: ::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 __f_spare: [::c_int; 6],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::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_favail: ::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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<unsafe extern "C" fn()>,
+    }
+
+    pub struct ipc_perm {
+        pub __key: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused5: ::c_ulong,
+        __unused6: ::c_ulong,
+    }
+}
+
+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;
+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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs
new file mode 100644
index 00000000000..aa4cbf87f8a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs
@@ -0,0 +1,724 @@
+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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __pad1: ::c_long,
+        __pad2: ::c_long,
+    }
+
+    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,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_t,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct statfs {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        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_namelen: ::c_uint,
+        pub f_frsize: ::c_uint,
+        pub f_flags: ::c_uint,
+        pub f_spare: [::c_uint; 4],
+    }
+
+    pub struct statfs64 {
+        pub f_type: ::c_uint,
+        pub f_bsize: ::c_uint,
+        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_namelen: ::c_uint,
+        pub f_frsize: ::c_uint,
+        pub f_flags: ::c_uint,
+        pub f_spare: [::c_uint; 4],
+    }
+}
+
+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<H: ::hash::Hasher>(&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: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+pub const EXTPROC: ::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: ::tcflag_t = 0o000002;
+pub const ONLCR: ::tcflag_t = 0o000004;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0o014000;
+
+pub const CBAUD: ::speed_t = 0o010017;
+pub const CSIZE: ::tcflag_t = 0o000060;
+pub const CS6: ::tcflag_t = 0o000020;
+pub const CS7: ::tcflag_t = 0o000040;
+pub const CS8: ::tcflag_t = 0o000060;
+pub const CSTOPB: ::tcflag_t = 0o000100;
+pub const CREAD: ::tcflag_t = 0o000200;
+pub const PARENB: ::tcflag_t = 0o000400;
+pub const PARODD: ::tcflag_t = 0o001000;
+pub const HUPCL: ::tcflag_t = 0o002000;
+pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+
+pub const ISIG: ::tcflag_t = 0o000001;
+pub const ICANON: ::tcflag_t = 0o000002;
+pub const XCASE: ::tcflag_t = 0o000004;
+pub const ECHOE: ::tcflag_t = 0o000020;
+pub const ECHOK: ::tcflag_t = 0o000040;
+pub const ECHONL: ::tcflag_t = 0o000100;
+pub const NOFLSH: ::tcflag_t = 0o000200;
+pub const ECHOCTL: ::tcflag_t = 0o001000;
+pub const ECHOPRT: ::tcflag_t = 0o002000;
+pub const ECHOKE: ::tcflag_t = 0o004000;
+pub const PENDIN: ::tcflag_t = 0o040000;
+
+pub const POLLWRNORM: ::c_short = 0x100;
+pub const POLLWRBAND: ::c_short = 0x200;
+
+pub const IXON: ::tcflag_t = 0o002000;
+pub const IXOFF: ::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_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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
new file mode 100644
index 00000000000..94391a01a72
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs
@@ -0,0 +1,25 @@
+s_no_extra_traits! {
+    #[allow(missing_debug_implementations)]
+    #[repr(align(16))]
+    pub struct max_align_t {
+        priv_: [f64; 4]
+    }
+
+}
+
+s! {
+    #[repr(align(8))]
+    pub struct clone_args {
+        pub flags: ::c_ulonglong,
+        pub pidfd: ::c_ulonglong,
+        pub child_tid: ::c_ulonglong,
+        pub parent_tid: ::c_ulonglong,
+        pub exit_signal: ::c_ulonglong,
+        pub stack: ::c_ulonglong,
+        pub stack_size: ::c_ulonglong,
+        pub tls: ::c_ulonglong,
+        pub set_tid: ::c_ulonglong,
+        pub set_tid_size: ::c_ulonglong,
+        pub cgroup: ::c_ulonglong,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
new file mode 100644
index 00000000000..4d17868000e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
@@ -0,0 +1,915 @@
+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: ::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_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused: [::c_long; 3],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino64_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        __pad0: ::c_int,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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,
+        __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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub __seq: ::c_int,
+        __unused1: ::c_long,
+        __unused2: ::c_long
+    }
+}
+
+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: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_sigmask: ::sigset_t,
+        __private: [u8; 512],
+    }
+}
+
+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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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_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 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: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const CIBAUD: ::tcflag_t = 0o02003600000;
+pub const CBAUDEX: ::tcflag_t = 0o010000;
+pub const VSWTC: usize = 7;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const NLDLY: ::tcflag_t = 0o000400;
+pub const CRDLY: ::tcflag_t = 0o003000;
+pub const TABDLY: ::tcflag_t = 0o014000;
+pub const BSDLY: ::tcflag_t = 0o020000;
+pub const FFDLY: ::tcflag_t = 0o100000;
+pub const VTDLY: ::tcflag_t = 0o040000;
+pub const XTABS: ::tcflag_t = 0o014000;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::speed_t = 0o010017;
+
+pub const EDEADLK: ::c_int = 35;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+
+pub const EXTPROC: ::tcflag_t = 0x00010000;
+pub const VEOL: usize = 11;
+pub const VEOL2: usize = 16;
+pub const VMIN: usize = 6;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::tcflag_t = 0x00000100;
+pub const FLUSHO: ::tcflag_t = 0x00001000;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs
new file mode 100644
index 00000000000..27c1d25836d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs
@@ -0,0 +1,241 @@
+#[inline]
+pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
+    ::creat(path, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn fallocate64(
+    fd: ::c_int,
+    mode: ::c_int,
+    offset: ::off64_t,
+    len: ::off64_t,
+) -> ::c_int {
+    ::fallocate(fd, mode, offset, len)
+}
+
+#[inline]
+pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
+    ::fgetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
+    ::fopen(pathname, mode)
+}
+
+#[inline]
+pub unsafe extern "C" fn freopen64(
+    pathname: *const ::c_char,
+    mode: *const ::c_char,
+    stream: *mut ::FILE,
+) -> *mut ::FILE {
+    ::freopen(pathname, mode, stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn fseeko64(
+    stream: *mut ::FILE,
+    offset: ::off64_t,
+    whence: ::c_int,
+) -> ::c_int {
+    ::fseeko(stream, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
+    ::fsetpos(stream, pos as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
+    ::fstat(fildes, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatat64(
+    fd: ::c_int,
+    path: *const ::c_char,
+    buf: *mut ::stat64,
+    flag: ::c_int,
+) -> ::c_int {
+    ::fstatat(fd, path, buf as *mut _, flag)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
+    ::fstatfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
+    ::fstatvfs(fd, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
+    ::ftello(stream)
+}
+
+#[inline]
+pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
+    ::ftruncate(fd, length)
+}
+
+#[inline]
+pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
+    ::getrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
+    ::lseek(fd, offset, whence)
+}
+
+#[inline]
+pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
+    ::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 {
+    ::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 open as open64;
+pub use 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 {
+    ::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 {
+    ::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 {
+    ::pread(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn preadv64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::preadv(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn prlimit64(
+    pid: ::pid_t,
+    resource: ::c_int,
+    new_limit: *const ::rlimit64,
+    old_limit: *mut ::rlimit64,
+) -> ::c_int {
+    ::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 {
+    ::pwrite(fd, buf, count, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn pwritev64(
+    fd: ::c_int,
+    iov: *const ::iovec,
+    iovcnt: ::c_int,
+    offset: ::off64_t,
+) -> ::ssize_t {
+    ::pwritev(fd, iov, iovcnt, offset)
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
+    ::readdir(dirp) as *mut _
+}
+
+#[inline]
+pub unsafe extern "C" fn readdir64_r(
+    dirp: *mut ::DIR,
+    entry: *mut ::dirent64,
+    result: *mut *mut ::dirent64,
+) -> ::c_int {
+    ::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 {
+    ::sendfile(out_fd, in_fd, offset, count)
+}
+
+#[inline]
+pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
+    ::setrlimit(resource, rlim as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
+    ::stat(pathname, statbuf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
+    ::statfs(pathname, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
+    ::statvfs(path, buf as *mut _)
+}
+
+#[inline]
+pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
+    ::tmpfile()
+}
+
+#[inline]
+pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
+    ::truncate(path, length)
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
new file mode 100644
index 00000000000..a4c1f708afd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
@@ -0,0 +1,927 @@
+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 fsfilcnt_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) -> ::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: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_union)] {
+        // Internal, for casts to access union fields
+        #[repr(C)]
+        struct sifields_sigchld {
+            si_pid: ::pid_t,
+            si_uid: ::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) -> ::pid_t {
+                self.sifields().sigchld.si_pid
+            }
+
+            pub unsafe fn si_uid(&self) -> ::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: ::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: ::sighandler_t,
+        pub sa_mask: ::sigset_t,
+        pub sa_flags: ::c_int,
+        pub sa_restorer: ::Option<extern fn()>,
+    }
+
+    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,
+        #[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 termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub __c_ispeed: ::speed_t,
+        pub __c_ospeed: ::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: ::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: ::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: ::sockaddr,
+        pub rt_gateway: ::sockaddr,
+        pub rt_genmask: ::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: ::Elf64_Word,
+        pub ch_reserved: ::Elf64_Word,
+        pub ch_size: ::Elf64_Xword,
+        pub ch_addralign: ::Elf64_Xword,
+    }
+
+    pub struct Elf32_Chdr {
+        pub ch_type: ::Elf32_Word,
+        pub ch_size: ::Elf32_Word,
+        pub ch_addralign: ::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: ::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: ::timeval,
+        pub maxerror: ::c_long,
+        pub esterror: ::c_long,
+    }
+
+    // linux/if_xdp.h
+
+    pub struct sockaddr_xdp {
+        pub sxdp_family: ::__u16,
+        pub sxdp_flags: ::__u16,
+        pub sxdp_ifindex: ::__u32,
+        pub sxdp_queue_id: ::__u32,
+        pub sxdp_shared_umem_fd: ::__u32,
+    }
+
+    pub struct xdp_ring_offset {
+        pub producer: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__u64,
+        pub flags: ::__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: ::__u64,
+        pub consumer: ::__u64,
+        pub desc: ::__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: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_umem_reg_v1 {
+        pub addr: ::__u64,
+        pub len: ::__u64,
+        pub chunk_size: ::__u32,
+        pub headroom: ::__u32,
+    }
+
+    pub struct xdp_statistics {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+        pub rx_ring_full: ::__u64,
+        pub rx_fill_ring_empty_descs: ::__u64,
+        pub tx_ring_empty_descs: ::__u64,
+    }
+
+    pub struct xdp_statistics_v1 {
+        pub rx_dropped: ::__u64,
+        pub rx_invalid_descs: ::__u64,
+        pub tx_invalid_descs: ::__u64,
+    }
+
+    pub struct xdp_options {
+        pub flags: ::__u32,
+    }
+
+    pub struct xdp_desc {
+        pub addr: ::__u64,
+        pub len: ::__u32,
+        pub options: ::__u32,
+    }
+}
+
+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: ::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")]
+        pub ut_session: ::c_long,
+
+        #[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: ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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;
+
+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: ::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 = ::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;
+
+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 PTRACE_GETSIGMASK: ::c_uint = 0x420a;
+pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
+
+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 = ::O_NONBLOCK;
+
+pub const SFD_NONBLOCK: ::c_int = ::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: ::clockid_t = 10;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const EXTA: ::speed_t = B19200;
+pub const EXTB: ::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: ::__u16 = 1 << 0;
+pub const XDP_COPY: ::__u16 = 1 << 1;
+pub const XDP_ZEROCOPY: ::__u16 = 1 << 2;
+pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3;
+pub const XDP_USE_SG: ::__u16 = 1 << 4;
+
+pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0;
+
+pub const XDP_RING_NEED_WAKEUP: ::__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: ::__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: ::__u32 = 1 << 0;
+
+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 ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+    pub fn prlimit(
+        pid: ::pid_t,
+        resource: ::c_int,
+        new_limit: *const ::rlimit,
+        old_limit: *mut ::rlimit,
+    ) -> ::c_int;
+    pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn ptrace(request: ::c_int, ...) -> ::c_long;
+    pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::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 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 ::timex) -> ::c_int;
+    pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::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 ::tm, buf: *mut ::c_char) -> *mut ::c_char;
+
+    pub fn strftime(
+        s: *mut ::c_char,
+        max: ::size_t,
+        format: *const ::c_char,
+        tm: *const ::tm,
+    ) -> ::size_t;
+    pub fn strftime_l(
+        s: *mut ::c_char,
+        max: ::size_t,
+        format: *const ::c_char,
+        tm: *const ::tm,
+        locale: ::locale_t,
+    ) -> ::size_t;
+    pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+
+    pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+    pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+}
+
+// Alias <foo> to <foo>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"))] {
+        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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/no_align.rs
new file mode 100644
index 00000000000..328a5cc4842
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/no_align.rs
@@ -0,0 +1,144 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutexattr_t {
+                #[cfg(any(target_arch = "x86_64",
+                          target_arch = "powerpc64",
+                          target_arch = "mips64",
+                          target_arch = "mips64r6",
+                          target_arch = "s390x",
+                          target_arch = "sparc64",
+                          target_arch = "riscv64",
+                          target_arch = "riscv32",
+                          target_arch = "loongarch64",
+                          all(target_arch = "aarch64",
+                              any(target_env = "musl", target_env = "ohos"))))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_arch = "x86_64",
+                              target_arch = "powerpc64",
+                              target_arch = "mips64",
+                              target_arch = "mips64r6",
+                              target_arch = "s390x",
+                              target_arch = "sparc64",
+                              target_arch = "riscv64",
+                              target_arch = "riscv32",
+                              target_arch = "loongarch64",
+                              all(target_arch = "aarch64",
+                                  any(target_env = "musl", target_env = "ohos")))))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_rwlockattr_t {
+                #[cfg(any(target_env = "musl", target_env = "ohos"))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+
+            pub struct pthread_barrierattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
+            }
+
+            pub struct fanotify_event_metadata {
+                __align: [::c_long; 0],
+                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,
+            }
+        }
+
+        s_no_extra_traits! {
+            pub struct pthread_cond_t {
+                #[cfg(any(target_env = "musl", target_env = "ohos"))]
+                __align: [*const ::c_void; 0],
+                #[cfg(not(any(target_env = "musl", target_env = "ohos")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            pub struct pthread_mutex_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "mips32r6",
+                          target_arch = "arm",
+                          target_arch = "m68k",
+                          target_arch = "csky",
+                          target_arch = "powerpc",
+                          target_arch = "sparc",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "mips32r6",
+                              target_arch = "arm",
+                              target_arch = "m68k",
+                              target_arch = "csky",
+                              target_arch = "powerpc",
+                              target_arch = "sparc",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "mips32r6",
+                          target_arch = "arm",
+                          target_arch = "m68k",
+                          target_arch = "csky",
+                          target_arch = "powerpc",
+                          target_arch = "sparc",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "mips32r6",
+                              target_arch = "arm",
+                              target_arch = "m68k",
+                              target_arch = "csky",
+                              target_arch = "powerpc",
+                              target_arch = "sparc",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_barrier_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "mips32r6",
+                          target_arch = "arm",
+                          target_arch = "m68k",
+                          target_arch = "csky",
+                          target_arch = "powerpc",
+                          target_arch = "sparc",
+                          all(target_arch = "x86_64",
+                              target_pointer_width = "32")))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "mips32r6",
+                              target_arch = "arm",
+                              target_arch = "m68k",
+                              target_arch = "csky",
+                              target_arch = "powerpc",
+                              target_arch = "sparc",
+                              all(target_arch = "x86_64",
+                                  target_pointer_width = "32"))))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs
new file mode 100644
index 00000000000..e2e2cb847ac
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs
@@ -0,0 +1,9 @@
+s! {
+    // linux/openat2.h
+    #[non_exhaustive]
+    pub struct open_how {
+        pub flags: ::__u64,
+        pub mode: ::__u64,
+        pub resolve: ::__u64,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs
new file mode 100644
index 00000000000..e6610bb7b98
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs
@@ -0,0 +1,28 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[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; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t {
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs
new file mode 100644
index 00000000000..4a0e07460eb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs
@@ -0,0 +1,13 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
new file mode 100644
index 00000000000..cff82f005ac
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs
@@ -0,0 +1,925 @@
+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: ::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 pthread_attr_t {
+        __size: [::c_long; 9],
+    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulonglong,
+        __pad1: ::c_ushort,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        __pad2: ::c_ushort,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong,
+    }
+
+    pub struct stat64
+    {
+        pub st_dev: ::c_ulonglong,
+        pub __pad1: ::c_uint,
+        pub __st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulonglong,
+        pub __pad2: ::c_uint,
+        pub st_size: ::off64_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt64_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_ino: ::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: ::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: ::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_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: ::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_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: ::sighandler_t,
+        pub sa_flags: ::c_ulong,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: sigset_t,
+    }
+
+    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_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        __unused1: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong,
+    }
+
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        __unused1: ::c_ulong,
+        pub shm_dtime: ::time_t,
+        __unused2: ::c_ulong,
+        pub shm_ctime: ::time_t,
+        __unused3: ::c_ulong,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong,
+    }
+}
+
+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: ::speed_t = 0;
+pub const B1000000: ::speed_t = 0x1008;
+pub const B110: ::speed_t = 0x3;
+pub const B115200: ::speed_t = 0x1002;
+pub const B1152000: ::speed_t = 0x1009;
+pub const B1200: ::speed_t = 0x9;
+pub const B134: ::speed_t = 0x4;
+pub const B150: ::speed_t = 0x5;
+pub const B1500000: ::speed_t = 0x100a;
+pub const B1800: ::speed_t = 0xa;
+pub const B19200: ::speed_t = 0xe;
+pub const B200: ::speed_t = 0x6;
+pub const B2000000: ::speed_t = 0x100b;
+pub const B230400: ::speed_t = 0x1003;
+pub const B2400: ::speed_t = 0xb;
+pub const B2500000: ::speed_t = 0x100c;
+pub const B300: ::speed_t = 0x7;
+pub const B3000000: ::speed_t = 0x100d;
+pub const B3500000: ::speed_t = 0x100e;
+pub const B38400: ::speed_t = 0xf;
+pub const B4000000: ::speed_t = 0x100f;
+pub const B460800: ::speed_t = 0x1004;
+pub const B4800: ::speed_t = 0xc;
+pub const B50: ::speed_t = 0x1;
+pub const B500000: ::speed_t = 0x1005;
+pub const B57600: ::speed_t = 0x1001;
+pub const B576000: ::speed_t = 0x1006;
+pub const B600: ::speed_t = 0x8;
+pub const B75: ::speed_t = 0x2;
+pub const B921600: ::speed_t = 0x1007;
+pub const B9600: ::speed_t = 0xd;
+pub const BS1: ::c_int = 0x2000;
+pub const BSDLY: ::c_int = 0x2000;
+pub const CBAUD: ::tcflag_t = 0x100f;
+pub const CBAUDEX: ::tcflag_t = 0x1000;
+pub const CIBAUD: ::tcflag_t = 0x100f0000;
+pub const CLOCAL: ::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: ::tcflag_t = 0x80;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSIZE: ::tcflag_t = 0x30;
+pub const CSTOPB: ::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: ::tcflag_t = 0x200;
+pub const ECHOE: ::tcflag_t = 0x10;
+pub const ECHOK: ::tcflag_t = 0x20;
+pub const ECHOKE: ::tcflag_t = 0x800;
+pub const ECHONL: ::tcflag_t = 0x40;
+pub const ECHOPRT: ::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: ::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: ::tcflag_t = 0x400;
+pub const ICANON: ::tcflag_t = 0x2;
+pub const IEXTEN: ::tcflag_t = 0x8000;
+pub const ISIG: ::tcflag_t = 0x1;
+pub const IXOFF: ::tcflag_t = 0x1000;
+pub const IXON: ::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: ::tcflag_t = 0x100;
+pub const NOFLSH: ::tcflag_t = 0x80;
+pub const OLCUC: ::tcflag_t = 0x2;
+pub const ONLCR: ::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: ::tcflag_t = 0x100;
+pub const PARODD: ::tcflag_t = 0x200;
+pub const PENDIN: ::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: ::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: ::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;
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs
new file mode 100644
index 00000000000..e32bf673d14
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs
@@ -0,0 +1,10 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs
new file mode 100644
index 00000000000..4a0e07460eb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs
@@ -0,0 +1,13 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
new file mode 100644
index 00000000000..a5aca85a3a7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
@@ -0,0 +1,692 @@
+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: ::dev_t,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_pad2: [::c_long; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        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_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::dev_t,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_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_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::blkcnt64_t,
+        st_pad5: [::c_long; 14],
+    }
+
+    pub struct statvfs64 {
+        pub f_bsize: ::c_ulong,
+        pub f_frsize: ::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_favail: ::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: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved1: ::c_ulong,
+        pub msg_stime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved1: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved2: ::c_ulong,
+        pub msg_rtime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved2: ::c_ulong,
+        #[cfg(target_endian = "big")]
+        __glibc_reserved3: ::c_ulong,
+        pub msg_ctime: ::time_t,
+        #[cfg(target_endian = "little")]
+        __glibc_reserved3: ::c_ulong,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::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: ::fsblkcnt64_t,
+        pub f_bfree: ::fsblkcnt64_t,
+        pub f_files: ::fsblkcnt64_t,
+        pub f_ffree: ::fsblkcnt64_t,
+        pub f_bavail: ::fsblkcnt64_t,
+        pub f_fsid: ::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: ::socklen_t,
+        pub msg_iov: *mut ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::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: ::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],
+    }
+}
+
+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<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut glob64_t,
+    ) -> ::c_int;
+    pub fn globfree64(pglob: *mut glob64_t);
+    pub fn pthread_attr_getaffinity_np(
+        attr: *const ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *mut ::cpu_set_t,
+    ) -> ::c_int;
+    pub fn pthread_attr_setaffinity_np(
+        attr: *mut ::pthread_attr_t,
+        cpusetsize: ::size_t,
+        cpuset: *const ::cpu_set_t,
+    ) -> ::c_int;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs
new file mode 100644
index 00000000000..e32bf673d14
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs
@@ -0,0 +1,10 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs
new file mode 100644
index 00000000000..21e21907d4a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs
@@ -0,0 +1,10 @@
+s! {
+    // FIXME 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],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
new file mode 100644
index 00000000000..8ca100fcd26
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
@@ -0,0 +1,207 @@
+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: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_ulong; 1],
+        pub st_size: ::off_t,
+        st_pad3: ::c_long,
+        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_blksize: ::blksize_t,
+        st_pad4: ::c_long,
+        pub st_blocks: ::blkcnt_t,
+        st_pad5: [::c_long; 7],
+    }
+
+    pub struct stat64 {
+        pub st_dev: ::c_ulong,
+        st_pad1: [::c_long; 2],
+        pub st_ino: ::ino64_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong,
+        st_pad2: [::c_long; 2],
+        pub st_size: ::off64_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_blksize: ::blksize_t,
+        st_pad3: ::c_long,
+        pub st_blocks: ::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: ::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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused4: ::c_ulong,
+        __unused5: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::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: ::fsblkcnt_t,
+        pub f_bfree: ::fsblkcnt_t,
+        pub f_files: ::fsblkcnt_t,
+        pub f_ffree: ::fsblkcnt_t,
+        pub f_bavail: ::fsblkcnt_t,
+        pub f_fsid: ::fsid_t,
+
+        pub f_namelen: ::c_long,
+        f_spare: [::c_long; 6],
+    }
+
+    pub struct msghdr {
+        pub msg_name: *mut ::c_void,
+        pub msg_namelen: ::socklen_t,
+        pub msg_iov: *mut ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::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],
+    }
+}
+
+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
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs
new file mode 100644
index 00000000000..8909114cdfa
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs
@@ -0,0 +1,7 @@
+s! {
+    // FIXME this is actually a union
+    pub struct sem_t {
+        __size: [::c_char; 32],
+        __align: [::c_long; 0],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
new file mode 100644
index 00000000000..56bfcc5d355
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs
@@ -0,0 +1,310 @@
+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_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 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: ::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: ::tcflag_t = 0x00000100;
+pub const TOSTOP: ::tcflag_t = 0x00008000;
+pub const FLUSHO: ::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: ::tcflag_t = 0o0010017;
+pub const CBAUDEX: ::tcflag_t = 0o0010000;
+pub const CIBAUD: ::tcflag_t = 0o002003600000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const TABDLY: ::tcflag_t = 0o0014000;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const BSDLY: ::tcflag_t = 0o0020000;
+pub const VT1: ::tcflag_t = 0x00004000;
+pub const VWERASE: usize = 14;
+pub const XTABS: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const OLCUC: ::tcflag_t = 0o0000002;
+pub const ONLCR: ::tcflag_t = 0x4;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x00000010;
+pub const CS7: ::tcflag_t = 0x00000020;
+pub const CS8: ::tcflag_t = 0x00000030;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CRDLY: ::c_int = 0o0003000;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const PENDIN: ::tcflag_t = 0x00004000;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+
+pub const MAP_HUGETLB: ::c_int = 0x80000;
+
+pub const B0: ::speed_t = 0o000000;
+pub const B50: ::speed_t = 0o000001;
+pub const B75: ::speed_t = 0o000002;
+pub const B110: ::speed_t = 0o000003;
+pub const B134: ::speed_t = 0o000004;
+pub const B150: ::speed_t = 0o000005;
+pub const B200: ::speed_t = 0o000006;
+pub const B300: ::speed_t = 0o000007;
+pub const B600: ::speed_t = 0o000010;
+pub const B1200: ::speed_t = 0o000011;
+pub const B1800: ::speed_t = 0o000012;
+pub const B2400: ::speed_t = 0o000013;
+pub const B4800: ::speed_t = 0o000014;
+pub const B9600: ::speed_t = 0o000015;
+pub const B19200: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
+pub const B57600: ::speed_t = 0o010001;
+pub const B115200: ::speed_t = 0o010002;
+pub const B230400: ::speed_t = 0o010003;
+pub const B460800: ::speed_t = 0o010004;
+pub const B500000: ::speed_t = 0o010005;
+pub const B576000: ::speed_t = 0o010006;
+pub const B921600: ::speed_t = 0o010007;
+pub const B1000000: ::speed_t = 0o010010;
+pub const B1152000: ::speed_t = 0o010011;
+pub const B1500000: ::speed_t = 0o010012;
+pub const B2000000: ::speed_t = 0o010013;
+pub const B2500000: ::speed_t = 0o010014;
+pub const B3000000: ::speed_t = 0o010015;
+pub const B3500000: ::speed_t = 0o010016;
+pub const B4000000: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs
new file mode 100644
index 00000000000..48b03e9ee43
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs
@@ -0,0 +1,392 @@
+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: ::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,
+        #[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: ::sockaddr,
+        pub rt_gateway: ::sockaddr,
+        pub rt_genmask: ::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: ::__u64,
+        pub flags: ::__u32,
+        pub nr: ::__s32,
+    }
+}
+
+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) -> ::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: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+    }
+}
+
+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 = ::MS_RDONLY | ::MS_SYNCHRONOUS | ::MS_MANDLOCK | ::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: ::nl_item = 0x300;
+pub const ABDAY_2: ::nl_item = 0x301;
+pub const ABDAY_3: ::nl_item = 0x302;
+pub const ABDAY_4: ::nl_item = 0x303;
+pub const ABDAY_5: ::nl_item = 0x304;
+pub const ABDAY_6: ::nl_item = 0x305;
+pub const ABDAY_7: ::nl_item = 0x306;
+pub const DAY_1: ::nl_item = 0x307;
+pub const DAY_2: ::nl_item = 0x308;
+pub const DAY_3: ::nl_item = 0x309;
+pub const DAY_4: ::nl_item = 0x30A;
+pub const DAY_5: ::nl_item = 0x30B;
+pub const DAY_6: ::nl_item = 0x30C;
+pub const DAY_7: ::nl_item = 0x30D;
+pub const ABMON_1: ::nl_item = 0x30E;
+pub const ABMON_2: ::nl_item = 0x30F;
+pub const ABMON_3: ::nl_item = 0x310;
+pub const ABMON_4: ::nl_item = 0x311;
+pub const ABMON_5: ::nl_item = 0x312;
+pub const ABMON_6: ::nl_item = 0x313;
+pub const ABMON_7: ::nl_item = 0x314;
+pub const ABMON_8: ::nl_item = 0x315;
+pub const ABMON_9: ::nl_item = 0x316;
+pub const ABMON_10: ::nl_item = 0x317;
+pub const ABMON_11: ::nl_item = 0x318;
+pub const ABMON_12: ::nl_item = 0x319;
+pub const MON_1: ::nl_item = 0x31A;
+pub const MON_2: ::nl_item = 0x31B;
+pub const MON_3: ::nl_item = 0x31C;
+pub const MON_4: ::nl_item = 0x31D;
+pub const MON_5: ::nl_item = 0x31E;
+pub const MON_6: ::nl_item = 0x31F;
+pub const MON_7: ::nl_item = 0x320;
+pub const MON_8: ::nl_item = 0x321;
+pub const MON_9: ::nl_item = 0x322;
+pub const MON_10: ::nl_item = 0x323;
+pub const MON_11: ::nl_item = 0x324;
+pub const MON_12: ::nl_item = 0x325;
+pub const AM_STR: ::nl_item = 0x326;
+pub const PM_STR: ::nl_item = 0x327;
+pub const D_T_FMT: ::nl_item = 0x328;
+pub const D_FMT: ::nl_item = 0x329;
+pub const T_FMT: ::nl_item = 0x32A;
+pub const T_FMT_AMPM: ::nl_item = 0x32B;
+pub const ERA: ::nl_item = 0x32C;
+pub const ERA_D_FMT: ::nl_item = 0x32E;
+pub const ALT_DIGITS: ::nl_item = 0x32F;
+pub const ERA_D_T_FMT: ::nl_item = 0x330;
+pub const ERA_T_FMT: ::nl_item = 0x331;
+pub const CODESET: ::nl_item = 10;
+pub const CRNCYSTR: ::nl_item = 0x215;
+pub const RADIXCHAR: ::nl_item = 0x100;
+pub const THOUSEP: ::nl_item = 0x101;
+pub const NOEXPR: ::nl_item = 0x501;
+pub const YESSTR: ::nl_item = 0x502;
+pub const NOSTR: ::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: ::tcflag_t = 0200000;
+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 = 040000;
+pub const NI_MAXHOST: ::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 = 0100000;
+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 ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+
+    pub fn pthread_rwlockattr_getkind_np(
+        attr: *const ::pthread_rwlockattr_t,
+        val: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_rwlockattr_setkind_np(
+        attr: *mut ::pthread_rwlockattr_t,
+        val: ::c_int,
+    ) -> ::c_int;
+
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
+
+    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 ::timespec,
+    ) -> ::c_int;
+
+    pub fn openpty(
+        amaster: *mut ::c_int,
+        aslave: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+
+    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 pwritev(
+        fd: ::c_int,
+        iov: *const ::iovec,
+        iovcnt: ::c_int,
+        offset: ::off64_t,
+    ) -> ::ssize_t;
+    pub fn preadv(
+        fd: ::c_int,
+        iov: *const ::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: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int;
+    pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int;
+    pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
+    pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
+}
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs
new file mode 100644
index 00000000000..a73dbded57a
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs
@@ -0,0 +1,53 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutex_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(any(libc_align,
+                          target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t {
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(
+                    target_arch = "mips",
+                    target_arch = "arm",
+                    target_arch = "powerpc")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_mutexattr_t {
+                #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
+                          target_arch = "mips64", target_arch = "s390x",
+                          target_arch = "sparc64"))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+                              target_arch = "mips64", target_arch = "s390x",
+                              target_arch = "sparc64")))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_cond_t {
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            pub struct pthread_condattr_t {
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
new file mode 100644
index 00000000000..56a0e37f6df
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
@@ -0,0 +1,53 @@
+/// 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: ::speed_t = 0o000016;
+pub const B38400: ::speed_t = 0o000017;
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
new file mode 100644
index 00000000000..390119e3b50
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs
@@ -0,0 +1,345 @@
+//! Definitions for uclibc on 64bit systems
+pub type blkcnt_t = i64;
+pub type blksize_t = i64;
+pub type clock_t = i64;
+pub type c_char = u8;
+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: ::key_t,
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::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: ::ipc_perm,
+        pub shm_segsz: ::size_t, // segment size in bytes
+        pub shm_atime: ::time_t, // time of last shmat()
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_lpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        __unused1: ::c_ulong,
+        __unused2: ::c_ulong
+    }
+
+    pub struct msqid_ds {
+        pub msg_perm: ::ipc_perm,
+        pub msg_stime: ::time_t,
+        pub msg_rtime: ::time_t,
+        pub msg_ctime: ::time_t,
+        __msg_cbytes: ::c_ulong,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        __ignored1: ::c_ulong,
+        __ignored2: ::c_ulong,
+    }
+
+    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: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        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,
+    }
+
+    // ------------------------------------------------------------
+    // 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],
+//        #[cfg(not(libc_align))]
+//        __align: [u32; 0],
+//    }
+
+    pub struct stat {
+        pub st_dev: ::c_ulong,
+        pub st_ino: ::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: ::nlink_t,
+        pub st_mode: ::mode_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::c_ulong, // dev_t
+        pub st_size: off_t, // file size
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_ulong,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_ulong,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_ulong,
+        st_pad4: [::c_long; 3]
+    }
+
+    pub struct sigaction {
+        pub sa_handler: ::sighandler_t,
+        pub sa_flags: ::c_ulong,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: ::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: ::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_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: ::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_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: ::socklen_t,
+        pub msg_iov: *mut ::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: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::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 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: ::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 = 02000;
+pub const O_ACCMODE: ::c_int = 0003;
+pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const O_CREAT: ::c_int = 0100;
+pub const O_DIRECTORY: ::c_int = 0200000;
+pub const O_EXCL: ::c_int = 0200;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const O_NONBLOCK: ::c_int = 04000;
+pub const O_TRUNC: ::c_int = 01000;
+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 = 04000;
+
+cfg_if! {
+    if #[cfg(target_os = "l4re")] {
+        mod l4re;
+        pub use self::l4re::*;
+    } else {
+        mod other;
+        pub use other::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs
new file mode 100644
index 00000000000..481577cfc27
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs
@@ -0,0 +1,5 @@
+// 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/mod.rs
new file mode 100644
index 00000000000..35c7598c911
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/linux_like/mod.rs
@@ -0,0 +1,1899 @@
+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: ::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: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_in6 {
+        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,
+    }
+
+    // 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 ::sockaddr,
+
+        pub ai_canonname: *mut c_char,
+
+        #[cfg(target_os = "android")]
+        pub ai_addr: *mut ::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 / 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: ::timespec,
+        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
+        pub sched_ss_init_budget: ::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: ::in_addr,
+        pub ipi_addr: ::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 ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct in6_rtmsg {
+        rtmsg_dst: ::in6_addr,
+        rtmsg_src: ::in6_addr,
+        rtmsg_gateway: ::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: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::sockaddr,
+        pub arp_dev: [::c_char; 16],
+    }
+
+    pub struct arpreq_old {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::sockaddr,
+        pub arp_flags: ::c_int,
+        pub arp_netmask: ::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: ::msghdr,
+        pub msg_len: ::c_uint,
+    }
+}
+
+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: ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 1;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
+pub const CLOCK_BOOTTIME: ::clockid_t = 7;
+pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
+pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
+pub const CLOCK_TAI: ::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: ::mode_t = 4096;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IRWXU: ::mode_t = 448;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IRWXG: ::mode_t = 56;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IRWXO: ::mode_t = 7;
+pub const S_IXOTH: ::mode_t = 1;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IROTH: ::mode_t = 4;
+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: ::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: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const VT0: ::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: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x1;
+pub const CS5: ::tcflag_t = 0x00000000;
+pub const CRTSCTS: ::tcflag_t = 0x80000000;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0o000010;
+pub const ONOCR: ::tcflag_t = 0o000020;
+pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o000100;
+pub const OFDEL: ::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;
+    }
+}
+
+const_fn! {
+    {const} fn CMSG_ALIGN(len: usize) -> usize {
+        len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
+    }
+}
+
+f! {
+    pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
+        if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
+            (*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::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) 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 & ::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;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+
+    pub fn pthread_getattr_np(native: ::pthread_t, 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 memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::size_t, ptr: *const ::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 ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+    pub fn mknodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::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: ::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 ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
+    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() -> ::pid_t;
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::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 fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
+}
+
+// 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;
+            pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
+            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;
+            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 ::DIR) -> *mut ::dirent64;
+            pub fn readdir64_r(
+                dirp: *mut ::DIR,
+                entry: *mut ::dirent64,
+                result: *mut *mut ::dirent64,
+            ) -> ::c_int;
+            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 ::iovec,
+                iovcnt: ::c_int,
+                offset: ::off64_t,
+            ) -> ::ssize_t;
+            pub fn pwritev64(
+                fd: ::c_int,
+                iov: *const ::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 ::winsize,
+            ) -> ::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 ::winsize,
+            ) -> ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/mod.rs
new file mode 100644
index 00000000000..3dca83305ad
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/mod.rs
@@ -0,0 +1,1616 @@
+//! 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.
+
+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: ::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,
+    }
+
+    // linux x32 compatibility
+    // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
+    pub struct timespec {
+        pub tv_sec: time_t,
+        #[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,
+    }
+
+    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
+    }
+
+    // <sys/time.h>
+    pub struct itimerval {
+        pub it_interval: ::timeval,
+        pub it_value: ::timeval,
+    }
+
+    // <sys/times.h>
+    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 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 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: ::mode_t = 0x800;
+pub const S_ISGID: ::mode_t = 0x400;
+pub const S_ISVTX: ::mode_t = 0x200;
+
+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 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;
+
+cfg_if! {
+    if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
+        // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
+    } 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 {}
+    } 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 {}
+    } else if #[cfg(target_os = "emscripten")] {
+        #[link(name = "c")]
+        extern {}
+    } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
+        #[link(name = "c", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "m", kind = "static", modifiers = "-bundle",
+            cfg(target_feature = "crt-static"))]
+        #[link(name = "m", cfg(not(target_feature = "crt-static")))]
+        #[link(name = "c", cfg(not(target_feature = "crt-static")))]
+        extern {}
+    } else if #[cfg(any(target_os = "macos",
+                        target_os = "ios",
+                        target_os = "tvos",
+                        target_os = "watchos",
+                        target_os = "android",
+                        target_os = "openbsd",
+                        target_os = "nto",
+                    ))] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        extern {}
+    } else if #[cfg(target_os = "haiku")] {
+        #[link(name = "root")]
+        #[link(name = "network")]
+        extern {}
+    } else if #[cfg(target_env = "newlib")] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        extern {}
+    } else if #[cfg(target_env = "illumos")] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        extern {}
+    } 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 {}
+    } else if #[cfg(target_env = "aix")] {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        #[link(name = "bsd")]
+        #[link(name = "pthread")]
+        extern {}
+    } else {
+        #[link(name = "c")]
+        #[link(name = "m")]
+        #[link(name = "rt")]
+        #[link(name = "pthread")]
+        extern {}
+    }
+}
+
+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<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
+    );
+    pub fn bsearch(
+        key: *const c_void,
+        base: *const c_void,
+        num: size_t,
+        size: size_t,
+        compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
+    ) -> *mut c_void;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "fopen$UNIX2003"
+    )]
+    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"
+    )]
+    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;
+    #[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")]
+    pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
+    #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
+    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;
+}
+
+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: ::uid_t) -> *mut passwd;
+
+    pub fn fprintf(stream: *mut ::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 ::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(
+        libc_cfg_target_vendor,
+        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 = "espidf", link_name = "lwip_socket")]
+    pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
+    #[cfg(not(all(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "connect$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "illumos", 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(
+        libc_cfg_target_vendor,
+        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(
+        libc_cfg_target_vendor,
+        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(
+        libc_cfg_target_vendor,
+        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")]
+    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(target_os = "illumos", 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(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "sendto$UNIX2003"
+    )]
+    #[cfg_attr(target_os = "illumos", 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"
+    )]
+    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"
+    )]
+    pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
+
+    pub fn pclose(stream: *mut ::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 ::FILE;
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "open$UNIX2003"
+    )]
+    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"
+    )]
+    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"
+    )]
+    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 ::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"
+    )]
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "closedir$UNIX2003"
+    )]
+    pub fn closedir(dirp: *mut ::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 ::DIR);
+
+    pub fn fchmodat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+    pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
+    pub fn fchownat(
+        dirfd: ::c_int,
+        pathname: *const ::c_char,
+        owner: ::uid_t,
+        group: ::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"
+    )]
+    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;
+    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;
+    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 pipe(fds: *mut ::c_int) -> ::c_int;
+    pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+    #[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")]
+    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: ::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(target_os = "illumos", 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"
+    )]
+    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"
+    )]
+    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")]
+    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"
+    )]
+    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"
+    )]
+    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;
+
+    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 signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")]
+    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"
+        ),
+        link_name = "realpath$DARWIN_EXTSN"
+    )]
+    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;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__times13")]
+    pub fn times(buf: *mut ::tms) -> ::clock_t;
+
+    pub fn pthread_self() -> ::pthread_t;
+    #[cfg_attr(
+        all(target_os = "macos", target_arch = "x86"),
+        link_name = "pthread_join$UNIX2003"
+    )]
+    pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::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_getstacksize(
+        attr: *const ::pthread_attr_t,
+        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_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
+    pub fn pthread_detach(thread: ::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<unsafe extern "C" fn(*mut ::c_void)>,
+    ) -> ::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"
+    )]
+    pub fn pthread_cond_timedwait(
+        cond: *mut pthread_cond_t,
+        lock: *mut pthread_mutex_t,
+        abstime: *const ::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(target_os = "illumos", link_name = "__xnet_getsockopt")]
+    #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")]
+    pub fn getsockopt(
+        sockfd: ::c_int,
+        level: ::c_int,
+        optname: ::c_int,
+        optval: *mut ::c_void,
+        optlen: *mut ::socklen_t,
+    ) -> ::c_int;
+    pub fn raise(signum: ::c_int) -> ::c_int;
+
+    #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
+    pub fn utimes(filename: *const ::c_char, times: *const ::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(
+        libc_cfg_target_vendor,
+        target_arch = "powerpc",
+        target_vendor = "nintendo"
+    )))]
+    #[cfg_attr(target_os = "illumos", 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(
+        libc_cfg_target_vendor,
+        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"
+        ),
+        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`
+    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`
+    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`
+    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`
+    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`
+    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`
+    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`
+    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`
+    pub fn timegm(tm: *mut ::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: ::mode_t, dev: ::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")]
+    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;
+    pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
+    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;
+
+    pub fn sysconf(name: ::c_int) -> ::c_long;
+
+    pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
+
+    pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::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 ::termios) -> ::speed_t;
+    pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
+    pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
+    pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
+    pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::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) -> ::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;
+    #[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;
+
+    pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int;
+
+}
+
+cfg_if! {
+    if #[cfg(not(any(target_os = "emscripten",
+                     target_os = "android",
+                     target_os = "haiku",
+                     target_os = "nto")))] {
+        extern "C" {
+            pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
+            pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
+        }
+    }
+}
+
+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(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 {
+            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: ::mode_t) -> ::c_int;
+            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 ::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/
+            pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
+                             result: *mut *mut ::dirent) -> ::c_int;
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(target_os = "nto")] {
+        extern {
+            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 {
+            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")]
+            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 {
+            pub fn cfmakeraw(termios: *mut ::termios);
+            pub fn cfsetspeed(termios: *mut ::termios,
+                              speed: ::speed_t) -> ::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 = "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 {
+        // Unknown target_os
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    } else {
+        mod no_align;
+        pub use self::no_align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/aarch64/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/aarch64/mod.rs
new file mode 100644
index 00000000000..2b4713c9a36
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/aarch64/mod.rs
@@ -0,0 +1,54 @@
+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: ::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: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    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 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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/align.rs
new file mode 100644
index 00000000000..db9beb83523
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/align.rs
@@ -0,0 +1,61 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            #[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; ::__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; ::__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; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            #[repr(align(8))]
+            pub struct pthread_cond_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            #[repr(align(4))]
+            pub struct pthread_condattr_t { // Unverified
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/arm/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/arm/mod.rs
new file mode 100644
index 00000000000..23b75977e63
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/arm/mod.rs
@@ -0,0 +1,56 @@
+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: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in6 {
+        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_in {
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [u8; 8],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/espidf/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/espidf/mod.rs
new file mode 100644
index 00000000000..409d7ad9bd7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/espidf/mod.rs
@@ -0,0 +1,110 @@
+pub type clock_t = ::c_ulong;
+pub type c_char = i8;
+pub type wchar_t = u32;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+
+s! {
+    pub struct cmsghdr {
+        pub cmsg_len: ::socklen_t,
+        pub cmsg_level: ::c_int,
+        pub cmsg_type: ::c_int,
+    }
+
+    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 sockaddr_un {
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 108],
+    }
+
+    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: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_scope_id: u32,
+    }
+
+    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_storage {
+        pub s2_len: u8,
+        pub ss_family: ::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;
+
+extern "C" {
+    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 getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+    #[link_name = "lwip_sendmsg"]
+    pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    #[link_name = "lwip_recvmsg"]
+    pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    pub fn eventfd(initval: ::c_uint, flags: ::c_int) -> ::c_int;
+}
+
+pub use crate::unix::newlib::generic::{dirent, sigset_t, stat};
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/generic.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/generic.rs
new file mode 100644
index 00000000000..e45413a7a9e
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/generic.rs
@@ -0,0 +1,33 @@
+//! Common types used by most newlib platforms
+
+s! {
+    pub struct sigset_t {
+        __val: [::c_ulong; 16],
+    }
+
+    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: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_atime: ::time_t,
+        pub st_spare1: ::c_long,
+        pub st_mtime: ::time_t,
+        pub st_spare2: ::c_long,
+        pub st_ctime: ::time_t,
+        pub st_spare3: ::c_long,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_spare4: [::c_long; 2usize],
+    }
+
+    pub struct dirent {
+        pub d_ino: ::ino_t,
+        pub d_type: ::c_uchar,
+        pub d_name: [::c_char; 256usize],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/horizon/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/horizon/mod.rs
new file mode 100644
index 00000000000..9c70f7b031b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/horizon/mod.rs
@@ -0,0 +1,270 @@
+//! ARMv6K Nintendo 3DS C Newlib definitions
+
+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 sockaddr {
+        pub sa_family: ::sa_family_t,
+        pub sa_data: [::c_char; 26usize],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        pub __ss_padding: [::c_char; 26usize],
+    }
+
+    pub struct sockaddr_in {
+        pub sin_family: ::sa_family_t,
+        pub sin_port: ::in_port_t,
+        pub sin_addr: ::in_addr,
+    }
+
+    pub struct sockaddr_in6 {
+        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_un {
+        pub sun_len: ::c_uchar,
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 104usize],
+    }
+
+    pub struct sched_param {
+        pub sched_priority: ::c_int,
+    }
+
+    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: ::uid_t,
+        pub st_gid: ::gid_t,
+        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: ::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 ::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_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_getprocessorid_np(
+        attr: *const ::pthread_attr_t,
+        processor_id: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setprocessorid_np(
+        attr: *mut ::pthread_attr_t,
+        processor_id: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::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_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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/mod.rs
new file mode 100644
index 00000000000..a572cc38bfd
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/mod.rs
@@ -0,0 +1,798 @@
+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;
+pub type tcflag_t = ::c_uint;
+pub type useconds_t = u32;
+
+cfg_if! {
+    if #[cfg(any(target_os = "horizon", all(target_os = "espidf", espidf_time64)))] {
+        pub type time_t = ::c_longlong;
+    } else {
+        pub type time_t = i32;
+    }
+}
+
+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(libc_cfg_target_vendor, 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: ::in_addr_t,
+    }
+
+    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,
+    }
+
+    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 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 / ULONG_SIZE],
+    }
+
+    pub struct passwd { // Unverified
+        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 termios { // Unverified
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+    }
+
+    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
+        __size: [u8; __SIZEOF_PTHREAD_ATTR_T]
+    }
+
+    pub struct pthread_rwlockattr_t { // Unverified
+        __size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T]
+    }
+}
+
+// unverified constants
+align_const! {
+    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],
+    };
+}
+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 {
+        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;
+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: ::mode_t = 1024;
+pub const S_IREAD: ::mode_t = 256;
+pub const S_IWRITE: ::mode_t = 128;
+pub const S_IEXEC: ::mode_t = 64;
+pub const S_ENFMT: ::mode_t = 1024;
+pub const S_IFMT: ::mode_t = 61440;
+pub const S_IFDIR: ::mode_t = 16384;
+pub const S_IFCHR: ::mode_t = 8192;
+pub const S_IFBLK: ::mode_t = 24576;
+pub const S_IFREG: ::mode_t = 32768;
+pub const S_IFLNK: ::mode_t = 40960;
+pub const S_IFSOCK: ::mode_t = 49152;
+pub const S_IFIFO: ::mode_t = 4096;
+pub const S_IRUSR: ::mode_t = 256;
+pub const S_IWUSR: ::mode_t = 128;
+pub const S_IXUSR: ::mode_t = 64;
+pub const S_IRGRP: ::mode_t = 32;
+pub const S_IWGRP: ::mode_t = 16;
+pub const S_IXGRP: ::mode_t = 8;
+pub const S_IROTH: ::mode_t = 4;
+pub const S_IWOTH: ::mode_t = 2;
+pub const S_IXOTH: ::mode_t = 1;
+
+pub const SOL_TCP: ::c_int = 6;
+
+pub const PF_UNSPEC: ::c_int = 0;
+pub const PF_INET: ::c_int = 2;
+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: ::clockid_t = 1;
+pub const CLOCK_MONOTONIC: ::clockid_t = 4;
+pub const CLOCK_BOOTTIME: ::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 {
+        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;
+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 {
+        pub const IP_TOS: ::c_int = 3;
+    }
+}
+cfg_if! {
+    if #[cfg(target_os = "vita")] {
+        pub const IP_TTL: ::c_int = 4;
+    } else {
+        pub const IP_TTL: ::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;
+cfg_if! {
+    if #[cfg(target_os = "vita")] {
+        pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+        pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+    } 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;
+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;
+
+pub const HOST_NOT_FOUND: ::c_int = 1;
+pub const NO_DATA: ::c_int = 2;
+pub const NO_ADDRESS: ::c_int = 2;
+pub const NO_RECOVERY: ::c_int = 3;
+pub const TRY_AGAIN: ::c_int = 4;
+
+pub const AI_PASSIVE: ::c_int = 1;
+pub const AI_CANONNAME: ::c_int = 2;
+pub const AI_NUMERICHOST: ::c_int = 4;
+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;
+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(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 ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::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(
+        libc_cfg_target_vendor,
+        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: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::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(
+        libc_cfg_target_vendor,
+        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(
+        libc_cfg_target_vendor,
+        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;
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group;
+    pub fn pthread_kill(thread: ::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: ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+    pub fn uname(buf: *mut ::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(libc_align)] {
+        #[macro_use]
+        mod align;
+    } else {
+        #[macro_use]
+        mod no_align;
+    }
+}
+expand_align!();
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/no_align.rs
new file mode 100644
index 00000000000..ce3aca4ed57
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/no_align.rs
@@ -0,0 +1,51 @@
+macro_rules! expand_align {
+    () => {
+        s! {
+            pub struct pthread_mutex_t { // Unverified
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "arm",
+                              target_arch = "powerpc")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
+            }
+
+            pub struct pthread_rwlock_t { // Unverified
+                #[cfg(any(target_arch = "mips",
+                          target_arch = "arm",
+                          target_arch = "powerpc"))]
+                __align: [::c_long; 0],
+                #[cfg(not(any(target_arch = "mips",
+                              target_arch = "arm",
+                              target_arch = "powerpc")))]
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
+            }
+
+            pub struct pthread_mutexattr_t { // Unverified
+                #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
+                          target_arch = "mips64", target_arch = "s390x",
+                          target_arch = "sparc64"))]
+                __align: [::c_int; 0],
+                #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+                              target_arch = "mips64", target_arch = "s390x",
+                              target_arch = "sparc64")))]
+                __align: [::c_long; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
+            }
+
+            pub struct pthread_cond_t { // Unverified
+                __align: [::c_longlong; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_COND_T],
+            }
+
+            pub struct pthread_condattr_t { // Unverified
+                __align: [::c_int; 0],
+                size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
+            }
+        }
+    };
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/powerpc/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/powerpc/mod.rs
new file mode 100644
index 00000000000..10faadbdf8c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/powerpc/mod.rs
@@ -0,0 +1,16 @@
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/newlib/vita/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/vita/mod.rs
new file mode 100644
index 00000000000..e80f061ea0c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/newlib/vita/mod.rs
@@ -0,0 +1,234 @@
+pub type clock_t = ::c_long;
+
+pub type c_char = i8;
+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: ::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 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: ::in_port_t,
+        pub sin6_flowinfo: u32,
+        pub sin6_addr: ::in6_addr,
+        pub sin6_vport: ::in_port_t,
+        pub sin6_scope_id: u32,
+    }
+
+    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_vport: ::in_port_t,
+        pub sin_zero: [u8; 6],
+    }
+
+    pub struct sockaddr_un {
+        pub ss_len: u8,
+        pub sun_family: ::sa_family_t,
+        pub sun_path: [::c_char; 108usize],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_len: u8,
+        pub ss_family: ::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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        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,
+        pub st_blocks: ::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 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 ::timespec) -> ::c_int;
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
+
+    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_attr_getschedparam(
+        attr: *const ::pthread_attr_t,
+        param: *mut sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setschedparam(
+        attr: *mut ::pthread_attr_t,
+        param: *const sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_getprocessorid_np(
+        attr: *const ::pthread_attr_t,
+        processor_id: *mut ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_attr_setprocessorid_np(
+        attr: *mut ::pthread_attr_t,
+        processor_id: ::c_int,
+    ) -> ::c_int;
+
+    pub fn pthread_getschedparam(
+        native: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::sched_param,
+    ) -> ::c_int;
+
+    pub fn pthread_setschedparam(
+        native: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::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_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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/no_align.rs b/libgrust/libformat_parser/vendor/libc/src/unix/no_align.rs
new file mode 100644
index 00000000000..f6b9f4c12d4
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/no_align.rs
@@ -0,0 +1,6 @@
+s! {
+    pub struct in6_addr {
+        pub s6_addr: [u8; 16],
+        __align: [u32; 0],
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/nto/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/nto/aarch64.rs
new file mode 100644
index 00000000000..6faf8159c71
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/nto/aarch64.rs
@@ -0,0 +1,36 @@
+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: [::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: ::aarch64_cpu_registers,
+        pub fpu: ::aarch64_fpu_registers,
+    }
+
+    pub struct stack_t {
+        pub ss_sp: *mut ::c_void,
+        pub ss_size: ::size_t,
+        pub ss_flags: ::c_int,
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/nto/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/nto/mod.rs
new file mode 100644
index 00000000000..9eef23458d1
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/nto/mod.rs
@@ -0,0 +1,3508 @@
+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 = ::uintptr_t;
+
+pub type pthread_mutex_t = ::sync_t;
+pub type pthread_mutexattr_t = ::_sync_attr;
+pub type pthread_cond_t = ::sync_t;
+pub type pthread_condattr_t = ::_sync_attr;
+pub type pthread_rwlockattr_t = ::_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: ::ino_t,
+        pub st_size: ::off_t,
+        pub st_dev: ::dev_t,
+        pub st_rdev: ::dev_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub __old_st_mtime: ::_Time32t,
+        pub __old_st_atime: ::_Time32t,
+        pub __old_st_ctime: ::_Time32t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_blocksize: ::blksize_t,
+        pub st_nblocks: i32,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_mtim:    ::timespec,
+        pub st_atim:    ::timespec,
+        pub st_ctim:    ::timespec,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: in_addr,
+        pub imr_interface: in_addr,
+    }
+
+    #[repr(packed)]
+    pub struct in_addr {
+        pub s_addr: ::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: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [i8; 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,
+    }
+
+    // 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 ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct fd_set {
+        fds_bits: [::c_uint; 2 * FD_SETSIZE / 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: ::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 ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::sockaddr,
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct arpreq {
+        pub arp_pa: ::sockaddr,
+        pub arp_ha: ::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: ::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: ::sighandler_t,
+        pub sa_flags: ::c_int,
+        pub sa_mask: ::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: ::uid_t,
+        pub pw_gid: ::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: ::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: ::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,
+    }
+
+    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; ::NCCS],
+        __reserved: [::c_uint; 3],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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: ::pid_t,
+        pub l_sysid: u32,
+    }
+
+    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_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: ::sigevent,
+        pub aio_lio_opcode: ::c_int,
+        pub _aio_lio_state: *mut ::c_void,
+        _aio_pad: [::c_int; 3],
+        pub _aio_next: *mut ::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: ::__sched_param,
+    }
+
+    pub struct pthread_attr_t {
+        __data1: ::c_long,
+        __data2: [u8; 96]
+    }
+
+    pub struct ipc_perm {
+        pub uid: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub seq: ::c_uint,
+        pub key: ::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<unsafe extern "C" fn(_fake: *mut ::c_void)>,
+        pub __policy: ::c_int,
+        pub __param: ::__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: ::uid_t,
+        pub sc_euid: ::uid_t,
+        pub sc_gid: ::gid_t,
+        pub sc_egid: ::gid_t,
+        pub sc_ngroups: ::c_int,
+        pub sc_groups: [::gid_t; 1],
+    }
+
+    pub struct bpf_program {
+        pub bf_len: ::c_uint,
+        pub bf_insns: *mut ::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: ::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: ::pid_t,
+        pub unp_euid: ::uid_t,
+        pub unp_egid: ::gid_t,
+    }
+
+    pub struct dl_phdr_info {
+        pub dlpi_addr: ::Elf64_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf64_Phdr,
+        pub dlpi_phnum: ::Elf64_Half,
+    }
+
+    #[repr(align(8))]
+    pub struct ucontext_t {
+        pub uc_link: *mut ucontext_t,
+        pub uc_sigmask: ::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: ::sigval,
+        __sigev_un2: usize, // union
+
+    }
+    pub struct dirent {
+        pub d_ino: ::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 ::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: ::ipc_perm,
+        pub msg_first: *mut ::msg,
+        pub msg_last: *mut ::msg,
+        pub msg_cbytes: ::msglen_t,
+        pub msg_qnum: ::msgqnum_t,
+        pub msg_qbytes: ::msglen_t,
+        pub msg_lspid: ::pid_t,
+        pub msg_lrpid: ::pid_t,
+        pub msg_stime: ::time_t,
+        msg_pad1: ::c_long,
+        pub msg_rtime: ::time_t,
+        msg_pad2: ::c_long,
+        pub msg_ctime: ::time_t,
+        msg_pad3: ::c_long,
+        msg_pad4: [::c_long; 4],
+    }
+
+    pub struct sockaddr_dl {
+        pub sdl_len: ::c_uchar,
+        pub sdl_family: ::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: ::pthread_mutex_t,     // union
+        pub __rcond: ::pthread_cond_t,     // union
+        pub __wcond: ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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: ::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: ::clockid_t = 0;
+pub const CLOCK_MONOTONIC: ::clockid_t = 2;
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 3;
+pub const CLOCK_THREAD_CPUTIME_ID: ::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: ::tcflag_t = 0x000;
+pub const NL1: ::tcflag_t = 0x100;
+pub const TAB0: ::tcflag_t = 0x0000;
+pub const CR0: ::tcflag_t = 0x000;
+pub const FF0: ::tcflag_t = 0x0000;
+pub const BS0: ::tcflag_t = 0x0000;
+pub const VT0: ::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: ::tcflag_t = 0x00000001;
+pub const BRKINT: ::tcflag_t = 0x00000002;
+pub const IGNPAR: ::tcflag_t = 0x00000004;
+pub const PARMRK: ::tcflag_t = 0x00000008;
+pub const INPCK: ::tcflag_t = 0x00000010;
+pub const ISTRIP: ::tcflag_t = 0x00000020;
+pub const INLCR: ::tcflag_t = 0x00000040;
+pub const IGNCR: ::tcflag_t = 0x00000080;
+pub const ICRNL: ::tcflag_t = 0x00000100;
+pub const IXANY: ::tcflag_t = 0x00000800;
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
+pub const OPOST: ::tcflag_t = 0x00000001;
+pub const CS5: ::tcflag_t = 0x00;
+pub const ECHO: ::tcflag_t = 0x00000008;
+pub const OCRNL: ::tcflag_t = 0x00000008;
+pub const ONOCR: ::tcflag_t = 0x00000010;
+pub const ONLRET: ::tcflag_t = 0x00000020;
+pub const OFILL: ::tcflag_t = 0x00000040;
+pub const OFDEL: ::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: ::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 ::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;
+
+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 = ::S_IXUSR;
+pub const S_IWRITE: mode_t = ::S_IWUSR;
+pub const S_IREAD: mode_t = ::S_IRUSR;
+
+pub const S_IFIFO: ::mode_t = 0x1000;
+pub const S_IFCHR: ::mode_t = 0x2000;
+pub const S_IFDIR: ::mode_t = 0x4000;
+pub const S_IFBLK: ::mode_t = 0x6000;
+pub const S_IFREG: ::mode_t = 0x8000;
+pub const S_IFLNK: ::mode_t = 0xA000;
+pub const S_IFSOCK: ::mode_t = 0xC000;
+pub const S_IFMT: ::mode_t = 0xF000;
+
+pub const S_IXOTH: ::mode_t = 0o000001;
+pub const S_IWOTH: ::mode_t = 0o000002;
+pub const S_IROTH: ::mode_t = 0o000004;
+pub const S_IRWXO: ::mode_t = 0o000007;
+pub const S_IXGRP: ::mode_t = 0o000010;
+pub const S_IWGRP: ::mode_t = 0o000020;
+pub const S_IRGRP: ::mode_t = 0o000040;
+pub const S_IRWXG: ::mode_t = 0o000070;
+pub const S_IXUSR: ::mode_t = 0o000100;
+pub const S_IWUSR: ::mode_t = 0o000200;
+pub const S_IRUSR: ::mode_t = 0o000400;
+pub const S_IRWXU: ::mode_t = 0o000700;
+
+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: ::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 = ::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: ::tcflag_t = 15;
+pub const CBAUD: ::tcflag_t = _TIO_CBAUD;
+pub const TAB1: ::tcflag_t = 0x0800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::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: ::tcflag_t = 0x00000400;
+pub const IXOFF: ::tcflag_t = 0x00001000;
+pub const ONLCR: ::tcflag_t = 0x00000004;
+pub const CSIZE: ::tcflag_t = 0x00000030;
+pub const CS6: ::tcflag_t = 0x10;
+pub const CS7: ::tcflag_t = 0x20;
+pub const CS8: ::tcflag_t = 0x30;
+pub const CSTOPB: ::tcflag_t = 0x00000040;
+pub const CREAD: ::tcflag_t = 0x00000080;
+pub const PARENB: ::tcflag_t = 0x00000100;
+pub const PARODD: ::tcflag_t = 0x00000200;
+pub const HUPCL: ::tcflag_t = 0x00000400;
+pub const CLOCAL: ::tcflag_t = 0x00000800;
+pub const ECHOKE: ::tcflag_t = 0x00000800;
+pub const ECHOE: ::tcflag_t = 0x00000010;
+pub const ECHOK: ::tcflag_t = 0x00000020;
+pub const ECHONL: ::tcflag_t = 0x00000040;
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
+pub const ISIG: ::tcflag_t = 0x00000001;
+pub const ICANON: ::tcflag_t = 0x00000002;
+pub const NOFLSH: ::tcflag_t = 0x00000080;
+pub const OLCUC: ::tcflag_t = 0x00000002;
+pub const NLDLY: ::tcflag_t = 0x00000100;
+pub const CRDLY: ::tcflag_t = 0x00000600;
+pub const TABDLY: ::tcflag_t = 0x00001800;
+pub const BSDLY: ::tcflag_t = 0x00002000;
+pub const FFDLY: ::tcflag_t = 0x00008000;
+pub const VTDLY: ::tcflag_t = 0x00004000;
+pub const XTABS: ::tcflag_t = 0x1800;
+
+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 EXTA: ::speed_t = 14;
+pub const EXTB: ::speed_t = 15;
+pub const B57600: ::speed_t = 57600;
+pub const B115200: ::speed_t = 115200;
+
+pub const VEOL: usize = 5;
+pub const VEOL2: usize = 6;
+pub const VMIN: usize = 16;
+pub const IEXTEN: ::tcflag_t = 0x00008000;
+pub const TOSTOP: ::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: ::nl_item = 8;
+pub const DAY_2: ::nl_item = 9;
+pub const DAY_3: ::nl_item = 10;
+pub const DAY_4: ::nl_item = 11;
+pub const DAY_5: ::nl_item = 12;
+pub const DAY_6: ::nl_item = 13;
+pub const DAY_7: ::nl_item = 14;
+
+pub const MON_1: ::nl_item = 22;
+pub const MON_2: ::nl_item = 23;
+pub const MON_3: ::nl_item = 24;
+pub const MON_4: ::nl_item = 25;
+pub const MON_5: ::nl_item = 26;
+pub const MON_6: ::nl_item = 27;
+pub const MON_7: ::nl_item = 28;
+pub const MON_8: ::nl_item = 29;
+pub const MON_9: ::nl_item = 30;
+pub const MON_10: ::nl_item = 31;
+pub const MON_11: ::nl_item = 32;
+pub const MON_12: ::nl_item = 33;
+
+pub const ABDAY_1: ::nl_item = 15;
+pub const ABDAY_2: ::nl_item = 16;
+pub const ABDAY_3: ::nl_item = 17;
+pub const ABDAY_4: ::nl_item = 18;
+pub const ABDAY_5: ::nl_item = 19;
+pub const ABDAY_6: ::nl_item = 20;
+pub const ABDAY_7: ::nl_item = 21;
+
+pub const ABMON_1: ::nl_item = 34;
+pub const ABMON_2: ::nl_item = 35;
+pub const ABMON_3: ::nl_item = 36;
+pub const ABMON_4: ::nl_item = 37;
+pub const ABMON_5: ::nl_item = 38;
+pub const ABMON_6: ::nl_item = 39;
+pub const ABMON_7: ::nl_item = 40;
+pub const ABMON_8: ::nl_item = 41;
+pub const ABMON_9: ::nl_item = 42;
+pub const ABMON_10: ::nl_item = 43;
+pub const ABMON_11: ::nl_item = 44;
+pub const ABMON_12: ::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: ::nl_item = 50;
+pub const AM_STR: ::nl_item = 6;
+pub const B76800: ::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::<::c_long>();
+pub const CHAR_BIT: usize = 8;
+pub const CODESET: ::nl_item = 1;
+pub const CRNCYSTR: ::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: ::nl_item = 3;
+pub const D_GETFLAG: ::c_int = 1;
+pub const D_SETFLAG: ::c_int = 2;
+pub const D_T_FMT: ::nl_item = 2;
+pub const ERA: ::nl_item = 46;
+pub const ERA_D_FMT: ::nl_item = 47;
+pub const ERA_D_T_FMT: ::nl_item = 48;
+pub const ERA_T_FMT: ::nl_item = 49;
+pub const RADIXCHAR: ::nl_item = 51;
+pub const THOUSEP: ::nl_item = 52;
+pub const YESEXPR: ::nl_item = 53;
+pub const NOEXPR: ::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: ::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::<i64>();
+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: ::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_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::<usize>() - 1 & !(::mem::size_of::<usize>() - 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::<cmsghdr>() {
+            (*mhdr).msg_control as *mut cmsghdr
+        } else {
+            0 as *mut cmsghdr
+        }
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::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::<::cmsghdr>());
+        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::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (_CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + _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 ::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 ::dirent_extra
+    }
+
+    pub fn _DEXTRA_VALID(_x: *const ::dirent_extra, _d: *const dirent) -> bool {
+        let sz = _x as usize - _d as usize + ::mem::size_of::<::dirent_extra>();
+        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 ::dirent_extra) -> *mut ::dirent_extra {
+        _ALIGN(
+            _x as usize + ::mem::size_of::<::dirent_extra>() + (*_x).d_datalen as usize, 8
+        ) as *mut ::dirent_extra
+    }
+
+    pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
+        let ngrps = if ngrps > 0 {
+            ngrps - 1
+        } else {
+            0
+        };
+        ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
+    }
+
+    pub fn major(dev: ::dev_t) -> ::c_uint {
+        ((dev as ::c_uint) >> 10) & 0x3f
+    }
+
+    pub fn minor(dev: ::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 & ::IPTOS_ECN_MASK
+    }
+
+    pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+        ((major << 10) | (minor)) as ::dev_t
+    }
+}
+
+// Network related functions are provided by libsocket and regex
+// functions are provided by libregex.
+#[link(name = "socket")]
+#[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: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
+    pub fn mknodat(
+        __fd: ::c_int,
+        pathname: *const ::c_char,
+        mode: ::mode_t,
+        dev: ::dev_t,
+    ) -> ::c_int;
+
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_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 memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::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 ::timespec) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::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: ::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 ::siginfo_t, options: ::c_int)
+        -> ::c_int;
+    pub fn wait4(
+        pid: ::pid_t,
+        status: *mut ::c_int,
+        options: ::c_int,
+        rusage: *mut ::rusage,
+    ) -> ::pid_t;
+    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 ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::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 ::winsize,
+    ) -> ::c_int;
+    pub fn forkpty(
+        amaster: *mut ::c_int,
+        name: *mut ::c_char,
+        termp: *mut termios,
+        winp: *mut ::winsize,
+    ) -> ::pid_t;
+    pub fn login_tty(fd: ::c_int) -> ::c_int;
+
+    pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+    pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::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 ::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) -> ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+    pub fn pthread_setschedprio(native: ::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<extern "C" fn(epath: *const c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+    pub fn globfree(pglob: *mut ::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 ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::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 ::sockaddr,
+        addrlen: *mut ::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: ::pthread_t,
+        policy: *mut ::c_int,
+        param: *mut ::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 ::timeval, tz: *const ::c_void) -> ::c_int;
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+    pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const ::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: ::pid_t, param: *mut ::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 ::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_barrierattr_init(__attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_destroy(__attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+    pub fn pthread_barrierattr_getpshared(
+        __attr: *const ::pthread_barrierattr_t,
+        __pshared: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrierattr_setpshared(
+        __attr: *mut ::pthread_barrierattr_t,
+        __pshared: ::c_int,
+    ) -> ::c_int;
+    pub fn pthread_barrier_init(
+        __barrier: *mut ::pthread_barrier_t,
+        __attr: *const ::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 sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::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 ::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: ::pthread_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn initgroups(user: *const ::c_char, group: ::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 ::group;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::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: ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::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 ::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 getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+    pub fn setitimer(
+        which: ::c_int,
+        value: *const ::itimerval,
+        ovalue: *mut ::itimerval,
+    ) -> ::c_int;
+    pub fn posix_spawn(
+        pid: *mut ::pid_t,
+        path: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_spawnp(
+        pid: *mut ::pid_t,
+        file: *const ::c_char,
+        file_actions: *const ::posix_spawn_file_actions_t,
+        attrp: *const ::posix_spawnattr_t,
+        argv: *const *mut ::c_char,
+        envp: *const *mut ::c_char,
+    ) -> ::c_int;
+    pub fn posix_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 ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigdefault(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_getsigmask(
+        attr: *const posix_spawnattr_t,
+        default: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setsigmask(
+        attr: *mut posix_spawnattr_t,
+        default: *const ::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 ::pid_t,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::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 ::sched_param,
+    ) -> ::c_int;
+    pub fn posix_spawnattr_setschedparam(
+        attr: *mut posix_spawnattr_t,
+        param: *const ::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: ::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 ::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() -> ::pid_t;
+
+    pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+
+    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 sendmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn recvmmsg(
+        sockfd: ::c_int,
+        msgvec: *mut ::mmsghdr,
+        vlen: ::c_uint,
+        flags: ::c_uint,
+        timeout: *mut ::timespec,
+    ) -> ::c_int;
+
+    pub fn mallopt(param: ::c_int, value: i64) -> ::c_int;
+    pub fn gettimeofday(tp: *mut ::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() -> ::mallinfo;
+    pub fn getpwent_r(
+        pwd: *mut ::passwd,
+        buf: *mut ::c_char,
+        __bufsize: ::c_int,
+        __result: *mut *mut ::passwd,
+    ) -> ::c_int;
+    pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::c_int) -> ::c_int;
+    pub fn pthread_setname_np(thread: ::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 ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlp: *const ::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(
+                info: *const 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 ::regex_t,
+        __pattern: *const ::c_char,
+        __cflags: ::c_int,
+    ) -> ::c_int;
+    pub fn regexec(
+        __preg: *const ::regex_t,
+        __str: *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 dirfd(__dirp: *mut ::DIR) -> ::c_int;
+    pub fn dircntl(dir: *mut ::DIR, cmd: ::c_int, ...) -> ::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(__operation: ::c_int, __aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_read(__aiocbp: *mut ::aiocb) -> ::c_int;
+    pub fn aio_return(__aiocpb: *mut ::aiocb) -> ::ssize_t;
+    pub fn aio_suspend(
+        __list: *const *const ::aiocb,
+        __nent: ::c_int,
+        __timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn aio_write(__aiocpb: *mut ::aiocb) -> ::c_int;
+
+    pub fn mq_close(__mqdes: ::mqd_t) -> ::c_int;
+    pub fn mq_getattr(__mqdes: ::mqd_t, __mqstat: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_notify(__mqdes: ::mqd_t, __notification: *const ::sigevent) -> ::c_int;
+    pub fn mq_open(__name: *const ::c_char, __oflag: ::c_int, ...) -> ::mqd_t;
+    pub fn mq_receive(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *mut ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *const ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_setattr(
+        __mqdes: ::mqd_t,
+        __mqstat: *const mq_attr,
+        __omqstat: *mut mq_attr,
+    ) -> ::c_int;
+    pub fn mq_timedreceive(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *mut ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: *mut ::c_uint,
+        __abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_timedsend(
+        __mqdes: ::mqd_t,
+        __msg_ptr: *const ::c_char,
+        __msg_len: ::size_t,
+        __msg_prio: ::c_uint,
+        __abs_timeout: *const ::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) -> ::sigval {
+        #[repr(C)]
+        struct siginfo_si_value {
+            _pad: [u8; 32],
+            si_value: ::sigval,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_value)).si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        #[repr(C)]
+        struct siginfo_si_pid {
+            _pad: [u8; 16],
+            si_pid: ::pid_t,
+        }
+        (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::uid_t {
+        #[repr(C)]
+        struct siginfo_si_uid {
+            _pad: [u8; 24],
+            si_uid: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/nto/neutrino.rs b/libgrust/libformat_parser/vendor/libc/src/unix/nto/neutrino.rs
new file mode 100644
index 00000000000..1a6f7da9cec
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/nto/neutrino.rs
@@ -0,0 +1,1288 @@
+pub type nto_job_t = ::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: ::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: ::uid_t,
+        pub euid: ::uid_t,
+        pub suid: ::uid_t,
+        pub rgid: ::gid_t,
+        pub egid: ::gid_t,
+        pub sgid: ::gid_t,
+        pub ngroups: u32,
+        pub grouplist: [::gid_t; 8],
+    }
+
+    pub struct _client_info {
+        pub nd: u32,
+        pub pid: ::pid_t,
+        pub sid: ::pid_t,
+        pub flags: u32,
+        pub cred: ::_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: ::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 ::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: ::_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: ::sigevent,
+    //    pub num_curmsg: ::c_uint,
+    //    pub ttimer: ::timer_t,
+    //    pub block_con: ::pthread_cond_t,
+    //    pub mu: ::pthread_mutex_t,
+    //    reserved: ::c_uint,
+    //    pub attr: ::_asyncmsg_connection_attr,
+    //    pub reserves: [::c_uint; 3],
+    //    pub sendq: [::_asyncmsg_put_header; 1], // flexarray
+    //}
+
+    pub struct __c_anonymous_struct_ev {
+        pub event: ::sigevent,
+        pub coid: ::c_int,
+    }
+
+    pub struct _channel_connect_attr {  // union
+        pub ev: ::__c_anonymous_struct_ev,
+    }
+
+    pub struct _sighandler_info {
+        pub siginfo: ::siginfo_t,
+        pub handler: ::Option<unsafe extern "C" fn(value: ::c_int)>,
+        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: ::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: ::_itimer,
+        pub otime: ::_itimer,
+        pub flags: u32,
+        pub tid: i32,
+        pub notify: i32,
+        pub clockid: ::clockid_t,
+        pub overruns: u32,
+        pub event: ::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: ::mode_t,
+        __bufsize: usize,
+        __maxnumbuf: ::c_uint,
+        __ev: *const ::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: ::pid_t,
+        __chid: ::c_int,
+        __index: ::c_uint,
+        __flags: ::c_int,
+    ) -> ::c_int;
+    pub fn ConnectAttach_r(
+        __nd: u32,
+        __pid: ::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: ::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: ::pid_t, __coid: ::c_int, __info: *mut _msg_info64) -> ::c_int;
+    pub fn ConnectServerInfo_r(
+        __pid: ::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: ::pid_t,
+        __coid: ::c_int,
+        __mask: ::c_uint,
+        __bits: ::c_uint,
+    ) -> ::c_int;
+    pub fn ConnectFlags_r(
+        __pid: ::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 ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsv_r(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsvnc(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendsvnc_r(
+        __coid: ::c_int,
+        __smsg: *const ::c_void,
+        __sbytes: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvs(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvs_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvsnc(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvsnc_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __rmsg: *mut ::c_void,
+        __rbytes: usize,
+    ) -> ::c_long;
+    pub fn MsgSendv(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendv_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvnc(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::iovec,
+        __rparts: usize,
+    ) -> ::c_long;
+    pub fn MsgSendvnc_r(
+        __coid: ::c_int,
+        __siov: *const ::iovec,
+        __sparts: usize,
+        __riov: *const ::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 ::iovec,
+        __parts: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivev_r(
+        __chid: ::c_int,
+        __iov: *const ::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 ::iovec,
+        __parts: usize,
+        __info: *mut _msg_info64,
+    ) -> ::c_int;
+    pub fn MsgReceivePulsev_r(
+        __chid: ::c_int,
+        __iov: *const ::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 ::iovec,
+        __parts: usize,
+    ) -> ::c_int;
+    pub fn MsgReplyv_r(
+        __rcvid: ::c_int,
+        __status: ::c_long,
+        __iov: *const ::iovec,
+        __parts: usize,
+    ) -> ::c_int;
+    pub fn MsgReadiov(
+        __rcvid: ::c_int,
+        __iov: *const ::iovec,
+        __parts: usize,
+        __offset: usize,
+        __flags: ::c_int,
+    ) -> isize;
+    pub fn MsgReadiov_r(
+        __rcvid: ::c_int,
+        __iov: *const ::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 ::iovec,
+        __parts: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgReadv_r(
+        __rcvid: ::c_int,
+        __iov: *const ::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 ::iovec,
+        __parts: usize,
+        __offset: usize,
+    ) -> isize;
+    pub fn MsgWritev_r(
+        __rcvid: ::c_int,
+        __iov: *const ::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 ::sigevent) -> ::c_int;
+    pub fn MsgDeliverEvent_r(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgVerifyEvent(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgVerifyEvent_r(__rcvid: ::c_int, __event: *const ::sigevent) -> ::c_int;
+    pub fn MsgRegisterEvent(__event: *mut ::sigevent, __coid: ::c_int) -> ::c_int;
+    pub fn MsgRegisterEvent_r(__event: *mut ::sigevent, __coid: ::c_int) -> ::c_int;
+    pub fn MsgUnregisterEvent(__event: *const ::sigevent) -> ::c_int;
+    pub fn MsgUnregisterEvent_r(__event: *const ::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 ::iovec,
+        __parts: ::c_int,
+    ) -> ::c_int;
+    pub fn MsgKeyData_r(
+        __rcvid: ::c_int,
+        __oper: ::c_int,
+        __key: u32,
+        __newkey: *mut u32,
+        __iov: *const ::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 ::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: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: ::c_int,
+    ) -> ::c_int;
+    pub fn SignalKill_r(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: ::c_int,
+    ) -> ::c_int;
+    pub fn SignalKillSigval(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: *const ::sigval,
+    ) -> ::c_int;
+    pub fn SignalKillSigval_r(
+        __nd: u32,
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __signo: ::c_int,
+        __code: ::c_int,
+        __value: *const ::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: ::pid_t,
+        __sigstub: unsafe extern "C" fn(),
+        __signo: ::c_int,
+        __act: *const ::sigaction,
+        __oact: *mut ::sigaction,
+    ) -> ::c_int;
+    pub fn SignalAction_r(
+        __pid: ::pid_t,
+        __sigstub: unsafe extern "C" fn(),
+        __signo: ::c_int,
+        __act: *const ::sigaction,
+        __oact: *mut ::sigaction,
+    ) -> ::c_int;
+    pub fn SignalProcmask(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __how: ::c_int,
+        __set: *const ::sigset_t,
+        __oldset: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn SignalProcmask_r(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __how: ::c_int,
+        __set: *const ::sigset_t,
+        __oldset: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn SignalSuspend(__set: *const ::sigset_t) -> ::c_int;
+    pub fn SignalSuspend_r(__set: *const ::sigset_t) -> ::c_int;
+    pub fn SignalWaitinfo(__set: *const ::sigset_t, __info: *mut ::siginfo_t) -> ::c_int;
+    pub fn SignalWaitinfo_r(__set: *const ::sigset_t, __info: *mut ::siginfo_t) -> ::c_int;
+    pub fn SignalWaitinfoMask(
+        __set: *const ::sigset_t,
+        __info: *mut ::siginfo_t,
+        __mask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn SignalWaitinfoMask_r(
+        __set: *const ::sigset_t,
+        __info: *mut ::siginfo_t,
+        __mask: *const ::sigset_t,
+    ) -> ::c_int;
+    pub fn ThreadCreate(
+        __pid: ::pid_t,
+        __func: unsafe extern "C" fn(__arg: *mut ::c_void) -> *mut ::c_void,
+        __arg: *mut ::c_void,
+        __attr: *const ::_thread_attr,
+    ) -> ::c_int;
+    pub fn ThreadCreate_r(
+        __pid: ::pid_t,
+        __func: unsafe extern "C" fn(__arg: *mut ::c_void) -> *mut ::c_void,
+        __arg: *mut ::c_void,
+        __attr: *const ::_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: ::pid_t,
+        __tid: ::c_int,
+        __cmd: ::c_int,
+        __data: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn ThreadCtlExt_r(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __cmd: ::c_int,
+        __data: *mut ::c_void,
+    ) -> ::c_int;
+
+    pub fn InterruptHookTrace(
+        __handler: ::Option<unsafe extern "C" fn(arg1: ::c_int) -> *const ::sigevent>,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptHookIdle(
+        __handler: ::Option<unsafe extern "C" fn(arg1: *mut u64, arg2: *mut qtime_entry)>,
+        __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 ::sigevent, __flags: ::c_uint) -> ::c_int;
+    pub fn InterruptAttachEvent(
+        __intr: ::c_int,
+        __event: *const ::sigevent,
+        __flags: ::c_uint,
+    ) -> ::c_int;
+    pub fn InterruptAttachEvent_r(
+        __intr: ::c_int,
+        __event: *const ::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 ::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 ::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 ::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 ::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: ::pid_t, __tid: ::c_int, __param: *mut ::sched_param) -> ::c_int;
+    pub fn SchedGet_r(__pid: ::pid_t, __tid: ::c_int, __param: *mut ::sched_param) -> ::c_int;
+    pub fn SchedGetCpuNum() -> ::c_uint;
+    pub fn SchedSet(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __algorithm: ::c_int,
+        __param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn SchedSet_r(
+        __pid: ::pid_t,
+        __tid: ::c_int,
+        __algorithm: ::c_int,
+        __param: *const ::sched_param,
+    ) -> ::c_int;
+    pub fn SchedInfo(__pid: ::pid_t, __algorithm: ::c_int, __info: *mut ::_sched_info) -> ::c_int;
+    pub fn SchedInfo_r(__pid: ::pid_t, __algorithm: ::c_int, __info: *mut ::_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: ::clockid_t, __notify: *const ::sigevent) -> ::c_int;
+    pub fn TimerCreate_r(__id: ::clockid_t, __notify: *const ::sigevent) -> ::c_int;
+    pub fn TimerDestroy(__id: ::timer_t) -> ::c_int;
+    pub fn TimerDestroy_r(__id: ::timer_t) -> ::c_int;
+    pub fn TimerSettime(
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __itime: *const ::_itimer,
+        __oitime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerSettime_r(
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __itime: *const ::_itimer,
+        __oitime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerInfo(
+        __pid: ::pid_t,
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __info: *mut ::_timer_info,
+    ) -> ::c_int;
+    pub fn TimerInfo_r(
+        __pid: ::pid_t,
+        __id: ::timer_t,
+        __flags: ::c_int,
+        __info: *mut ::_timer_info,
+    ) -> ::c_int;
+    pub fn TimerAlarm(
+        __id: ::clockid_t,
+        __itime: *const ::_itimer,
+        __otime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerAlarm_r(
+        __id: ::clockid_t,
+        __itime: *const ::_itimer,
+        __otime: *mut ::_itimer,
+    ) -> ::c_int;
+    pub fn TimerTimeout(
+        __id: ::clockid_t,
+        __flags: ::c_int,
+        __notify: *const ::sigevent,
+        __ntime: *const u64,
+        __otime: *mut u64,
+    ) -> ::c_int;
+    pub fn TimerTimeout_r(
+        __id: ::clockid_t,
+        __flags: ::c_int,
+        __notify: *const ::sigevent,
+        __ntime: *const u64,
+        __otime: *mut u64,
+    ) -> ::c_int;
+
+    pub fn SyncTypeCreate(
+        __type: ::c_uint,
+        __sync: *mut ::sync_t,
+        __attr: *const ::_sync_attr,
+    ) -> ::c_int;
+    pub fn SyncTypeCreate_r(
+        __type: ::c_uint,
+        __sync: *mut ::sync_t,
+        __attr: *const ::_sync_attr,
+    ) -> ::c_int;
+    pub fn SyncDestroy(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncDestroy_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCtl(__cmd: ::c_int, __sync: *mut ::sync_t, __data: *mut ::c_void) -> ::c_int;
+    pub fn SyncCtl_r(__cmd: ::c_int, __sync: *mut ::sync_t, __data: *mut ::c_void) -> ::c_int;
+    pub fn SyncMutexEvent(__sync: *mut ::sync_t, event: *const ::sigevent) -> ::c_int;
+    pub fn SyncMutexEvent_r(__sync: *mut ::sync_t, event: *const ::sigevent) -> ::c_int;
+    pub fn SyncMutexLock(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexLock_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexUnlock(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexUnlock_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexRevive(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncMutexRevive_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCondvarWait(__sync: *mut ::sync_t, __mutex: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCondvarWait_r(__sync: *mut ::sync_t, __mutex: *mut ::sync_t) -> ::c_int;
+    pub fn SyncCondvarSignal(__sync: *mut ::sync_t, __all: ::c_int) -> ::c_int;
+    pub fn SyncCondvarSignal_r(__sync: *mut ::sync_t, __all: ::c_int) -> ::c_int;
+    pub fn SyncSemPost(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncSemPost_r(__sync: *mut ::sync_t) -> ::c_int;
+    pub fn SyncSemWait(__sync: *mut ::sync_t, __tryto: ::c_int) -> ::c_int;
+    pub fn SyncSemWait_r(__sync: *mut ::sync_t, __tryto: ::c_int) -> ::c_int;
+
+    pub fn ClockTime(__id: ::clockid_t, _new: *const u64, __old: *mut u64) -> ::c_int;
+    pub fn ClockTime_r(__id: ::clockid_t, _new: *const u64, __old: *mut u64) -> ::c_int;
+    pub fn ClockAdjust(
+        __id: ::clockid_t,
+        _new: *const ::_clockadjust,
+        __old: *mut ::_clockadjust,
+    ) -> ::c_int;
+    pub fn ClockAdjust_r(
+        __id: ::clockid_t,
+        _new: *const ::_clockadjust,
+        __old: *mut ::_clockadjust,
+    ) -> ::c_int;
+    pub fn ClockPeriod(
+        __id: ::clockid_t,
+        _new: *const ::_clockperiod,
+        __old: *mut ::_clockperiod,
+        __reserved: ::c_int,
+    ) -> ::c_int;
+    pub fn ClockPeriod_r(
+        __id: ::clockid_t,
+        _new: *const ::_clockperiod,
+        __old: *mut ::_clockperiod,
+        __reserved: ::c_int,
+    ) -> ::c_int;
+    pub fn ClockId(__pid: ::pid_t, __tid: ::c_int) -> ::c_int;
+    pub fn ClockId_r(__pid: ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/nto/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/nto/x86_64.rs
new file mode 100644
index 00000000000..3a1d230bb98
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/nto/x86_64.rs
@@ -0,0 +1,132 @@
+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,
+        #[cfg(libc_union)]
+        pub fpu: x86_64_fpu_registers,
+        #[cfg(not(libc_union))]
+        __reserved: [u8; 1024],
+    }
+
+    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! {
+    #[cfg(libc_union)]
+    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")] {
+        #[cfg(libc_union)]
+        impl Eq for x86_64_fpu_registers {}
+
+        #[cfg(libc_union)]
+        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
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for x86_64_fpu_registers {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    f.debug_struct("x86_64_fpu_registers")
+                        .field("fsave_area", &self.fsave_area)
+                        .field("fxsave_area", &self.fxsave_area)
+                        .field("xsave_area", &self.xsave_area)
+                        .finish()
+                }
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl ::hash::Hash for x86_64_fpu_registers {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                    self.fsave_area.hash(state);
+                    self.fxsave_area.hash(state);
+                    self.xsave_area.hash(state);
+                }
+            }
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/redox/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/redox/mod.rs
new file mode 100644
index 00000000000..19315c3872c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/redox/mod.rs
@@ -0,0 +1,1416 @@
+pub type c_char = i8;
+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_ulong;
+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: ::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: ::sa_family_t,
+        pub sun_path: [::c_char; 108]
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        __ss_padding: [
+            u8;
+            128 -
+            ::core::mem::size_of::<sa_family_t>() -
+            ::core::mem::size_of::<c_ulong>()
+        ],
+        __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 ::sockaddr,
+        pub ai_next: *mut ::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; ::FD_SETSIZE / ULONG_SIZE],
+    }
+
+    pub struct in_addr {
+        pub s_addr: ::in_addr_t,
+    }
+
+    pub struct ip_mreq {
+        pub imr_multiaddr: ::in_addr,
+        pub imr_interface: ::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: ::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 sigaction {
+        pub sa_sigaction: ::sighandler_t,
+        pub sa_flags: ::c_ulong,
+        pub sa_restorer: ::Option<extern fn()>,
+        pub sa_mask: ::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: ::sa_family_t,
+        pub sa_data: [::c_char; 14],
+    }
+
+    pub struct sockaddr_in {
+        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_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 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,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_t,
+        pub st_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_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,
+        _pad: [::c_char; 24],
+    }
+
+    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 termios {
+        pub c_iflag: ::tcflag_t,
+        pub c_oflag: ::tcflag_t,
+        pub c_cflag: ::tcflag_t,
+        pub c_lflag: ::tcflag_t,
+        pub c_line: ::cc_t,
+        pub c_cc: [::cc_t; ::NCCS],
+        pub c_ispeed: ::speed_t,
+        pub c_ospeed: ::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 = ::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 IPPROTO_RAW: ::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: ::pthread_mutex_t = ::pthread_mutex_t {
+    bytes: [0; _PTHREAD_MUTEX_SIZE],
+};
+pub const PTHREAD_COND_INITIALIZER: ::pthread_cond_t = ::pthread_cond_t {
+    bytes: [0; _PTHREAD_COND_SIZE],
+};
+pub const PTHREAD_RWLOCK_INITIALIZER: ::pthread_rwlock_t = ::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 = 1;
+pub const EPOLLPRI: ::c_int = 0;
+pub const EPOLLOUT: ::c_int = 2;
+pub const EPOLLRDNORM: ::c_int = 0;
+pub const EPOLLNVAL: ::c_int = 0;
+pub const EPOLLRDBAND: ::c_int = 0;
+pub const EPOLLWRNORM: ::c_int = 0;
+pub const EPOLLWRBAND: ::c_int = 0;
+pub const EPOLLMSG: ::c_int = 0;
+pub const EPOLLERR: ::c_int = 0;
+pub const EPOLLHUP: ::c_int = 0;
+pub const EPOLLRDHUP: ::c_int = 0;
+pub const EPOLLEXCLUSIVE: ::c_int = 0;
+pub const EPOLLWAKEUP: ::c_int = 0;
+pub const EPOLLONESHOT: ::c_int = 0;
+pub const EPOLLET: ::c_int = 0;
+
+// sys/stat.h
+pub const S_IFMT: ::c_int = 0o0_170_000;
+pub const S_IFDIR: ::c_int = 0o040_000;
+pub const S_IFCHR: ::c_int = 0o020_000;
+pub const S_IFBLK: ::c_int = 0o060_000;
+pub const S_IFREG: ::c_int = 0o100_000;
+pub const S_IFIFO: ::c_int = 0o010_000;
+pub const S_IFLNK: ::c_int = 0o120_000;
+pub const S_IFSOCK: ::c_int = 0o140_000;
+pub const S_IRWXU: ::c_int = 0o0_700;
+pub const S_IRUSR: ::c_int = 0o0_400;
+pub const S_IWUSR: ::c_int = 0o0_200;
+pub const S_IXUSR: ::c_int = 0o0_100;
+pub const S_IRWXG: ::c_int = 0o0_070;
+pub const S_IRGRP: ::c_int = 0o0_040;
+pub const S_IWGRP: ::c_int = 0o0_020;
+pub const S_IXGRP: ::c_int = 0o0_010;
+pub const S_IRWXO: ::c_int = 0o0_007;
+pub const S_IROTH: ::c_int = 0o0_004;
+pub const S_IWOTH: ::c_int = 0o0_002;
+pub const S_IXOTH: ::c_int = 0o0_001;
+
+// 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_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: ::tcflag_t = 0o000_001;
+pub const BRKINT: ::tcflag_t = 0o000_002;
+pub const IGNPAR: ::tcflag_t = 0o000_004;
+pub const PARMRK: ::tcflag_t = 0o000_010;
+pub const INPCK: ::tcflag_t = 0o000_020;
+pub const ISTRIP: ::tcflag_t = 0o000_040;
+pub const INLCR: ::tcflag_t = 0o000_100;
+pub const IGNCR: ::tcflag_t = 0o000_200;
+pub const ICRNL: ::tcflag_t = 0o000_400;
+pub const IXON: ::tcflag_t = 0o001_000;
+pub const IXOFF: ::tcflag_t = 0o002_000;
+
+pub const OPOST: ::tcflag_t = 0o000_001;
+pub const ONLCR: ::tcflag_t = 0o000_002;
+pub const OLCUC: ::tcflag_t = 0o000_004;
+pub const OCRNL: ::tcflag_t = 0o000_010;
+pub const ONOCR: ::tcflag_t = 0o000_020;
+pub const ONLRET: ::tcflag_t = 0o000_040;
+pub const OFILL: ::tcflag_t = 0o0000_100;
+pub const OFDEL: ::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: ::tcflag_t = 0o001_400;
+pub const CS5: ::tcflag_t = 0o000_000;
+pub const CS6: ::tcflag_t = 0o000_400;
+pub const CS7: ::tcflag_t = 0o001_000;
+pub const CS8: ::tcflag_t = 0o001_400;
+
+pub const CSTOPB: ::tcflag_t = 0o002_000;
+pub const CREAD: ::tcflag_t = 0o004_000;
+pub const PARENB: ::tcflag_t = 0o010_000;
+pub const PARODD: ::tcflag_t = 0o020_000;
+pub const HUPCL: ::tcflag_t = 0o040_000;
+
+pub const CLOCAL: ::tcflag_t = 0o0100000;
+
+pub const ISIG: ::tcflag_t = 0x0000_0080;
+pub const ICANON: ::tcflag_t = 0x0000_0100;
+pub const ECHO: ::tcflag_t = 0x0000_0008;
+pub const ECHOE: ::tcflag_t = 0x0000_0002;
+pub const ECHOK: ::tcflag_t = 0x0000_0004;
+pub const ECHONL: ::tcflag_t = 0x0000_0010;
+pub const NOFLSH: ::tcflag_t = 0x8000_0000;
+pub const TOSTOP: ::tcflag_t = 0x0040_0000;
+pub const IEXTEN: ::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: ::clockid_t = 2;
+pub const CLOCKS_PER_SEC: ::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 ::group;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn getgrgid_r(
+        gid: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
+    pub fn getgrnam_r(
+        name: *const ::c_char,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn getgrouplist(
+        user: *const ::c_char,
+        group: ::gid_t,
+        groups: *mut ::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 ::sockaddr,
+        addrlen: ::socklen_t,
+        host: *mut ::c_char,
+        hostlen: ::socklen_t,
+        serv: *mut ::c_char,
+        servlen: ::socklen_t,
+        flags: ::c_int,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn pthread_create(
+        tid: *mut ::pthread_t,
+        attr: *const ::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: ::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 ::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: ::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 ::sigset_t,
+        oldset: *mut ::sigset_t,
+    ) -> ::c_int;
+    pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+    pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+    pub fn sigtimedwait(
+        set: *const sigset_t,
+        sig: *mut siginfo_t,
+        timeout: *const ::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 ::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 ::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: ::id_t) -> ::c_int;
+    pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
+    pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+
+    // sys/socket.h
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+    pub fn recvfrom(
+        socket: ::c_int,
+        buf: *mut ::c_void,
+        len: ::size_t,
+        flags: ::c_int,
+        addr: *mut ::sockaddr,
+        addrlen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+
+    // sys/stat.h
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+
+    // sys/uio.h
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    // sys/utsname.h
+    pub fn uname(utsname: *mut utsname) -> ::c_int;
+
+    // time.h
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/compat.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/compat.rs
new file mode 100644
index 00000000000..cbf955a31ed
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/compat.rs
@@ -0,0 +1,220 @@
+// Common functions that are unfortunately missing on illumos and
+// Solaris, but often needed by other crates.
+
+use core::cmp::min;
+use unix::solarish::*;
+
+const PTEM: &[u8] = b"ptem\0";
+const LDTERM: &[u8] = b"ldterm\0";
+
+pub unsafe fn cfmakeraw(termios: *mut ::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 ::termios, speed: ::speed_t) -> ::c_int {
+    // Neither of these functions on illumos or Solaris actually ever
+    // return an error
+    ::cfsetispeed(termios, speed);
+    ::cfsetospeed(termios, speed);
+    0
+}
+
+unsafe fn bail(fdm: ::c_int, fds: ::c_int) -> ::c_int {
+    let e = *___errno();
+    if fds >= 0 {
+        ::close(fds);
+    }
+    if fdm >= 0 {
+        ::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 ::winsize,
+) -> ::c_int {
+    // Open the main pseudo-terminal device, making sure not to set it as the
+    // controlling terminal for this process:
+    let fdm = ::posix_openpt(O_RDWR | O_NOCTTY);
+    if fdm < 0 {
+        return -1;
+    }
+
+    // Set permissions and ownership on the subordinate device and unlock it:
+    if ::grantpt(fdm) < 0 || ::unlockpt(fdm) < 0 {
+        return bail(fdm, -1);
+    }
+
+    // Get the path name of the subordinate device:
+    let subordpath = ::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 = ::open(subordpath, O_RDWR | O_NOCTTY);
+    if fds < 0 {
+        return bail(fdm, -1);
+    }
+
+    // Check if the STREAMS modules are already pushed:
+    let setup = ::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 ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 {
+            return bail(fdm, fds);
+        }
+    }
+
+    // If provided, set the terminal parameters:
+    if !termp.is_null() && ::tcsetattr(fds, TCSAFLUSH, termp) != 0 {
+        return bail(fdm, fds);
+    }
+
+    // If provided, set the window size:
+    if !winp.is_null() && ::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() {
+        ::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 ::winsize,
+) -> ::pid_t {
+    let mut fds = -1;
+
+    if openpty(amain, &mut fds, name, termp, winp) != 0 {
+        return -1;
+    }
+
+    let pid = ::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:
+        ::close(fds);
+        return pid;
+    }
+
+    // The rest of this function executes in the child process.
+
+    // Close the main side of the pseudo-terminal pair:
+    ::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 ::setsid() < 0
+        || ::ioctl(fds, TIOCSCTTY, 0) < 0
+        || ::dup2(fds, 0) < 0
+        || ::dup2(fds, 1) < 0
+        || ::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.
+        ::_exit(EXIT_FAILURE);
+    }
+    // Close the inherited descriptor, taking care to avoid closing the standard
+    // descriptors by mistake:
+    if fds > 2 {
+        ::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 = *::___errno();
+    *::___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() {
+        *::___errno()
+    } else {
+        0
+    };
+    *::___errno() = old_errno;
+
+    ret
+}
+
+pub unsafe fn getgrent_r(
+    grp: *mut ::group,
+    buf: *mut ::c_char,
+    buflen: ::size_t,
+    result: *mut *mut ::group,
+) -> ::c_int {
+    let old_errno = *::___errno();
+    *::___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() {
+        *::___errno()
+    } else {
+        0
+    };
+    *::___errno() = old_errno;
+
+    ret
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/illumos.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/illumos.rs
new file mode 100644
index 00000000000..404f013da2f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/illumos.rs
@@ -0,0 +1,88 @@
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_amp: *mut ::c_void,
+        pub shm_lkcnt: ::c_ushort,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_cnattch: ::c_ulong,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::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; ::FILNAME_MAX as usize],
+    }
+}
+
+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 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_DUP2FD_CLOEXEC: ::c_int = 36;
+
+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 B1000000: ::speed_t = 24;
+pub const B1152000: ::speed_t = 25;
+pub const B1500000: ::speed_t = 26;
+pub const B2000000: ::speed_t = 27;
+pub const B2500000: ::speed_t = 28;
+pub const B3000000: ::speed_t = 29;
+pub const B3500000: ::speed_t = 30;
+pub const B4000000: ::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 mincore(addr: ::caddr_t, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+
+    pub fn pset_bind_lwp(
+        pset: ::psetid_t,
+        id: ::id_t,
+        pid: ::pid_t,
+        opset: *mut ::psetid_t,
+    ) -> ::c_int;
+    pub fn pset_getloadavg(pset: ::psetid_t, load: *mut ::c_double, num: ::c_int) -> ::c_int;
+
+    pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn getpagesizes2(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/mod.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/mod.rs
new file mode 100644
index 00000000000..c68cfba3c99
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/mod.rs
@@ -0,0 +1,3309 @@
+pub type c_char = i8;
+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 = ::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_rsrc_t = ::c_int;
+pub type lgrp_affinity_t = ::c_int;
+pub type lgrp_id_t = ::id_t;
+pub type lgrp_mem_size_t = ::c_longlong;
+pub type lgrp_cookie_t = ::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: ::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: ::uid_t,
+        pub gid: ::gid_t,
+        pub cuid: ::uid_t,
+        pub cgid: ::gid_t,
+        pub mode: ::mode_t,
+        pub seq: ::c_uint,
+        pub key: ::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: ::in_port_t,
+        pub sin_addr: ::in_addr,
+        pub sin_zero: [::c_char; 8]
+    }
+
+    pub struct sockaddr_in6 {
+        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 __sin6_src_id: u32
+    }
+
+    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_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: ::c_ulong,
+        pub ifa_addr: *mut ::sockaddr,
+        pub ifa_netmask: *mut ::sockaddr,
+        pub ifa_dstaddr: *mut ::sockaddr,
+        pub ifa_data: *mut ::c_void
+    }
+
+    pub struct itimerspec {
+        pub it_interval: ::timespec,
+        pub it_value: ::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: ::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,
+    }
+
+    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: ::pthread_mutex_t,
+        __pthread_rwlock_readercv: ::pthread_cond_t,
+        __pthread_rwlock_writercv: ::pthread_cond_t
+    }
+
+    pub struct pthread_rwlockattr_t {
+        __pthread_rwlockattrp: *mut ::c_void,
+    }
+
+    pub struct dirent {
+        pub d_ino: ::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,
+        __unused3: ::c_int,
+        __unused4: ::c_int,
+        __unused5: *mut ::c_void,
+        __unused6: *mut ::c_void,
+        __unused7: *mut ::c_void,
+        __unused8: *mut ::c_void,
+        __unused9: *mut ::c_void,
+        __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: ::socklen_t,
+        pub ai_canonname: *mut ::c_char,
+        pub ai_addr: *mut ::sockaddr,
+        pub ai_next: *mut addrinfo,
+    }
+
+    pub struct sigset_t {
+        bits: [u32; 4],
+    }
+
+    pub struct sigaction {
+        pub sa_flags: ::c_int,
+        pub sa_sigaction: ::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: ::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_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: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_mode: ::mode_t,
+        pub st_nlink: ::nlink_t,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        pub st_rdev: ::dev_t,
+        pub st_size: ::off_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_blksize: ::blksize_t,
+        pub st_blocks: ::blkcnt_t,
+        __unused: [::c_char; 16]
+    }
+
+    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; ::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: ::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: ::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 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: ::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: ::timeval,
+        pub maxerror: i32,
+        pub esterror: i32,
+    }
+
+    pub struct mmapobj_result_t {
+        pub mr_addr: ::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 {
+        pub idtype: ::idtype_t,
+        pub id: ::id_t,
+        pub lgrp: ::lgrp_id_t,
+        pub aff: ::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! {
+    #[cfg_attr(all(
+            any(target_arch = "x86", target_arch = "x86_64"),
+            libc_packedN
+        ), repr(packed(4)))]
+    #[cfg_attr(all(
+            any(target_arch = "x86", target_arch = "x86_64"),
+            not(libc_packedN)
+        ), repr(packed))]
+    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: ::pid_t,
+        pub ut_type: ::c_short,
+        pub ut_exit: exit_status,
+        pub ut_tv: ::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],
+    }
+
+    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 / 64],
+        #[cfg(target_pointer_width = "32")]
+        fds_bits: [i32; FD_SETSIZE / 32],
+    }
+
+    pub struct sockaddr_storage {
+        pub ss_family: ::sa_family_t,
+        __ss_pad1: [u8; 6],
+        __ss_align: i64,
+        __ss_pad2: [u8; 240],
+    }
+
+    #[cfg_attr(all(target_pointer_width = "64", libc_align), 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: ::sigval,
+        pub ss_sp: *mut ::c_void,
+        pub sigev_notify_attributes: *const ::pthread_attr_t,
+        __sigev_pad2: ::c_int,
+    }
+
+    #[cfg(libc_union)]
+    #[cfg_attr(libc_align, repr(align(16)))]
+    pub union pad128_t {
+        // pub _q in this structure would be a "long double", of 16 bytes
+        pub _l: [i32; 4],
+    }
+
+    #[cfg(libc_union)]
+    #[cfg_attr(libc_align, 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 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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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 => {
+                        ::mem::size_of::<siginfo_fault>() / ::mem::size_of::<::c_int>()
+                    }
+                    ::SIGCLD => ::mem::size_of::<siginfo_sigcld>() / ::mem::size_of::<::c_int>(),
+                    ::SIGHUP
+                    | ::SIGINT
+                    | ::SIGQUIT
+                    | ::SIGABRT
+                    | ::SIGSYS
+                    | ::SIGPIPE
+                    | ::SIGALRM
+                    | ::SIGTERM
+                    | ::SIGUSR1
+                    | ::SIGUSR2
+                    | ::SIGPWR
+                    | ::SIGWINCH
+                    | ::SIGURG => ::mem::size_of::<siginfo_kill>() / ::mem::size_of::<::c_int>(),
+                    _ => 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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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<H: ::hash::Hasher>(&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);
+            }
+        }
+
+        #[cfg(libc_union)]
+        impl PartialEq for pad128_t {
+            fn eq(&self, other: &pad128_t) -> bool {
+                unsafe {
+                // FIXME: self._q == other._q ||
+                    self._l == other._l
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for pad128_t {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for pad128_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("pad128_t")
+                    // FIXME: .field("_q", &{self._q})
+                    .field("_l", &{self._l})
+                    .finish()
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for pad128_t {
+            fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+                unsafe {
+                // FIXME: state.write_i64(self._q as i64);
+                self._l.hash(state);
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl PartialEq for upad128_t {
+            fn eq(&self, other: &upad128_t) -> bool {
+                unsafe {
+                // FIXME: self._q == other._q ||
+                    self._l == other._l
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for upad128_t {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for upad128_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("upad128_t")
+                    // FIXME: .field("_q", &{self._q})
+                    .field("_l", &{self._l})
+                    .finish()
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl ::hash::Hash for upad128_t {
+            fn hash<H: ::hash::Hasher>(&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 ::caddr_t,
+}
+impl ::Copy for siginfo_fault {}
+impl ::Clone for siginfo_fault {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_cldval {
+    utime: ::clock_t,
+    status: ::c_int,
+    stime: ::clock_t,
+}
+impl ::Copy for siginfo_cldval {}
+impl ::Clone for siginfo_cldval {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_killval {
+    uid: ::uid_t,
+    value: ::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: ::pid_t,
+    val: siginfo_cldval,
+    ctid: ::ctid_t,
+    zoneid: ::zoneid_t,
+}
+impl ::Copy for siginfo_sigcld {}
+impl ::Clone for siginfo_sigcld {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[repr(C)]
+struct siginfo_kill {
+    pid: ::pid_t,
+    val: siginfo_killval,
+    ctid: ::ctid_t,
+    zoneid: ::zoneid_t,
+}
+impl ::Copy for siginfo_kill {}
+impl ::Clone for siginfo_kill {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl siginfo_t {
+    unsafe fn sidata<T: ::Copy>(&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) -> ::uid_t {
+        let kill: siginfo_kill = self.sidata();
+        kill.val.uid
+    }
+    pub unsafe fn si_value(&self) -> ::sigval {
+        let kill: siginfo_kill = self.sidata();
+        kill.val.value
+    }
+    pub unsafe fn si_pid(&self) -> ::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: ::nl_item = 1;
+pub const DAY_2: ::nl_item = 2;
+pub const DAY_3: ::nl_item = 3;
+pub const DAY_4: ::nl_item = 4;
+pub const DAY_5: ::nl_item = 5;
+pub const DAY_6: ::nl_item = 6;
+pub const DAY_7: ::nl_item = 7;
+
+pub const ABDAY_1: ::nl_item = 8;
+pub const ABDAY_2: ::nl_item = 9;
+pub const ABDAY_3: ::nl_item = 10;
+pub const ABDAY_4: ::nl_item = 11;
+pub const ABDAY_5: ::nl_item = 12;
+pub const ABDAY_6: ::nl_item = 13;
+pub const ABDAY_7: ::nl_item = 14;
+
+pub const MON_1: ::nl_item = 15;
+pub const MON_2: ::nl_item = 16;
+pub const MON_3: ::nl_item = 17;
+pub const MON_4: ::nl_item = 18;
+pub const MON_5: ::nl_item = 19;
+pub const MON_6: ::nl_item = 20;
+pub const MON_7: ::nl_item = 21;
+pub const MON_8: ::nl_item = 22;
+pub const MON_9: ::nl_item = 23;
+pub const MON_10: ::nl_item = 24;
+pub const MON_11: ::nl_item = 25;
+pub const MON_12: ::nl_item = 26;
+
+pub const ABMON_1: ::nl_item = 27;
+pub const ABMON_2: ::nl_item = 28;
+pub const ABMON_3: ::nl_item = 29;
+pub const ABMON_4: ::nl_item = 30;
+pub const ABMON_5: ::nl_item = 31;
+pub const ABMON_6: ::nl_item = 32;
+pub const ABMON_7: ::nl_item = 33;
+pub const ABMON_8: ::nl_item = 34;
+pub const ABMON_9: ::nl_item = 35;
+pub const ABMON_10: ::nl_item = 36;
+pub const ABMON_11: ::nl_item = 37;
+pub const ABMON_12: ::nl_item = 38;
+
+pub const RADIXCHAR: ::nl_item = 39;
+pub const THOUSEP: ::nl_item = 40;
+pub const YESSTR: ::nl_item = 41;
+pub const NOSTR: ::nl_item = 42;
+pub const CRNCYSTR: ::nl_item = 43;
+
+pub const D_T_FMT: ::nl_item = 44;
+pub const D_FMT: ::nl_item = 45;
+pub const T_FMT: ::nl_item = 46;
+pub const AM_STR: ::nl_item = 47;
+pub const PM_STR: ::nl_item = 48;
+
+pub const CODESET: ::nl_item = 49;
+pub const T_FMT_AMPM: ::nl_item = 50;
+pub const ERA: ::nl_item = 51;
+pub const ERA_D_FMT: ::nl_item = 52;
+pub const ERA_D_T_FMT: ::nl_item = 53;
+pub const ERA_T_FMT: ::nl_item = 54;
+pub const ALT_DIGITS: ::nl_item = 55;
+pub const YESEXPR: ::nl_item = 56;
+pub const NOEXPR: ::nl_item = 57;
+pub const _DATE_FMT: ::nl_item = 58;
+pub const MAXSTRMSG: ::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 SIGINFO: ::c_int = 41;
+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 = 1;
+pub const SIGEV_SIGNAL: ::c_int = 2;
+pub const SIGEV_THREAD: ::c_int = 3;
+
+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_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_RECVPKTINFO: ::c_int = 0x12;
+pub const IPV6_SEC_OPT: ::c_int = 0x22;
+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: ::socklen_t = 1025;
+pub const NI_MAXSERV: ::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 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_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 O_DIRECT: ::c_int = 0x2000000;
+pub const S_IFIFO: mode_t = 4096;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 61440;
+pub const S_IEXEC: mode_t = 64;
+pub const S_IWRITE: mode_t = 128;
+pub const S_IREAD: mode_t = 256;
+pub const S_IRWXU: mode_t = 448;
+pub const S_IXUSR: mode_t = 64;
+pub const S_IWUSR: mode_t = 128;
+pub const S_IRUSR: mode_t = 256;
+pub const S_IRWXG: mode_t = 56;
+pub const S_IXGRP: mode_t = 8;
+pub const S_IWGRP: mode_t = 16;
+pub const S_IRGRP: mode_t = 32;
+pub const S_IRWXO: mode_t = 7;
+pub const S_IXOTH: mode_t = 1;
+pub const S_IWOTH: mode_t = 2;
+pub const S_IROTH: mode_t = 4;
+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: ::processorid_t = -1;
+pub const PBIND_QUERY: ::processorid_t = -2;
+pub const PBIND_HARD: ::processorid_t = -3;
+pub const PBIND_SOFT: ::processorid_t = -4;
+
+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_SYSTEM: ::c_int = 1;
+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_FILE: ::c_int = 0;
+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_32BIT: ::c_int = 0x80;
+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: ::clockid_t = 3;
+pub const CLOCK_MONOTONIC: ::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_NCA: ::c_int = 28;
+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_NCA: ::c_int = AF_NCA;
+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_TTL: ::c_int = 4;
+pub const IP_HDRINCL: ::c_int = 2;
+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 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 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 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_LAST: ::c_int = 101;
+pub const _PC_XATTR_EXISTS: ::c_int = 101;
+
+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 _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 = 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 _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 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;
+
+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;
+
+/* 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: ::tcflag_t = 0o21;
+pub const CSTOP: ::tcflag_t = 0o23;
+pub const CSWTCH: ::tcflag_t = 0o32;
+pub const CBAUD: ::tcflag_t = 0o17;
+pub const CIBAUD: ::tcflag_t = 0o3600000;
+pub const CBAUDEXT: ::tcflag_t = 0o10000000;
+pub const CIBAUDEXT: ::tcflag_t = 0o20000000;
+pub const CSIZE: ::tcflag_t = 0o000060;
+pub const CS5: ::tcflag_t = 0;
+pub const CS6: ::tcflag_t = 0o000020;
+pub const CS7: ::tcflag_t = 0o000040;
+pub const CS8: ::tcflag_t = 0o000060;
+pub const CSTOPB: ::tcflag_t = 0o000100;
+pub const ECHO: ::tcflag_t = 0o000010;
+pub const ECHOE: ::tcflag_t = 0o000020;
+pub const ECHOK: ::tcflag_t = 0o000040;
+pub const ECHONL: ::tcflag_t = 0o000100;
+pub const ECHOCTL: ::tcflag_t = 0o001000;
+pub const ECHOPRT: ::tcflag_t = 0o002000;
+pub const ECHOKE: ::tcflag_t = 0o004000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
+pub const IGNBRK: ::tcflag_t = 0o000001;
+pub const BRKINT: ::tcflag_t = 0o000002;
+pub const IGNPAR: ::tcflag_t = 0o000004;
+pub const PARMRK: ::tcflag_t = 0o000010;
+pub const INPCK: ::tcflag_t = 0o000020;
+pub const ISTRIP: ::tcflag_t = 0o000040;
+pub const INLCR: ::tcflag_t = 0o000100;
+pub const IGNCR: ::tcflag_t = 0o000200;
+pub const ICRNL: ::tcflag_t = 0o000400;
+pub const IUCLC: ::tcflag_t = 0o001000;
+pub const IXON: ::tcflag_t = 0o002000;
+pub const IXOFF: ::tcflag_t = 0o010000;
+pub const IXANY: ::tcflag_t = 0o004000;
+pub const IMAXBEL: ::tcflag_t = 0o020000;
+pub const DOSMODE: ::tcflag_t = 0o100000;
+pub const OPOST: ::tcflag_t = 0o000001;
+pub const OLCUC: ::tcflag_t = 0o000002;
+pub const ONLCR: ::tcflag_t = 0o000004;
+pub const OCRNL: ::tcflag_t = 0o000010;
+pub const ONOCR: ::tcflag_t = 0o000020;
+pub const ONLRET: ::tcflag_t = 0o000040;
+pub const OFILL: ::tcflag_t = 0o0000100;
+pub const OFDEL: ::tcflag_t = 0o0000200;
+pub const CREAD: ::tcflag_t = 0o000200;
+pub const PARENB: ::tcflag_t = 0o000400;
+pub const PARODD: ::tcflag_t = 0o001000;
+pub const HUPCL: ::tcflag_t = 0o002000;
+pub const CLOCAL: ::tcflag_t = 0o004000;
+pub const CRTSXOFF: ::tcflag_t = 0o10000000000;
+pub const CRTSCTS: ::tcflag_t = 0o20000000000;
+pub const ISIG: ::tcflag_t = 0o000001;
+pub const ICANON: ::tcflag_t = 0o000002;
+pub const IEXTEN: ::tcflag_t = 0o100000;
+pub const TOSTOP: ::tcflag_t = 0o000400;
+pub const FLUSHO: ::tcflag_t = 0o020000;
+pub const PENDIN: ::tcflag_t = 0o040000;
+pub const NOFLSH: ::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;
+pub const VSTATUS: usize = 16;
+pub const VERASE2: usize = 17;
+
+// <sys/stropts.h>
+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;
+
+//<sys/timex.h>
+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;
+pub const PRIV_USER: ::c_uint = PRIV_DEBUG
+    | NET_MAC_AWARE
+    | NET_MAC_AWARE_INHERIT
+    | PRIV_XPOLICY
+    | PRIV_AWARE_RESET
+    | PRIV_PFEXEC;
+
+// 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: ::lgrp_cookie_t = 0;
+pub const LGRP_AFF_NONE: ::lgrp_affinity_t = 0x0;
+pub const LGRP_AFF_WEAK: ::lgrp_affinity_t = 0x10;
+pub const LGRP_AFF_STRONG: ::lgrp_affinity_t = 0x100;
+pub const LGRP_RSRC_COUNT: ::lgrp_rsrc_t = 2;
+pub const LGRP_RSRC_CPU: ::lgrp_rsrc_t = 0;
+pub const LGRP_RSRC_MEM: ::lgrp_rsrc_t = 1;
+pub const LGRP_CONTENT_ALL: ::lgrp_content_t = 0;
+pub const LGRP_CONTENT_HIERARCHY: ::lgrp_content_t = LGRP_CONTENT_ALL;
+pub const LGRP_CONTENT_DIRECT: ::lgrp_content_t = 1;
+pub const LGRP_LAT_CPU_TO_MEM: ::lgrp_lat_between_t = 0;
+pub const LGRP_MEM_SZ_FREE: ::lgrp_mem_size_flag_t = 0;
+pub const LGRP_MEM_SZ_INSTALLED: ::lgrp_mem_size_flag_t = 1;
+pub const LGRP_VIEW_CALLER: ::lgrp_view_t = 0;
+pub const LGRP_VIEW_OS: ::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_DISABLED: ::c_int = 0x008;
+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;
+pub const AT_SUN_HWCAP2: ::c_uint = 2023;
+pub const AT_SUN_FPTYPE: ::c_uint = 2027;
+
+// 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 = ::mem::size_of::<::c_int>();
+
+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::<::cmsghdr>()) as ::c_uint + length
+    }
+
+    pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
+        if ((*mhdr).msg_controllen as usize) < ::mem::size_of::<::cmsghdr>() {
+            0 as *mut ::cmsghdr
+        } else {
+            (*mhdr).msg_control as *mut ::cmsghdr
+        }
+    }
+
+    pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
+        -> *mut ::cmsghdr
+    {
+        if cmsg.is_null() {
+            return ::CMSG_FIRSTHDR(mhdr);
+        };
+        let next = _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize
+            + ::mem::size_of::<::cmsghdr>());
+        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(::mem::size_of::<::cmsghdr>() 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 {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 ::rlimit) -> ::c_int;
+    pub fn setrlimit(resource: ::c_int, rlim: *const ::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 ::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 ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn settimeofday(tp: *const ::timeval, tz: *const ::c_void) -> ::c_int;
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
+
+    pub fn stack_getbounds(sp: *mut ::stack_t) -> ::c_int;
+    pub fn getgrouplist(
+        name: *const ::c_char,
+        basegid: ::gid_t,
+        groups: *mut ::gid_t,
+        ngroups: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
+    pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+    pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
+    pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+    pub fn ___errno() -> *mut ::c_int;
+    pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+    pub fn clock_nanosleep(
+        clk_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+    pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+    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 setpwent();
+    pub fn endpwent();
+    pub fn getpwent() -> *mut passwd;
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::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: ::mode_t,
+        dev: dev_t,
+    ) -> ::c_int;
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::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 ::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_attr_getstack(
+        attr: *const ::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: ::clockid_t,
+    ) -> ::c_int;
+    pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::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 ::timespec,
+    ) -> ::c_int;
+    pub fn pthread_getname_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
+    pub fn pthread_setname_np(tid: ::pthread_t, name: *const ::c_char) -> ::c_int;
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::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<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+        pglob: *mut ::glob_t,
+    ) -> ::c_int;
+
+    #[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")]
+    pub fn globfree(pglob: *mut ::glob_t);
+
+    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 ::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: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+    pub fn telldir(dirp: *mut ::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 ::sockaddr,
+        addrlen: *mut ::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 ::timeval) -> ::c_int;
+    pub fn futimens(dirfd: ::c_int, times: *const ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::timespec,
+        flag: ::c_int,
+    ) -> ::c_int;
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_bind")]
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+
+    pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendmsg")]
+    pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
+    #[cfg_attr(target_os = "illumos", link_name = "__xnet_recvmsg")]
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::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, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+    pub fn port_create() -> ::c_int;
+    pub fn port_associate(
+        port: ::c_int,
+        source: ::c_int,
+        object: ::uintptr_t,
+        events: ::c_int,
+        user: *mut ::c_void,
+    ) -> ::c_int;
+    pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t) -> ::c_int;
+    pub fn port_get(port: ::c_int, pe: *mut port_event, timeout: *mut ::timespec) -> ::c_int;
+    pub fn port_getn(
+        port: ::c_int,
+        pe_list: *mut port_event,
+        max: ::c_uint,
+        nget: *mut ::c_uint,
+        timeout: *mut ::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: ::gid_t,
+        grp: *mut ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+    pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+    pub fn getdtablesize() -> ::c_int;
+
+    // The epoll functions are actually only present on illumos.  However,
+    // there are things using epoll on illumos (built using the
+    // x86_64-pc-solaris target) which would break until the illumos target is
+    // present in rustc.
+    pub fn epoll_pwait(
+        epfd: ::c_int,
+        events: *mut ::epoll_event,
+        maxevents: ::c_int,
+        timeout: ::c_int,
+        sigmask: *const ::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 ::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 ::epoll_event)
+        -> ::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 ::group,
+        buf: *mut ::c_char,
+        buflen: ::size_t,
+        result: *mut *mut ::group,
+    ) -> ::c_int;
+    pub fn thr_self() -> ::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 ::group;
+    pub fn pthread_kill(thread: ::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: ::pid_t, param: *mut sched_param) -> ::c_int;
+    pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+    pub fn sched_setscheduler(
+        pid: ::pid_t,
+        policy: ::c_int,
+        param: *const ::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: ::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 ::group, buf: *mut ::c_char, buflen: ::c_int) -> *mut ::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<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::c_int;
+    pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
+    pub fn setgrent();
+    pub fn endgrent();
+    pub fn getgrent() -> *mut ::group;
+    pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
+
+    pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
+    pub fn uname(buf: *mut ::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: *const utmpx) -> ::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 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: ::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) -> ::uid_t;
+    pub fn ucred_getruid(ucred: *const ucred_t) -> ::uid_t;
+    pub fn ucred_getsuid(ucred: *const ucred_t) -> ::uid_t;
+    pub fn ucred_getegid(ucred: *const ucred_t) -> ::gid_t;
+    pub fn ucred_getrgid(ucred: *const ucred_t) -> ::gid_t;
+    pub fn ucred_getsgid(ucred: *const ucred_t) -> ::gid_t;
+    pub fn ucred_getgroups(ucred: *const ucred_t, groups: *mut *const ::gid_t) -> ::c_int;
+    pub fn ucred_getpid(ucred: *const ucred_t) -> ::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 ::psetid_t) -> ::c_int;
+    pub fn pset_destroy(pset: ::psetid_t) -> ::c_int;
+    pub fn pset_assign(pset: ::psetid_t, cpu: ::processorid_t, opset: *mut psetid_t) -> ::c_int;
+    pub fn pset_info(
+        pset: ::psetid_t,
+        tpe: *mut ::c_int,
+        numcpus: *mut ::c_uint,
+        cpulist: *mut processorid_t,
+    ) -> ::c_int;
+    pub fn pset_bind(
+        pset: ::psetid_t,
+        idtype: ::idtype_t,
+        id: ::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: ::idtype_t,
+        id: ::id_t,
+        new_binding: ::processorid_t,
+        old_binding: *mut processorid_t,
+    ) -> ::c_int;
+    pub fn p_online(processorid: ::processorid_t, flag: ::c_int) -> ::c_int;
+    pub fn processor_info(processorid: ::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 <link.h>
+    #[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 strcasecmp_l(s1: *const ::c_char, s2: *const ::c_char, loc: ::locale_t) -> ::c_int;
+    pub fn strncasecmp_l(
+        s1: *const ::c_char,
+        s2: *const ::c_char,
+        n: ::size_t,
+        loc: ::locale_t,
+    ) -> ::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 __major(version: ::c_int, devnum: ::dev_t) -> ::major_t;
+    pub fn __minor(version: ::c_int, devnum: ::dev_t) -> ::minor_t;
+    pub fn __makedev(version: ::c_int, majdev: ::major_t, mindev: ::minor_t) -> ::dev_t;
+}
+
+#[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: ::idtype_t,
+        id: ::id_t,
+        lgrp: ::lgrp_id_t,
+    ) -> ::lgrp_affinity_t;
+    pub fn lgrp_affinity_set(
+        idtype: ::idtype_t,
+        id: ::id_t,
+        lgrp: ::lgrp_id_t,
+        aff: lgrp_affinity_t,
+    ) -> ::lgrp_affinity_t;
+    pub fn lgrp_cpus(
+        cookie: ::lgrp_cookie_t,
+        lgrp: ::lgrp_id_t,
+        cpuids: *mut ::processorid_t,
+        count: ::c_uint,
+        content: ::lgrp_content_t,
+    ) -> ::c_int;
+    pub fn lgrp_mem_size(
+        cookie: ::lgrp_cookie_t,
+        lgrp: ::lgrp_id_t,
+        tpe: ::lgrp_mem_size_flag_t,
+        content: ::lgrp_content_t,
+    ) -> ::lgrp_mem_size_t;
+    pub fn lgrp_nlgrps(cookie: ::lgrp_cookie_t) -> ::c_int;
+    pub fn lgrp_view(cookie: ::lgrp_cookie_t) -> ::lgrp_view_t;
+    pub fn lgrp_home(idtype: ::idtype_t, id: ::id_t) -> ::lgrp_id_t;
+    pub fn lgrp_version(version: ::c_int) -> ::c_int;
+    pub fn lgrp_resources(
+        cookie: ::lgrp_cookie_t,
+        lgrp: ::lgrp_id_t,
+        lgrps: *mut ::lgrp_id_t,
+        count: ::c_uint,
+        tpe: ::lgrp_rsrc_t,
+    ) -> ::c_int;
+    pub fn lgrp_root(cookie: ::lgrp_cookie_t) -> ::lgrp_id_t;
+}
+
+pub unsafe fn major(device: ::dev_t) -> ::major_t {
+    __major(NEWDEV, device)
+}
+
+pub unsafe fn minor(device: ::dev_t) -> ::minor_t {
+    __minor(NEWDEV, device)
+}
+
+pub unsafe fn makedev(maj: ::major_t, min: ::minor_t) -> ::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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/solaris.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/solaris.rs
new file mode 100644
index 00000000000..80bad281ea7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/solaris.rs
@@ -0,0 +1,101 @@
+pub type door_attr_t = ::c_uint;
+pub type door_id_t = ::c_ulonglong;
+
+s! {
+    pub struct shmid_ds {
+        pub shm_perm: ::ipc_perm,
+        pub shm_segsz: ::size_t,
+        pub shm_flags: ::uintptr_t,
+        pub shm_lkcnt: ::c_ushort,
+        pub shm_lpid: ::pid_t,
+        pub shm_cpid: ::pid_t,
+        pub shm_nattch: ::shmatt_t,
+        pub shm_cnattch: ::c_ulong,
+        pub shm_atime: ::time_t,
+        pub shm_dtime: ::time_t,
+        pub shm_ctime: ::time_t,
+        pub shm_amp: *mut ::c_void,
+        pub shm_gransize: u64,
+        pub shm_allocated: u64,
+        pub shm_pad4: [i64; 1],
+    }
+
+    pub struct door_desc_t__d_data__d_desc {
+        pub d_descriptor: ::c_int,
+        pub d_id: ::door_id_t
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
+    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 const PORT_SOURCE_POSTWAIT: ::c_int = 8;
+pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
+
+pub const AF_LOCAL: ::c_int = 0;
+pub const AF_FILE: ::c_int = 0;
+
+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;
+
+extern "C" {
+    pub fn fexecve(
+        fd: ::c_int,
+        argv: *const *const ::c_char,
+        envp: *const *const ::c_char,
+    ) -> ::c_int;
+
+    pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
+
+    pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int;
+    pub fn door_return(
+        data_ptr: *const ::c_char,
+        data_size: ::size_t,
+        desc_ptr: *const door_desc_t,
+        num_desc: ::c_uint,
+    );
+    pub fn door_create(
+        server_procedure: extern "C" fn(
+            cookie: *const ::c_void,
+            argp: *const ::c_char,
+            arg_size: ::size_t,
+            dp: *const door_desc_t,
+            n_desc: ::c_uint,
+        ),
+        cookie: *const ::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: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+
+    pub fn euidaccess(path: *const ::c_char, amode: ::c_int) -> ::c_int;
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86.rs
new file mode 100644
index 00000000000..23f52ad3c89
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86.rs
@@ -0,0 +1,29 @@
+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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_64.rs
new file mode 100644
index 00000000000..bca552f3782
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_64.rs
@@ -0,0 +1,190 @@
+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: [::upad128_t; 8],
+        pub xmm: [::upad128_t; 16],
+        pub __fx_ign: [::upad128_t; 6],
+        pub status: u32,
+        pub xstatus: u32,
+    }
+
+    pub struct __c_anonymous_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 dl_phdr_info {
+        pub dlpi_addr: ::Elf64_Addr,
+        pub dlpi_name: *const ::c_char,
+        pub dlpi_phdr: *const ::Elf64_Phdr,
+        pub dlpi_phnum: ::Elf64_Half,
+        pub dlpi_adds: ::c_ulonglong,
+        pub dlpi_subs: ::c_ulonglong,
+    }
+}
+
+s_no_extra_traits! {
+    #[cfg(libc_union)]
+    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: [::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: ::sigset_t,
+        pub uc_stack: ::stack_t,
+        pub uc_mcontext: mcontext_t,
+        pub uc_filler: [::c_long; 5],
+    }
+}
+
+cfg_if! {
+    if #[cfg(feature = "extra_traits")] {
+        #[cfg(libc_union)]
+        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)
+                }
+            }
+        }
+        #[cfg(libc_union)]
+        impl Eq for __c_anonymous_fp_reg_set {}
+        #[cfg(libc_union)]
+        impl ::fmt::Debug for __c_anonymous_fp_reg_set {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                f.debug_struct("__c_anonymous_fp_reg_set")
+                    .field("fpchip_state", &{self.fpchip_state})
+                    .field("f_fpregs", &{self.f_fpregs})
+                    .finish()
+                }
+            }
+        }
+        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 --git a/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_common.rs b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_common.rs
new file mode 100644
index 00000000000..515f23490db
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/unix/solarish/x86_common.rs
@@ -0,0 +1,65 @@
+// 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;
+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 --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/aarch64.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/aarch64.rs
new file mode 100644
index 00000000000..4032488b6c0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/aarch64.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/arm.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/arm.rs
new file mode 100644
index 00000000000..55240068aa0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/arm.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/mod.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/mod.rs
new file mode 100644
index 00000000000..43afbc3e2c2
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/mod.rs
@@ -0,0 +1,1947 @@
+//! Interface to VxWorks C library
+
+use core::mem::size_of;
+use core::ptr::null_mut;
+
+#[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 = ::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 = ::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 = ::_Vx_OBJ_HANDLE;
+pub type _Vx_MSG_Q_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_SEM_ID_KERNEL = ::_Vx_OBJ_HANDLE;
+pub type _Vx_RTP_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_SD_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_CONDVAR_ID = ::_Vx_OBJ_HANDLE;
+pub type _Vx_SEM_ID = *mut ::_Vx_semaphore;
+pub type OBJ_HANDLE = ::_Vx_OBJ_HANDLE;
+pub type TASK_ID = ::OBJ_HANDLE;
+pub type MSG_Q_ID = ::OBJ_HANDLE;
+pub type SEM_ID_KERNEL = ::OBJ_HANDLE;
+pub type RTP_ID = ::OBJ_HANDLE;
+pub type SD_ID = ::OBJ_HANDLE;
+pub type CONDVAR_ID = ::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) -> ::sigval {
+        self.si_value
+    }
+
+    pub unsafe fn si_pid(&self) -> ::pid_t {
+        self.si_pid
+    }
+
+    pub unsafe fn si_uid(&self) -> ::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: ::clockid_t,
+    }
+
+    // b_pthread_cond_t.h
+    pub struct pthread_cond_t{
+        pub condSemId: ::_Vx_SEM_ID,
+        pub condValid: ::c_int,
+        pub condInitted: ::c_int,
+        pub condRefCount: ::c_int,
+        pub condMutex: *mut ::pthread_mutex_t,
+        pub condAttr: ::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: :: _Vx_SEM_ID,
+        pub rwlockReadersRefCount: ::c_uint,
+        pub rwlockValid: ::c_int,
+        pub rwlockInitted: ::c_int,
+        pub rwlockAttr: ::pthread_rwlockattr_t,
+        pub rwlockSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX]
+    }
+
+    // b_struct_timeval.h
+    pub struct timeval {
+        pub tv_sec: ::time_t,
+        pub tv_usec: ::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 : ::rlim_t,
+                           pub rlim_max : ::rlim_t,
+    }
+
+    // stat.h
+    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       : ::uid_t,
+                         pub st_gid       : ::gid_t,
+                         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,
+                         pub st_blocks    : ::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  : ::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: ::_Timespec, /* replenishment period */
+        pub sched_ss_init_budget: ::_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      : ::_Sched_param,
+    }
+
+    // signal.h
+
+    pub struct sigaction {
+        pub sa_u     : ::sa_u_t,
+        pub sa_mask  : ::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 : ::sigval,
+        pub si_errno : ::c_int,
+        pub si_status: ::c_int,
+        pub si_addr: *mut ::c_void,
+        pub si_uid: ::uid_t,
+        pub si_pid: ::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: ::_Vx_SEM_ID, /*_Vx_SEM_ID ..*/
+        pub mutexValid: ::c_int,
+        pub mutexInitted: ::c_int,
+        pub mutexCondRefCount: ::c_int,
+        pub mutexSavPriority: ::c_int,
+        pub mutexAttr: ::pthread_mutexattr_t,
+        pub mutexSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX],
+    }
+
+    // b_struct_timespec.h
+    pub struct timespec {
+        pub tv_sec: ::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 ::sockaddr,
+        pub ai_next     : *mut ::addrinfo,
+    }
+
+    // in.h
+    pub struct sockaddr_in {
+        pub sin_len   : u8,
+        pub sin_family: u8,
+        pub sin_port  : u16,
+        pub sin_addr  : ::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    : ::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  : ::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: ::TASK_ID,
+        pub parentId  : ::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  : ::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<unsafe extern "C" fn(::c_int) -> !>,
+        pub sa_sigaction: ::Option<unsafe extern "C" fn(::c_int,
+                                                        *mut ::siginfo_t,
+                                                        *mut ::c_void) -> !>,
+    }
+
+    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 ::fmt::Debug for sa_u_t {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                unsafe {
+                    let h = match self.sa_handler {
+                        Some(handler) => handler as usize,
+                        None => 0 as usize,
+                    };
+
+                    f.debug_struct("sa_u_t")
+                        .field("sa_handler", &h)
+                        .finish()
+                }
+            }
+        }
+        impl ::hash::Hash for sa_u_t {
+            fn hash<H: ::hash::Hasher>(&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 ::fmt::Debug for sigval {
+            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+                f.debug_struct("sigval")
+                    .field("sival_ptr", unsafe { &(self.sival_ptr as usize) })
+                    .finish()
+            }
+        }
+        impl ::hash::Hash for sigval {
+            fn hash<H: ::hash::Hasher>(&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;
+
+// ERRNO STUFF
+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;
+
+// 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 = 0xf000;
+pub const S_IFIFO: ::c_int = 0x1000;
+pub const S_IFCHR: ::c_int = 0x2000;
+pub const S_IFDIR: ::c_int = 0x4000;
+pub const S_IFBLK: ::c_int = 0x6000;
+pub const S_IFREG: ::c_int = 0x8000;
+pub const S_IFLNK: ::c_int = 0xa000;
+pub const S_IFSHM: ::c_int = 0xb000;
+pub const S_IFSOCK: ::c_int = 0xc000;
+pub const S_ISUID: ::c_int = 0x0800;
+pub const S_ISGID: ::c_int = 0x0400;
+pub const S_ISTXT: ::c_int = 0x0200;
+pub const S_IRUSR: ::c_int = 0x0100;
+pub const S_IWUSR: ::c_int = 0x0080;
+pub const S_IXUSR: ::c_int = 0x0040;
+pub const S_IRWXU: ::c_int = 0x01c0;
+pub const S_IRGRP: ::c_int = 0x0020;
+pub const S_IWGRP: ::c_int = 0x0010;
+pub const S_IXGRP: ::c_int = 0x0008;
+pub const S_IRWXG: ::c_int = 0x0038;
+pub const S_IROTH: ::c_int = 0x0004;
+pub const S_IWOTH: ::c_int = 0x0002;
+pub const S_IXOTH: ::c_int = 0x0001;
+pub const S_IRWXO: ::c_int = 0x0007;
+
+// socket.h
+pub const SOL_SOCKET: ::c_int = 0xffff;
+
+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::<u32>();
+pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - size_of::<::c_uchar>() - size_of::<::sa_family_t>();
+pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE
+    - size_of::<::c_uchar>()
+    - size_of::<::sa_family_t>()
+    - _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: ::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::<usize>() - 1 & !(::mem::size_of::<usize>() - 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::<::cmsghdr>());
+        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::<::cmsghdr>()) as isize)
+    }
+
+    pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+        (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::<cmsghdr>()))
+            as ::c_uint
+    }
+
+    pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+        CMSG_ALIGN(::mem::size_of::<cmsghdr>()) 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 ::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 ::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 ::FILE;
+    pub fn fileno(stream: *mut ::FILE) -> ::c_int;
+    pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
+    pub fn rewinddir(dirp: *mut ::DIR);
+    pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::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: ::mode_t) -> ::c_int;
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+
+    pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn pthread_exit(value: *mut ::c_void) -> !;
+    pub fn pthread_attr_setdetachstate(attr: *mut ::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 ::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: ::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 ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::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 ::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 ::pthread_attr_t, name: *mut ::c_char) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stacksize: ::size_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_getstacksize(attr: *const ::pthread_attr_t, size: *mut ::size_t)
+        -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_create(
+        pThread: *mut ::pthread_t,
+        pAttr: *const ::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_attr_destroy(thread: *mut ::pthread_attr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
+
+    // int pthread_atfork (void (*)(void), void (*)(void), void (*)(void));
+    pub fn pthread_atfork(
+        prepare: ::Option<unsafe extern "C" fn()>,
+        parent: ::Option<unsafe extern "C" fn()>,
+        child: ::Option<unsafe extern "C" fn()>,
+    ) -> ::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 ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
+        -> ::c_int;
+
+    // dirent.h
+    pub fn readdir(pDir: *mut ::DIR) -> *mut ::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 ::pthread_condattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_destroy(attr: *mut ::pthread_condattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_getclock(
+        pAttr: *const ::pthread_condattr_t,
+        pClockId: *mut ::clockid_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_condattr_setclock(
+        pAttr: *mut ::pthread_condattr_t,
+        clockId: ::clockid_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_init(
+        cond: *mut ::pthread_cond_t,
+        attr: *const ::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 ::pthread_cond_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_broadcast(cond: *mut ::pthread_cond_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_cond_wait(cond: *mut ::pthread_cond_t, mutex: *mut ::pthread_mutex_t)
+        -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlockattr_init(attr: *mut ::pthread_rwlockattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlockattr_destroy(attr: *mut ::pthread_rwlockattr_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlockattr_setmaxreaders(
+        attr: *mut ::pthread_rwlockattr_t,
+        attr2: ::c_uint,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_init(
+        attr: *mut ::pthread_rwlock_t,
+        host: *const ::pthread_rwlockattr_t,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_destroy(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_rdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_tryrdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_timedrdlock(
+        attr: *mut ::pthread_rwlock_t,
+        host: *const ::timespec,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_wrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_trywrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_timedwrlock(
+        attr: *mut ::pthread_rwlock_t,
+        host: *const ::timespec,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_rwlock_unlock(attr: *mut ::pthread_rwlock_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_key_create(
+        key: *mut ::pthread_key_t,
+        dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_key_delete(key: ::pthread_key_t) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_setspecific(key: ::pthread_key_t, value: *const ::c_void) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_getspecific(key: ::pthread_key_t) -> *mut ::c_void;
+
+    // pthread.h
+    pub fn pthread_cond_timedwait(
+        cond: *mut ::pthread_cond_t,
+        mutex: *mut ::pthread_mutex_t,
+        abstime: *const ::timespec,
+    ) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_attr_getname(attr: *mut ::pthread_attr_t, name: *mut *mut ::c_char) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_join(thread: ::pthread_t, status: *mut *mut ::c_void) -> ::c_int;
+
+    // pthread.h
+    pub fn pthread_self() -> ::pthread_t;
+
+    // clockLib.h
+    pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+
+    // clockLib.h
+    pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+
+    // clockLib.h
+    pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int;
+
+    // clockLib.h
+    pub fn clock_nanosleep(
+        clock_id: ::clockid_t,
+        flags: ::c_int,
+        rqtp: *const ::timespec,
+        rmtp: *mut ::timespec,
+    ) -> ::c_int;
+
+    // timerLib.h
+    pub fn nanosleep(rqtp: *const ::timespec, rmtp: *mut ::timespec) -> ::c_int;
+
+    // socket.h
+    pub fn accept(s: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::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 ::sockaddr, namelen: ::socklen_t) -> ::c_int;
+
+    // socket.h
+    pub fn getpeername(s: ::c_int, name: *mut ::sockaddr, namelen: *mut ::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 ::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 ::sockaddr,
+        pFromLen: *mut ::socklen_t,
+    ) -> ::ssize_t;
+
+    pub fn recvmsg(socket: ::c_int, mp: *mut ::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 ::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 ::DIR;
+
+    // unistd.h
+    pub fn rmdir(path: *const ::c_char) -> ::c_int;
+
+    // stat.h
+    pub fn mkdir(dirName: *const ::c_char, mode: ::mode_t) -> ::c_int;
+
+    // stat.h
+    pub fn chmod(path: *const ::c_char, mode: ::mode_t) -> ::c_int;
+
+    // stat.h
+    pub fn fchmod(attr1: ::c_int, attr2: ::mode_t) -> ::c_int;
+
+    // unistd.h
+    pub fn fsync(fd: ::c_int) -> ::c_int;
+
+    // dirent.h
+    pub fn closedir(ptr: *mut ::DIR) -> ::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: ::gid_t) -> ::c_int;
+
+    // unistd.h
+    pub fn getgid() -> ::gid_t;
+
+    // unistd.h
+    pub fn setuid(uid: ::uid_t) -> ::c_int;
+
+    // unistd.h
+    pub fn getuid() -> ::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: ::sigval) -> ::c_int;
+
+    // signal.h for user
+    pub fn _sigqueue(
+        rtpId: ::RTP_ID,
+        signo: ::c_int,
+        pValue: *const ::sigval,
+        sigCode: ::c_int,
+    ) -> ::c_int;
+
+    // signal.h
+    pub fn taskKill(taskId: ::TASK_ID, signo: ::c_int) -> ::c_int;
+
+    // signal.h
+    pub fn raise(__signo: ::c_int) -> ::c_int;
+
+    // taskLibCommon.h
+    pub fn taskIdSelf() -> ::TASK_ID;
+    pub fn taskDelay(ticks: ::_Vx_ticks_t) -> ::c_int;
+
+    // rtpLibCommon.h
+    pub fn rtpInfoGet(rtpId: ::RTP_ID, rtpStruct: *mut ::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 ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::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, ...) -> ::mqd_t;
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+    pub fn mq_receive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+    ) -> ::ssize_t;
+    pub fn mq_timedreceive(
+        mqd: ::mqd_t,
+        msg_ptr: *mut ::c_char,
+        msg_len: ::size_t,
+        msg_prio: *mut ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::ssize_t;
+    pub fn mq_send(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+    ) -> ::c_int;
+    pub fn mq_timedsend(
+        mqd: ::mqd_t,
+        msg_ptr: *const ::c_char,
+        msg_len: ::size_t,
+        msg_prio: ::c_uint,
+        abs_timeout: *const ::timespec,
+    ) -> ::c_int;
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+    pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+}
+
+//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::<::size_t>() != 0) {
+        return ::EINVAL;
+    }
+
+    unsafe {
+        // posix_memalign should not set errno
+        let e = ::errnoGet();
+
+        let temp = memalign(align, size);
+        ::errnoSet(e as ::c_int);
+
+        if temp.is_null() {
+            ::ENOMEM
+        } else {
+            *memptr = temp;
+            0
+        }
+    }
+}
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+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 {
+        // Unknown target_arch
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc.rs
new file mode 100644
index 00000000000..55240068aa0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc64.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc64.rs
new file mode 100644
index 00000000000..4032488b6c0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/powerpc64.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/x86.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/x86.rs
new file mode 100644
index 00000000000..e617bb83c6c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/x86.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/vxworks/x86_64.rs b/libgrust/libformat_parser/vendor/libc/src/vxworks/x86_64.rs
new file mode 100644
index 00000000000..5e95ea2567d
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/vxworks/x86_64.rs
@@ -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 --git a/libgrust/libformat_parser/vendor/libc/src/wasi.rs b/libgrust/libformat_parser/vendor/libc/src/wasi.rs
new file mode 100644
index 00000000000..ae490bf94d7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/wasi.rs
@@ -0,0 +1,831 @@
+use super::{Send, Sync};
+
+pub use ffi::c_void;
+
+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],
+    }
+}
+
+// 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 = 49152;
+pub const S_IFCHR: mode_t = 8192;
+pub const S_IFBLK: mode_t = 24576;
+pub const S_IFDIR: mode_t = 16384;
+pub const S_IFREG: mode_t = 32768;
+pub const S_IFLNK: mode_t = 40960;
+pub const S_IFSOCK: mode_t = 49152;
+pub const S_IFMT: mode_t = 57344;
+pub const S_IRWXO: mode_t = 0x7;
+pub const S_IXOTH: mode_t = 0x1;
+pub const S_IWOTH: mode_t = 0x2;
+pub const S_IROTH: mode_t = 0x4;
+pub const S_IRWXG: mode_t = 0x38;
+pub const S_IXGRP: mode_t = 0x8;
+pub const S_IWGRP: mode_t = 0x10;
+pub const S_IRGRP: mode_t = 0x20;
+pub const S_IRWXU: mode_t = 0x1c0;
+pub const S_IXUSR: mode_t = 0x40;
+pub const S_IWUSR: mode_t = 0x80;
+pub const S_IRUSR: mode_t = 0x100;
+pub const S_ISVTX: mode_t = 0x200;
+pub const S_ISGID: mode_t = 0x400;
+pub const S_ISUID: mode_t = 0x800;
+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;
+
+pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
+pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
+    unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
+pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
+pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
+    unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
+
+pub const ABDAY_1: ::nl_item = 0x20000;
+pub const ABDAY_2: ::nl_item = 0x20001;
+pub const ABDAY_3: ::nl_item = 0x20002;
+pub const ABDAY_4: ::nl_item = 0x20003;
+pub const ABDAY_5: ::nl_item = 0x20004;
+pub const ABDAY_6: ::nl_item = 0x20005;
+pub const ABDAY_7: ::nl_item = 0x20006;
+
+pub const DAY_1: ::nl_item = 0x20007;
+pub const DAY_2: ::nl_item = 0x20008;
+pub const DAY_3: ::nl_item = 0x20009;
+pub const DAY_4: ::nl_item = 0x2000A;
+pub const DAY_5: ::nl_item = 0x2000B;
+pub const DAY_6: ::nl_item = 0x2000C;
+pub const DAY_7: ::nl_item = 0x2000D;
+
+pub const ABMON_1: ::nl_item = 0x2000E;
+pub const ABMON_2: ::nl_item = 0x2000F;
+pub const ABMON_3: ::nl_item = 0x20010;
+pub const ABMON_4: ::nl_item = 0x20011;
+pub const ABMON_5: ::nl_item = 0x20012;
+pub const ABMON_6: ::nl_item = 0x20013;
+pub const ABMON_7: ::nl_item = 0x20014;
+pub const ABMON_8: ::nl_item = 0x20015;
+pub const ABMON_9: ::nl_item = 0x20016;
+pub const ABMON_10: ::nl_item = 0x20017;
+pub const ABMON_11: ::nl_item = 0x20018;
+pub const ABMON_12: ::nl_item = 0x20019;
+
+pub const MON_1: ::nl_item = 0x2001A;
+pub const MON_2: ::nl_item = 0x2001B;
+pub const MON_3: ::nl_item = 0x2001C;
+pub const MON_4: ::nl_item = 0x2001D;
+pub const MON_5: ::nl_item = 0x2001E;
+pub const MON_6: ::nl_item = 0x2001F;
+pub const MON_7: ::nl_item = 0x20020;
+pub const MON_8: ::nl_item = 0x20021;
+pub const MON_9: ::nl_item = 0x20022;
+pub const MON_10: ::nl_item = 0x20023;
+pub const MON_11: ::nl_item = 0x20024;
+pub const MON_12: ::nl_item = 0x20025;
+
+pub const AM_STR: ::nl_item = 0x20026;
+pub const PM_STR: ::nl_item = 0x20027;
+
+pub const D_T_FMT: ::nl_item = 0x20028;
+pub const D_FMT: ::nl_item = 0x20029;
+pub const T_FMT: ::nl_item = 0x2002A;
+pub const T_FMT_AMPM: ::nl_item = 0x2002B;
+
+pub const ERA: ::nl_item = 0x2002C;
+pub const ERA_D_FMT: ::nl_item = 0x2002E;
+pub const ALT_DIGITS: ::nl_item = 0x2002F;
+pub const ERA_D_T_FMT: ::nl_item = 0x20030;
+pub const ERA_T_FMT: ::nl_item = 0x20031;
+
+pub const CODESET: ::nl_item = 14;
+pub const CRNCYSTR: ::nl_item = 0x4000F;
+pub const RADIXCHAR: ::nl_item = 0x10000;
+pub const THOUSEP: ::nl_item = 0x10001;
+pub const YESEXPR: ::nl_item = 0x50000;
+pub const NOEXPR: ::nl_item = 0x50001;
+pub const YESSTR: ::nl_item = 0x50002;
+pub const NOSTR: ::nl_item = 0x50003;
+
+#[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 ::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 ::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 ::FILE;
+    pub fn fileno(stream: *mut ::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 ::DIR;
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
+    pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
+    pub fn rewinddir(dirp: *mut ::DIR);
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+    pub fn telldir(dirp: *mut ::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: ::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 ::timeval, tz: *mut ::c_void) -> ::c_int;
+    pub fn times(buf: *mut ::tms) -> ::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 ::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 ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
+    pub fn ftello(stream: *mut ::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 ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+    pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
+        -> ::ssize_t;
+    pub fn preadv(fd: ::c_int, iov: *const ::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 ::timespec) -> ::c_int;
+    pub fn utimensat(
+        dirfd: ::c_int,
+        path: *const ::c_char,
+        times: *const ::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: ::locale_t) -> ::locale_t;
+    pub fn freelocale(loc: ::locale_t);
+    pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+    pub fn uselocale(loc: ::locale_t) -> ::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: ::nl_item) -> *mut ::c_char;
+    pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
+
+    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 ::timespec,
+        flags: c_int,
+    ) -> c_int;
+    pub fn __wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut ::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 ::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;
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/windows/gnu/align.rs b/libgrust/libformat_parser/vendor/libc/src/windows/gnu/align.rs
new file mode 100644
index 00000000000..3af99e3ca14
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/windows/gnu/align.rs
@@ -0,0 +1,19 @@
+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]
+            }
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/windows/gnu/mod.rs b/libgrust/libformat_parser/vendor/libc/src/windows/gnu/mod.rs
new file mode 100644
index 00000000000..3e7d38b8e83
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/windows/gnu/mod.rs
@@ -0,0 +1,23 @@
+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 `<wchar.h>`
+    //      header file. We cannot find a way to link to that symbol from Rust.
+    pub fn wmemchr(cx: *const ::wchar_t, c: ::wchar_t, n: ::size_t) -> *mut ::wchar_t;
+}
+
+cfg_if! {
+    if #[cfg(libc_align)] {
+        mod align;
+        pub use self::align::*;
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/src/windows/mod.rs b/libgrust/libformat_parser/vendor/libc/src/windows/mod.rs
new file mode 100644
index 00000000000..196f1f2e4b7
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/windows/mod.rs
@@ -0,0 +1,601 @@
+//! Windows CRT 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 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 = ::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 = 8192;
+pub const S_IFDIR: ::c_int = 16384;
+pub const S_IFREG: ::c_int = 32768;
+pub const S_IFMT: ::c_int = 61440;
+pub const S_IEXEC: ::c_int = 64;
+pub const S_IWRITE: ::c_int = 128;
+pub const S_IREAD: ::c_int = 256;
+
+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: ::sighandler_t = 0;
+pub const SIG_IGN: ::sighandler_t = 1;
+pub const SIG_GET: ::sighandler_t = 2;
+pub const SIG_SGE: ::sighandler_t = 3;
+pub const SIG_ACK: ::sighandler_t = 4;
+
+// 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) -> ::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 ::FILE;
+    #[link_name = "_pclose"]
+    pub fn pclose(stream: *mut ::FILE) -> ::c_int;
+    #[link_name = "_fdopen"]
+    pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
+    #[link_name = "_fileno"]
+    pub fn fileno(stream: *mut ::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"]
+    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 = "_putenv"]
+    pub fn putenv(envstring: *const ::c_char) -> ::c_int;
+    #[link_name = "_wputenv"]
+    pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int;
+    #[link_name = "_putenv_s"]
+    pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t;
+    #[link_name = "_wputenv_s"]
+    pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t;
+}
+
+extern "system" {
+    pub fn listen(s: SOCKET, backlog: ::c_int) -> ::c_int;
+    pub fn accept(s: SOCKET, addr: *mut ::sockaddr, addrlen: *mut ::c_int) -> SOCKET;
+    pub fn bind(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int;
+    pub fn connect(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int;
+    pub fn getpeername(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int;
+    pub fn getsockname(s: SOCKET, name: *mut ::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 ::sockaddr,
+        fromlen: *mut ::c_int,
+    ) -> ::c_int;
+    pub fn sendto(
+        s: SOCKET,
+        buf: *const ::c_char,
+        len: ::c_int,
+        flags: ::c_int,
+        to: *const ::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(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
+
+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 --git a/libgrust/libformat_parser/vendor/libc/src/windows/msvc/mod.rs b/libgrust/libformat_parser/vendor/libc/src/windows/msvc/mod.rs
new file mode 100644
index 00000000000..f5a1d95f395
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/windows/msvc/mod.rs
@@ -0,0 +1,20 @@
+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 --git a/libgrust/libformat_parser/vendor/libc/src/xous.rs b/libgrust/libformat_parser/vendor/libc/src/xous.rs
new file mode 100644
index 00000000000..e6c0c2573d0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/src/xous.rs
@@ -0,0 +1,49 @@
+//! 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;
+
+cfg_if! {
+    if #[cfg(libc_core_cvoid)] {
+        pub use ::ffi::c_void;
+    } else {
+        // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
+        // enable more optimization opportunities around it recognizing things
+        // like malloc/free.
+        #[repr(u8)]
+        #[allow(missing_copy_implementations)]
+        #[allow(missing_debug_implementations)]
+        pub enum c_void {
+            // Two dummy variants so the #[repr] attribute can be used.
+            #[doc(hidden)]
+            __variant1,
+            #[doc(hidden)]
+            __variant2,
+        }
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/libc/tests/const_fn.rs b/libgrust/libformat_parser/vendor/libc/tests/const_fn.rs
new file mode 100644
index 00000000000..0e7e1864b9f
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/libc/tests/const_fn.rs
@@ -0,0 +1,5 @@
+#![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty
+
+#[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 --git a/libgrust/libformat_parser/vendor/unicode-xid/.cargo-checksum.json b/libgrust/libformat_parser/vendor/unicode-xid/.cargo-checksum.json
new file mode 100644
index 00000000000..be3630543bf
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"289ae8b5c1859b5556dd663b31efae72255f69e3c05408ce7a51c8ba65573677","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"d13b0abf515d4b41b684a2255169f4340c32256c91e6a4835cafaec2161b5e5f","benches/xid.rs":"a2986ce1df5d93bff51e73dc234bffb341d4fe5d749247296f02396dde16a72b","src/lib.rs":"3cdd204115af45e9ece70db737d711e1798eac40eaa6cc4e8280bb3342e1408e","src/tables.rs":"e4c2e9b70f45d262b78fde8435a969eb2478ca6d9dacd061953f54cf344f0f4d","src/tests.rs":"b866f890acd631e667635785c34b1723709f10a9515ca525b41de8a062c7b204","tests/exhaustive_tests.rs":"ec91e9124d61e5b3e2fbbbf37a2fd30d6c7a8fa22639d6720b416d9ebc1007c5"},"package":"f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"}
\ No newline at end of file
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/COPYRIGHT b/libgrust/libformat_parser/vendor/unicode-xid/COPYRIGHT
new file mode 100644
index 00000000000..b286ec16abb
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/COPYRIGHT
@@ -0,0 +1,7 @@
+Licensed under the Apache License, Version 2.0
+<LICENSE-APACHE or
+http://www.apache.org/licenses/LICENSE-2.0> or the MIT
+license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
+at your option. All files in the project carrying such
+notice may not be copied, modified, or distributed except
+according to those terms.
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/Cargo.toml b/libgrust/libformat_parser/vendor/unicode-xid/Cargo.toml
new file mode 100644
index 00000000000..817a4f42f17
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/Cargo.toml
@@ -0,0 +1,51 @@
+# 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.17"
+name = "unicode-xid"
+version = "0.2.4"
+authors = [
+    "erick.tryzelaar <erick.tryzelaar@gmail.com>",
+    "kwantam <kwantam@gmail.com>",
+    "Manish Goregaokar <manishsmail@gmail.com>",
+]
+exclude = [
+    "/.github/**",
+    "/scripts/*",
+]
+description = """
+Determine whether characters have the XID_Start
+or XID_Continue properties according to
+Unicode Standard Annex #31.
+"""
+homepage = "https://github.com/unicode-rs/unicode-xid"
+documentation = "https://unicode-rs.github.io/unicode-xid"
+readme = "README.md"
+keywords = [
+    "text",
+    "unicode",
+    "xid",
+]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/unicode-rs/unicode-xid"
+
+[[bench]]
+name = "xid"
+harness = false
+
+[dev-dependencies.criterion]
+version = "0.3"
+
+[features]
+bench = []
+default = []
+no_std = []
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/LICENSE-APACHE b/libgrust/libformat_parser/vendor/unicode-xid/LICENSE-APACHE
new file mode 100644
index 00000000000..16fe87b06e8
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/LICENSE-APACHE
@@ -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 --git a/libgrust/libformat_parser/vendor/unicode-xid/LICENSE-MIT b/libgrust/libformat_parser/vendor/unicode-xid/LICENSE-MIT
new file mode 100644
index 00000000000..e69282e381b
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2015 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 --git a/libgrust/libformat_parser/vendor/unicode-xid/README.md b/libgrust/libformat_parser/vendor/unicode-xid/README.md
new file mode 100644
index 00000000000..747684303df
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/README.md
@@ -0,0 +1,53 @@
+# unicode-xid
+
+Determine if a `char` is a valid identifier for a parser and/or lexer according to
+[Unicode Standard Annex #31](http://www.unicode.org/reports/tr31/) rules.
+
+[![Build Status](https://img.shields.io/github/workflow/status/unicode-rs/unicode-xid/CI/master)](https://github.com/unicode-rs/unicode-xid/actions?query=branch%3Amaster)
+
+[Documentation](https://unicode-rs.github.io/unicode-xid/unicode_xid/index.html)
+
+```rust
+extern crate unicode_xid;
+
+use unicode_xid::UnicodeXID;
+
+fn main() {
+    let ch = 'a';
+    println!("Is {} a valid start of an identifier? {}", ch, UnicodeXID::is_xid_start(ch));
+}
+```
+
+# features
+
+unicode-xid supports a `no_std` feature. This eliminates dependence
+on std, and instead uses equivalent functions from core.
+
+
+# changelog
+
+## 0.2.4
+
+- Update to Unicode 15.0.0
+- Replace `const` tables with `static` tables.
+
+## 0.2.3
+
+- Update to Unicode 14.0.0
+
+## 0.2.2
+
+- Add an ASCII fast-path
+
+## 0.2.1
+
+- Update to Unicode 13.0.0
+- Speed up lookup
+
+## 0.2.0
+
+- Update to Unicode 12.1.0.
+
+## 0.1.0
+
+- Initial release.
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/benches/xid.rs b/libgrust/libformat_parser/vendor/unicode-xid/benches/xid.rs
new file mode 100644
index 00000000000..a565c36e170
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/benches/xid.rs
@@ -0,0 +1,60 @@
+extern crate criterion;
+extern crate unicode_xid;
+
+use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
+use unicode_xid::UnicodeXID;
+
+fn bench_unicode_xid(c: &mut Criterion) {
+    let unicode_chars = chars(1..0x3000);
+    let ascii_chars = chars(1..0x80);
+
+    let mut group = c.benchmark_group("UnicodeXID");
+    group.throughput(Throughput::Bytes(unicode_chars.len() as u64));
+    group.bench_with_input(
+        BenchmarkId::new("is_xid_start", "unicode"),
+        &unicode_chars,
+        |b, chars| b.iter(|| chars.iter().copied().map(UnicodeXID::is_xid_start).last()),
+    );
+    group.throughput(Throughput::Bytes(ascii_chars.len() as u64));
+    group.bench_with_input(
+        BenchmarkId::new("is_xid_start", "ascii"),
+        &ascii_chars,
+        |b, chars| b.iter(|| chars.iter().copied().map(UnicodeXID::is_xid_start).last()),
+    );
+    group.throughput(Throughput::Bytes(unicode_chars.len() as u64));
+    group.bench_with_input(
+        BenchmarkId::new("is_xid_continue", "unicode"),
+        &unicode_chars,
+        |b, chars| {
+            b.iter(|| {
+                chars
+                    .iter()
+                    .copied()
+                    .map(UnicodeXID::is_xid_continue)
+                    .last()
+            })
+        },
+    );
+    group.throughput(Throughput::Bytes(ascii_chars.len() as u64));
+    group.bench_with_input(
+        BenchmarkId::new("is_xid_continue", "ascii"),
+        &ascii_chars,
+        |b, chars| {
+            b.iter(|| {
+                chars
+                    .iter()
+                    .copied()
+                    .map(UnicodeXID::is_xid_continue)
+                    .last()
+            })
+        },
+    );
+    group.finish();
+}
+
+fn chars(range: std::ops::Range<u32>) -> Vec<char> {
+    range.filter_map(|i| std::char::from_u32(i)).collect()
+}
+
+criterion_group!(benches, bench_unicode_xid);
+criterion_main!(benches);
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/src/lib.rs b/libgrust/libformat_parser/vendor/unicode-xid/src/lib.rs
new file mode 100644
index 00000000000..af7015e5db0
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/src/lib.rs
@@ -0,0 +1,92 @@
+// Copyright 2012-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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Determine if a `char` is a valid identifier for a parser and/or lexer according to
+//! [Unicode Standard Annex #31](http://www.unicode.org/reports/tr31/) rules.
+//!
+//! ```rust
+//! extern crate unicode_xid;
+//!
+//! use unicode_xid::UnicodeXID;
+//!
+//! fn main() {
+//!     let ch = 'a';
+//!     println!("Is {} a valid start of an identifier? {}", ch, UnicodeXID::is_xid_start(ch));
+//! }
+//! ```
+//!
+//! # features
+//!
+//! unicode-xid supports a `no_std` feature. This eliminates dependence
+//! on std, and instead uses equivalent functions from core.
+//!
+
+#![forbid(unsafe_code)]
+#![deny(missing_docs)]
+#![doc(
+    html_logo_url = "https://unicode-rs.github.io/unicode-rs_sm.png",
+    html_favicon_url = "https://unicode-rs.github.io/unicode-rs_sm.png"
+)]
+#![no_std]
+#![cfg_attr(feature = "bench", feature(test, unicode_internals))]
+
+#[cfg(test)]
+#[macro_use]
+extern crate std;
+
+#[cfg(feature = "bench")]
+extern crate test;
+
+use tables::derived_property;
+pub use tables::UNICODE_VERSION;
+
+mod tables;
+
+#[cfg(test)]
+mod tests;
+
+/// Methods for determining if a character is a valid identifier character.
+pub trait UnicodeXID {
+    /// Returns whether the specified character satisfies the 'XID_Start'
+    /// Unicode property.
+    ///
+    /// 'XID_Start' is a Unicode Derived Property specified in
+    /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
+    /// mostly similar to ID_Start but modified for closure under NFKx.
+    fn is_xid_start(self) -> bool;
+
+    /// Returns whether the specified `char` satisfies the 'XID_Continue'
+    /// Unicode property.
+    ///
+    /// 'XID_Continue' is a Unicode Derived Property specified in
+    /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
+    /// mostly similar to 'ID_Continue' but modified for closure under NFKx.
+    fn is_xid_continue(self) -> bool;
+}
+
+impl UnicodeXID for char {
+    #[inline]
+    fn is_xid_start(self) -> bool {
+        // Fast-path for ascii idents
+        ('a' <= self && self <= 'z')
+            || ('A' <= self && self <= 'Z')
+            || (self > '\x7f' && derived_property::XID_Start(self))
+    }
+
+    #[inline]
+    fn is_xid_continue(self) -> bool {
+        // Fast-path for ascii idents
+        ('a' <= self && self <= 'z')
+            || ('A' <= self && self <= 'Z')
+            || ('0' <= self && self <= '9')
+            || self == '_'
+            || (self > '\x7f' && derived_property::XID_Continue(self))
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/src/tables.rs b/libgrust/libformat_parser/vendor/unicode-xid/src/tables.rs
new file mode 100644
index 00000000000..c12e76c0b76
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/src/tables.rs
@@ -0,0 +1,1494 @@
+// Copyright 2012-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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly
+
+#![allow(missing_docs, non_upper_case_globals, non_snake_case)]
+
+/// The version of [Unicode](http://www.unicode.org/)
+/// that this version of unicode-xid is based on.
+pub const UNICODE_VERSION: (u64, u64, u64) = (15, 0, 0);
+
+fn bsearch_range_table(c: char, r: &[(char, char)]) -> bool {
+    use core::cmp::Ordering::{Equal, Greater, Less};
+
+    r.binary_search_by(|&(lo, hi)| {
+        // Because ASCII ranges are at the start of the tables, a search for an
+        // ASCII char will involve more `Greater` results (i.e. the `(lo,hi)`
+        // table entry is greater than `c`) than `Less` results. And given that
+        // ASCII chars are so common, it makes sense to favor them. Therefore,
+        // the `Greater` case is tested for before the `Less` case.
+        if lo > c {
+            Greater
+        } else if hi < c {
+            Less
+        } else {
+            Equal
+        }
+    })
+    .is_ok()
+}
+
+pub mod derived_property {
+    static XID_Continue_table: &[(char, char)] = &[
+        ('\u{30}', '\u{39}'),
+        ('\u{41}', '\u{5a}'),
+        ('\u{5f}', '\u{5f}'),
+        ('\u{61}', '\u{7a}'),
+        ('\u{aa}', '\u{aa}'),
+        ('\u{b5}', '\u{b5}'),
+        ('\u{b7}', '\u{b7}'),
+        ('\u{ba}', '\u{ba}'),
+        ('\u{c0}', '\u{d6}'),
+        ('\u{d8}', '\u{f6}'),
+        ('\u{f8}', '\u{2c1}'),
+        ('\u{2c6}', '\u{2d1}'),
+        ('\u{2e0}', '\u{2e4}'),
+        ('\u{2ec}', '\u{2ec}'),
+        ('\u{2ee}', '\u{2ee}'),
+        ('\u{300}', '\u{374}'),
+        ('\u{376}', '\u{377}'),
+        ('\u{37b}', '\u{37d}'),
+        ('\u{37f}', '\u{37f}'),
+        ('\u{386}', '\u{38a}'),
+        ('\u{38c}', '\u{38c}'),
+        ('\u{38e}', '\u{3a1}'),
+        ('\u{3a3}', '\u{3f5}'),
+        ('\u{3f7}', '\u{481}'),
+        ('\u{483}', '\u{487}'),
+        ('\u{48a}', '\u{52f}'),
+        ('\u{531}', '\u{556}'),
+        ('\u{559}', '\u{559}'),
+        ('\u{560}', '\u{588}'),
+        ('\u{591}', '\u{5bd}'),
+        ('\u{5bf}', '\u{5bf}'),
+        ('\u{5c1}', '\u{5c2}'),
+        ('\u{5c4}', '\u{5c5}'),
+        ('\u{5c7}', '\u{5c7}'),
+        ('\u{5d0}', '\u{5ea}'),
+        ('\u{5ef}', '\u{5f2}'),
+        ('\u{610}', '\u{61a}'),
+        ('\u{620}', '\u{669}'),
+        ('\u{66e}', '\u{6d3}'),
+        ('\u{6d5}', '\u{6dc}'),
+        ('\u{6df}', '\u{6e8}'),
+        ('\u{6ea}', '\u{6fc}'),
+        ('\u{6ff}', '\u{6ff}'),
+        ('\u{710}', '\u{74a}'),
+        ('\u{74d}', '\u{7b1}'),
+        ('\u{7c0}', '\u{7f5}'),
+        ('\u{7fa}', '\u{7fa}'),
+        ('\u{7fd}', '\u{7fd}'),
+        ('\u{800}', '\u{82d}'),
+        ('\u{840}', '\u{85b}'),
+        ('\u{860}', '\u{86a}'),
+        ('\u{870}', '\u{887}'),
+        ('\u{889}', '\u{88e}'),
+        ('\u{898}', '\u{8e1}'),
+        ('\u{8e3}', '\u{963}'),
+        ('\u{966}', '\u{96f}'),
+        ('\u{971}', '\u{983}'),
+        ('\u{985}', '\u{98c}'),
+        ('\u{98f}', '\u{990}'),
+        ('\u{993}', '\u{9a8}'),
+        ('\u{9aa}', '\u{9b0}'),
+        ('\u{9b2}', '\u{9b2}'),
+        ('\u{9b6}', '\u{9b9}'),
+        ('\u{9bc}', '\u{9c4}'),
+        ('\u{9c7}', '\u{9c8}'),
+        ('\u{9cb}', '\u{9ce}'),
+        ('\u{9d7}', '\u{9d7}'),
+        ('\u{9dc}', '\u{9dd}'),
+        ('\u{9df}', '\u{9e3}'),
+        ('\u{9e6}', '\u{9f1}'),
+        ('\u{9fc}', '\u{9fc}'),
+        ('\u{9fe}', '\u{9fe}'),
+        ('\u{a01}', '\u{a03}'),
+        ('\u{a05}', '\u{a0a}'),
+        ('\u{a0f}', '\u{a10}'),
+        ('\u{a13}', '\u{a28}'),
+        ('\u{a2a}', '\u{a30}'),
+        ('\u{a32}', '\u{a33}'),
+        ('\u{a35}', '\u{a36}'),
+        ('\u{a38}', '\u{a39}'),
+        ('\u{a3c}', '\u{a3c}'),
+        ('\u{a3e}', '\u{a42}'),
+        ('\u{a47}', '\u{a48}'),
+        ('\u{a4b}', '\u{a4d}'),
+        ('\u{a51}', '\u{a51}'),
+        ('\u{a59}', '\u{a5c}'),
+        ('\u{a5e}', '\u{a5e}'),
+        ('\u{a66}', '\u{a75}'),
+        ('\u{a81}', '\u{a83}'),
+        ('\u{a85}', '\u{a8d}'),
+        ('\u{a8f}', '\u{a91}'),
+        ('\u{a93}', '\u{aa8}'),
+        ('\u{aaa}', '\u{ab0}'),
+        ('\u{ab2}', '\u{ab3}'),
+        ('\u{ab5}', '\u{ab9}'),
+        ('\u{abc}', '\u{ac5}'),
+        ('\u{ac7}', '\u{ac9}'),
+        ('\u{acb}', '\u{acd}'),
+        ('\u{ad0}', '\u{ad0}'),
+        ('\u{ae0}', '\u{ae3}'),
+        ('\u{ae6}', '\u{aef}'),
+        ('\u{af9}', '\u{aff}'),
+        ('\u{b01}', '\u{b03}'),
+        ('\u{b05}', '\u{b0c}'),
+        ('\u{b0f}', '\u{b10}'),
+        ('\u{b13}', '\u{b28}'),
+        ('\u{b2a}', '\u{b30}'),
+        ('\u{b32}', '\u{b33}'),
+        ('\u{b35}', '\u{b39}'),
+        ('\u{b3c}', '\u{b44}'),
+        ('\u{b47}', '\u{b48}'),
+        ('\u{b4b}', '\u{b4d}'),
+        ('\u{b55}', '\u{b57}'),
+        ('\u{b5c}', '\u{b5d}'),
+        ('\u{b5f}', '\u{b63}'),
+        ('\u{b66}', '\u{b6f}'),
+        ('\u{b71}', '\u{b71}'),
+        ('\u{b82}', '\u{b83}'),
+        ('\u{b85}', '\u{b8a}'),
+        ('\u{b8e}', '\u{b90}'),
+        ('\u{b92}', '\u{b95}'),
+        ('\u{b99}', '\u{b9a}'),
+        ('\u{b9c}', '\u{b9c}'),
+        ('\u{b9e}', '\u{b9f}'),
+        ('\u{ba3}', '\u{ba4}'),
+        ('\u{ba8}', '\u{baa}'),
+        ('\u{bae}', '\u{bb9}'),
+        ('\u{bbe}', '\u{bc2}'),
+        ('\u{bc6}', '\u{bc8}'),
+        ('\u{bca}', '\u{bcd}'),
+        ('\u{bd0}', '\u{bd0}'),
+        ('\u{bd7}', '\u{bd7}'),
+        ('\u{be6}', '\u{bef}'),
+        ('\u{c00}', '\u{c0c}'),
+        ('\u{c0e}', '\u{c10}'),
+        ('\u{c12}', '\u{c28}'),
+        ('\u{c2a}', '\u{c39}'),
+        ('\u{c3c}', '\u{c44}'),
+        ('\u{c46}', '\u{c48}'),
+        ('\u{c4a}', '\u{c4d}'),
+        ('\u{c55}', '\u{c56}'),
+        ('\u{c58}', '\u{c5a}'),
+        ('\u{c5d}', '\u{c5d}'),
+        ('\u{c60}', '\u{c63}'),
+        ('\u{c66}', '\u{c6f}'),
+        ('\u{c80}', '\u{c83}'),
+        ('\u{c85}', '\u{c8c}'),
+        ('\u{c8e}', '\u{c90}'),
+        ('\u{c92}', '\u{ca8}'),
+        ('\u{caa}', '\u{cb3}'),
+        ('\u{cb5}', '\u{cb9}'),
+        ('\u{cbc}', '\u{cc4}'),
+        ('\u{cc6}', '\u{cc8}'),
+        ('\u{cca}', '\u{ccd}'),
+        ('\u{cd5}', '\u{cd6}'),
+        ('\u{cdd}', '\u{cde}'),
+        ('\u{ce0}', '\u{ce3}'),
+        ('\u{ce6}', '\u{cef}'),
+        ('\u{cf1}', '\u{cf3}'),
+        ('\u{d00}', '\u{d0c}'),
+        ('\u{d0e}', '\u{d10}'),
+        ('\u{d12}', '\u{d44}'),
+        ('\u{d46}', '\u{d48}'),
+        ('\u{d4a}', '\u{d4e}'),
+        ('\u{d54}', '\u{d57}'),
+        ('\u{d5f}', '\u{d63}'),
+        ('\u{d66}', '\u{d6f}'),
+        ('\u{d7a}', '\u{d7f}'),
+        ('\u{d81}', '\u{d83}'),
+        ('\u{d85}', '\u{d96}'),
+        ('\u{d9a}', '\u{db1}'),
+        ('\u{db3}', '\u{dbb}'),
+        ('\u{dbd}', '\u{dbd}'),
+        ('\u{dc0}', '\u{dc6}'),
+        ('\u{dca}', '\u{dca}'),
+        ('\u{dcf}', '\u{dd4}'),
+        ('\u{dd6}', '\u{dd6}'),
+        ('\u{dd8}', '\u{ddf}'),
+        ('\u{de6}', '\u{def}'),
+        ('\u{df2}', '\u{df3}'),
+        ('\u{e01}', '\u{e3a}'),
+        ('\u{e40}', '\u{e4e}'),
+        ('\u{e50}', '\u{e59}'),
+        ('\u{e81}', '\u{e82}'),
+        ('\u{e84}', '\u{e84}'),
+        ('\u{e86}', '\u{e8a}'),
+        ('\u{e8c}', '\u{ea3}'),
+        ('\u{ea5}', '\u{ea5}'),
+        ('\u{ea7}', '\u{ebd}'),
+        ('\u{ec0}', '\u{ec4}'),
+        ('\u{ec6}', '\u{ec6}'),
+        ('\u{ec8}', '\u{ece}'),
+        ('\u{ed0}', '\u{ed9}'),
+        ('\u{edc}', '\u{edf}'),
+        ('\u{f00}', '\u{f00}'),
+        ('\u{f18}', '\u{f19}'),
+        ('\u{f20}', '\u{f29}'),
+        ('\u{f35}', '\u{f35}'),
+        ('\u{f37}', '\u{f37}'),
+        ('\u{f39}', '\u{f39}'),
+        ('\u{f3e}', '\u{f47}'),
+        ('\u{f49}', '\u{f6c}'),
+        ('\u{f71}', '\u{f84}'),
+        ('\u{f86}', '\u{f97}'),
+        ('\u{f99}', '\u{fbc}'),
+        ('\u{fc6}', '\u{fc6}'),
+        ('\u{1000}', '\u{1049}'),
+        ('\u{1050}', '\u{109d}'),
+        ('\u{10a0}', '\u{10c5}'),
+        ('\u{10c7}', '\u{10c7}'),
+        ('\u{10cd}', '\u{10cd}'),
+        ('\u{10d0}', '\u{10fa}'),
+        ('\u{10fc}', '\u{1248}'),
+        ('\u{124a}', '\u{124d}'),
+        ('\u{1250}', '\u{1256}'),
+        ('\u{1258}', '\u{1258}'),
+        ('\u{125a}', '\u{125d}'),
+        ('\u{1260}', '\u{1288}'),
+        ('\u{128a}', '\u{128d}'),
+        ('\u{1290}', '\u{12b0}'),
+        ('\u{12b2}', '\u{12b5}'),
+        ('\u{12b8}', '\u{12be}'),
+        ('\u{12c0}', '\u{12c0}'),
+        ('\u{12c2}', '\u{12c5}'),
+        ('\u{12c8}', '\u{12d6}'),
+        ('\u{12d8}', '\u{1310}'),
+        ('\u{1312}', '\u{1315}'),
+        ('\u{1318}', '\u{135a}'),
+        ('\u{135d}', '\u{135f}'),
+        ('\u{1369}', '\u{1371}'),
+        ('\u{1380}', '\u{138f}'),
+        ('\u{13a0}', '\u{13f5}'),
+        ('\u{13f8}', '\u{13fd}'),
+        ('\u{1401}', '\u{166c}'),
+        ('\u{166f}', '\u{167f}'),
+        ('\u{1681}', '\u{169a}'),
+        ('\u{16a0}', '\u{16ea}'),
+        ('\u{16ee}', '\u{16f8}'),
+        ('\u{1700}', '\u{1715}'),
+        ('\u{171f}', '\u{1734}'),
+        ('\u{1740}', '\u{1753}'),
+        ('\u{1760}', '\u{176c}'),
+        ('\u{176e}', '\u{1770}'),
+        ('\u{1772}', '\u{1773}'),
+        ('\u{1780}', '\u{17d3}'),
+        ('\u{17d7}', '\u{17d7}'),
+        ('\u{17dc}', '\u{17dd}'),
+        ('\u{17e0}', '\u{17e9}'),
+        ('\u{180b}', '\u{180d}'),
+        ('\u{180f}', '\u{1819}'),
+        ('\u{1820}', '\u{1878}'),
+        ('\u{1880}', '\u{18aa}'),
+        ('\u{18b0}', '\u{18f5}'),
+        ('\u{1900}', '\u{191e}'),
+        ('\u{1920}', '\u{192b}'),
+        ('\u{1930}', '\u{193b}'),
+        ('\u{1946}', '\u{196d}'),
+        ('\u{1970}', '\u{1974}'),
+        ('\u{1980}', '\u{19ab}'),
+        ('\u{19b0}', '\u{19c9}'),
+        ('\u{19d0}', '\u{19da}'),
+        ('\u{1a00}', '\u{1a1b}'),
+        ('\u{1a20}', '\u{1a5e}'),
+        ('\u{1a60}', '\u{1a7c}'),
+        ('\u{1a7f}', '\u{1a89}'),
+        ('\u{1a90}', '\u{1a99}'),
+        ('\u{1aa7}', '\u{1aa7}'),
+        ('\u{1ab0}', '\u{1abd}'),
+        ('\u{1abf}', '\u{1ace}'),
+        ('\u{1b00}', '\u{1b4c}'),
+        ('\u{1b50}', '\u{1b59}'),
+        ('\u{1b6b}', '\u{1b73}'),
+        ('\u{1b80}', '\u{1bf3}'),
+        ('\u{1c00}', '\u{1c37}'),
+        ('\u{1c40}', '\u{1c49}'),
+        ('\u{1c4d}', '\u{1c7d}'),
+        ('\u{1c80}', '\u{1c88}'),
+        ('\u{1c90}', '\u{1cba}'),
+        ('\u{1cbd}', '\u{1cbf}'),
+        ('\u{1cd0}', '\u{1cd2}'),
+        ('\u{1cd4}', '\u{1cfa}'),
+        ('\u{1d00}', '\u{1f15}'),
+        ('\u{1f18}', '\u{1f1d}'),
+        ('\u{1f20}', '\u{1f45}'),
+        ('\u{1f48}', '\u{1f4d}'),
+        ('\u{1f50}', '\u{1f57}'),
+        ('\u{1f59}', '\u{1f59}'),
+        ('\u{1f5b}', '\u{1f5b}'),
+        ('\u{1f5d}', '\u{1f5d}'),
+        ('\u{1f5f}', '\u{1f7d}'),
+        ('\u{1f80}', '\u{1fb4}'),
+        ('\u{1fb6}', '\u{1fbc}'),
+        ('\u{1fbe}', '\u{1fbe}'),
+        ('\u{1fc2}', '\u{1fc4}'),
+        ('\u{1fc6}', '\u{1fcc}'),
+        ('\u{1fd0}', '\u{1fd3}'),
+        ('\u{1fd6}', '\u{1fdb}'),
+        ('\u{1fe0}', '\u{1fec}'),
+        ('\u{1ff2}', '\u{1ff4}'),
+        ('\u{1ff6}', '\u{1ffc}'),
+        ('\u{203f}', '\u{2040}'),
+        ('\u{2054}', '\u{2054}'),
+        ('\u{2071}', '\u{2071}'),
+        ('\u{207f}', '\u{207f}'),
+        ('\u{2090}', '\u{209c}'),
+        ('\u{20d0}', '\u{20dc}'),
+        ('\u{20e1}', '\u{20e1}'),
+        ('\u{20e5}', '\u{20f0}'),
+        ('\u{2102}', '\u{2102}'),
+        ('\u{2107}', '\u{2107}'),
+        ('\u{210a}', '\u{2113}'),
+        ('\u{2115}', '\u{2115}'),
+        ('\u{2118}', '\u{211d}'),
+        ('\u{2124}', '\u{2124}'),
+        ('\u{2126}', '\u{2126}'),
+        ('\u{2128}', '\u{2128}'),
+        ('\u{212a}', '\u{2139}'),
+        ('\u{213c}', '\u{213f}'),
+        ('\u{2145}', '\u{2149}'),
+        ('\u{214e}', '\u{214e}'),
+        ('\u{2160}', '\u{2188}'),
+        ('\u{2c00}', '\u{2ce4}'),
+        ('\u{2ceb}', '\u{2cf3}'),
+        ('\u{2d00}', '\u{2d25}'),
+        ('\u{2d27}', '\u{2d27}'),
+        ('\u{2d2d}', '\u{2d2d}'),
+        ('\u{2d30}', '\u{2d67}'),
+        ('\u{2d6f}', '\u{2d6f}'),
+        ('\u{2d7f}', '\u{2d96}'),
+        ('\u{2da0}', '\u{2da6}'),
+        ('\u{2da8}', '\u{2dae}'),
+        ('\u{2db0}', '\u{2db6}'),
+        ('\u{2db8}', '\u{2dbe}'),
+        ('\u{2dc0}', '\u{2dc6}'),
+        ('\u{2dc8}', '\u{2dce}'),
+        ('\u{2dd0}', '\u{2dd6}'),
+        ('\u{2dd8}', '\u{2dde}'),
+        ('\u{2de0}', '\u{2dff}'),
+        ('\u{3005}', '\u{3007}'),
+        ('\u{3021}', '\u{302f}'),
+        ('\u{3031}', '\u{3035}'),
+        ('\u{3038}', '\u{303c}'),
+        ('\u{3041}', '\u{3096}'),
+        ('\u{3099}', '\u{309a}'),
+        ('\u{309d}', '\u{309f}'),
+        ('\u{30a1}', '\u{30fa}'),
+        ('\u{30fc}', '\u{30ff}'),
+        ('\u{3105}', '\u{312f}'),
+        ('\u{3131}', '\u{318e}'),
+        ('\u{31a0}', '\u{31bf}'),
+        ('\u{31f0}', '\u{31ff}'),
+        ('\u{3400}', '\u{4dbf}'),
+        ('\u{4e00}', '\u{a48c}'),
+        ('\u{a4d0}', '\u{a4fd}'),
+        ('\u{a500}', '\u{a60c}'),
+        ('\u{a610}', '\u{a62b}'),
+        ('\u{a640}', '\u{a66f}'),
+        ('\u{a674}', '\u{a67d}'),
+        ('\u{a67f}', '\u{a6f1}'),
+        ('\u{a717}', '\u{a71f}'),
+        ('\u{a722}', '\u{a788}'),
+        ('\u{a78b}', '\u{a7ca}'),
+        ('\u{a7d0}', '\u{a7d1}'),
+        ('\u{a7d3}', '\u{a7d3}'),
+        ('\u{a7d5}', '\u{a7d9}'),
+        ('\u{a7f2}', '\u{a827}'),
+        ('\u{a82c}', '\u{a82c}'),
+        ('\u{a840}', '\u{a873}'),
+        ('\u{a880}', '\u{a8c5}'),
+        ('\u{a8d0}', '\u{a8d9}'),
+        ('\u{a8e0}', '\u{a8f7}'),
+        ('\u{a8fb}', '\u{a8fb}'),
+        ('\u{a8fd}', '\u{a92d}'),
+        ('\u{a930}', '\u{a953}'),
+        ('\u{a960}', '\u{a97c}'),
+        ('\u{a980}', '\u{a9c0}'),
+        ('\u{a9cf}', '\u{a9d9}'),
+        ('\u{a9e0}', '\u{a9fe}'),
+        ('\u{aa00}', '\u{aa36}'),
+        ('\u{aa40}', '\u{aa4d}'),
+        ('\u{aa50}', '\u{aa59}'),
+        ('\u{aa60}', '\u{aa76}'),
+        ('\u{aa7a}', '\u{aac2}'),
+        ('\u{aadb}', '\u{aadd}'),
+        ('\u{aae0}', '\u{aaef}'),
+        ('\u{aaf2}', '\u{aaf6}'),
+        ('\u{ab01}', '\u{ab06}'),
+        ('\u{ab09}', '\u{ab0e}'),
+        ('\u{ab11}', '\u{ab16}'),
+        ('\u{ab20}', '\u{ab26}'),
+        ('\u{ab28}', '\u{ab2e}'),
+        ('\u{ab30}', '\u{ab5a}'),
+        ('\u{ab5c}', '\u{ab69}'),
+        ('\u{ab70}', '\u{abea}'),
+        ('\u{abec}', '\u{abed}'),
+        ('\u{abf0}', '\u{abf9}'),
+        ('\u{ac00}', '\u{d7a3}'),
+        ('\u{d7b0}', '\u{d7c6}'),
+        ('\u{d7cb}', '\u{d7fb}'),
+        ('\u{f900}', '\u{fa6d}'),
+        ('\u{fa70}', '\u{fad9}'),
+        ('\u{fb00}', '\u{fb06}'),
+        ('\u{fb13}', '\u{fb17}'),
+        ('\u{fb1d}', '\u{fb28}'),
+        ('\u{fb2a}', '\u{fb36}'),
+        ('\u{fb38}', '\u{fb3c}'),
+        ('\u{fb3e}', '\u{fb3e}'),
+        ('\u{fb40}', '\u{fb41}'),
+        ('\u{fb43}', '\u{fb44}'),
+        ('\u{fb46}', '\u{fbb1}'),
+        ('\u{fbd3}', '\u{fc5d}'),
+        ('\u{fc64}', '\u{fd3d}'),
+        ('\u{fd50}', '\u{fd8f}'),
+        ('\u{fd92}', '\u{fdc7}'),
+        ('\u{fdf0}', '\u{fdf9}'),
+        ('\u{fe00}', '\u{fe0f}'),
+        ('\u{fe20}', '\u{fe2f}'),
+        ('\u{fe33}', '\u{fe34}'),
+        ('\u{fe4d}', '\u{fe4f}'),
+        ('\u{fe71}', '\u{fe71}'),
+        ('\u{fe73}', '\u{fe73}'),
+        ('\u{fe77}', '\u{fe77}'),
+        ('\u{fe79}', '\u{fe79}'),
+        ('\u{fe7b}', '\u{fe7b}'),
+        ('\u{fe7d}', '\u{fe7d}'),
+        ('\u{fe7f}', '\u{fefc}'),
+        ('\u{ff10}', '\u{ff19}'),
+        ('\u{ff21}', '\u{ff3a}'),
+        ('\u{ff3f}', '\u{ff3f}'),
+        ('\u{ff41}', '\u{ff5a}'),
+        ('\u{ff66}', '\u{ffbe}'),
+        ('\u{ffc2}', '\u{ffc7}'),
+        ('\u{ffca}', '\u{ffcf}'),
+        ('\u{ffd2}', '\u{ffd7}'),
+        ('\u{ffda}', '\u{ffdc}'),
+        ('\u{10000}', '\u{1000b}'),
+        ('\u{1000d}', '\u{10026}'),
+        ('\u{10028}', '\u{1003a}'),
+        ('\u{1003c}', '\u{1003d}'),
+        ('\u{1003f}', '\u{1004d}'),
+        ('\u{10050}', '\u{1005d}'),
+        ('\u{10080}', '\u{100fa}'),
+        ('\u{10140}', '\u{10174}'),
+        ('\u{101fd}', '\u{101fd}'),
+        ('\u{10280}', '\u{1029c}'),
+        ('\u{102a0}', '\u{102d0}'),
+        ('\u{102e0}', '\u{102e0}'),
+        ('\u{10300}', '\u{1031f}'),
+        ('\u{1032d}', '\u{1034a}'),
+        ('\u{10350}', '\u{1037a}'),
+        ('\u{10380}', '\u{1039d}'),
+        ('\u{103a0}', '\u{103c3}'),
+        ('\u{103c8}', '\u{103cf}'),
+        ('\u{103d1}', '\u{103d5}'),
+        ('\u{10400}', '\u{1049d}'),
+        ('\u{104a0}', '\u{104a9}'),
+        ('\u{104b0}', '\u{104d3}'),
+        ('\u{104d8}', '\u{104fb}'),
+        ('\u{10500}', '\u{10527}'),
+        ('\u{10530}', '\u{10563}'),
+        ('\u{10570}', '\u{1057a}'),
+        ('\u{1057c}', '\u{1058a}'),
+        ('\u{1058c}', '\u{10592}'),
+        ('\u{10594}', '\u{10595}'),
+        ('\u{10597}', '\u{105a1}'),
+        ('\u{105a3}', '\u{105b1}'),
+        ('\u{105b3}', '\u{105b9}'),
+        ('\u{105bb}', '\u{105bc}'),
+        ('\u{10600}', '\u{10736}'),
+        ('\u{10740}', '\u{10755}'),
+        ('\u{10760}', '\u{10767}'),
+        ('\u{10780}', '\u{10785}'),
+        ('\u{10787}', '\u{107b0}'),
+        ('\u{107b2}', '\u{107ba}'),
+        ('\u{10800}', '\u{10805}'),
+        ('\u{10808}', '\u{10808}'),
+        ('\u{1080a}', '\u{10835}'),
+        ('\u{10837}', '\u{10838}'),
+        ('\u{1083c}', '\u{1083c}'),
+        ('\u{1083f}', '\u{10855}'),
+        ('\u{10860}', '\u{10876}'),
+        ('\u{10880}', '\u{1089e}'),
+        ('\u{108e0}', '\u{108f2}'),
+        ('\u{108f4}', '\u{108f5}'),
+        ('\u{10900}', '\u{10915}'),
+        ('\u{10920}', '\u{10939}'),
+        ('\u{10980}', '\u{109b7}'),
+        ('\u{109be}', '\u{109bf}'),
+        ('\u{10a00}', '\u{10a03}'),
+        ('\u{10a05}', '\u{10a06}'),
+        ('\u{10a0c}', '\u{10a13}'),
+        ('\u{10a15}', '\u{10a17}'),
+        ('\u{10a19}', '\u{10a35}'),
+        ('\u{10a38}', '\u{10a3a}'),
+        ('\u{10a3f}', '\u{10a3f}'),
+        ('\u{10a60}', '\u{10a7c}'),
+        ('\u{10a80}', '\u{10a9c}'),
+        ('\u{10ac0}', '\u{10ac7}'),
+        ('\u{10ac9}', '\u{10ae6}'),
+        ('\u{10b00}', '\u{10b35}'),
+        ('\u{10b40}', '\u{10b55}'),
+        ('\u{10b60}', '\u{10b72}'),
+        ('\u{10b80}', '\u{10b91}'),
+        ('\u{10c00}', '\u{10c48}'),
+        ('\u{10c80}', '\u{10cb2}'),
+        ('\u{10cc0}', '\u{10cf2}'),
+        ('\u{10d00}', '\u{10d27}'),
+        ('\u{10d30}', '\u{10d39}'),
+        ('\u{10e80}', '\u{10ea9}'),
+        ('\u{10eab}', '\u{10eac}'),
+        ('\u{10eb0}', '\u{10eb1}'),
+        ('\u{10efd}', '\u{10f1c}'),
+        ('\u{10f27}', '\u{10f27}'),
+        ('\u{10f30}', '\u{10f50}'),
+        ('\u{10f70}', '\u{10f85}'),
+        ('\u{10fb0}', '\u{10fc4}'),
+        ('\u{10fe0}', '\u{10ff6}'),
+        ('\u{11000}', '\u{11046}'),
+        ('\u{11066}', '\u{11075}'),
+        ('\u{1107f}', '\u{110ba}'),
+        ('\u{110c2}', '\u{110c2}'),
+        ('\u{110d0}', '\u{110e8}'),
+        ('\u{110f0}', '\u{110f9}'),
+        ('\u{11100}', '\u{11134}'),
+        ('\u{11136}', '\u{1113f}'),
+        ('\u{11144}', '\u{11147}'),
+        ('\u{11150}', '\u{11173}'),
+        ('\u{11176}', '\u{11176}'),
+        ('\u{11180}', '\u{111c4}'),
+        ('\u{111c9}', '\u{111cc}'),
+        ('\u{111ce}', '\u{111da}'),
+        ('\u{111dc}', '\u{111dc}'),
+        ('\u{11200}', '\u{11211}'),
+        ('\u{11213}', '\u{11237}'),
+        ('\u{1123e}', '\u{11241}'),
+        ('\u{11280}', '\u{11286}'),
+        ('\u{11288}', '\u{11288}'),
+        ('\u{1128a}', '\u{1128d}'),
+        ('\u{1128f}', '\u{1129d}'),
+        ('\u{1129f}', '\u{112a8}'),
+        ('\u{112b0}', '\u{112ea}'),
+        ('\u{112f0}', '\u{112f9}'),
+        ('\u{11300}', '\u{11303}'),
+        ('\u{11305}', '\u{1130c}'),
+        ('\u{1130f}', '\u{11310}'),
+        ('\u{11313}', '\u{11328}'),
+        ('\u{1132a}', '\u{11330}'),
+        ('\u{11332}', '\u{11333}'),
+        ('\u{11335}', '\u{11339}'),
+        ('\u{1133b}', '\u{11344}'),
+        ('\u{11347}', '\u{11348}'),
+        ('\u{1134b}', '\u{1134d}'),
+        ('\u{11350}', '\u{11350}'),
+        ('\u{11357}', '\u{11357}'),
+        ('\u{1135d}', '\u{11363}'),
+        ('\u{11366}', '\u{1136c}'),
+        ('\u{11370}', '\u{11374}'),
+        ('\u{11400}', '\u{1144a}'),
+        ('\u{11450}', '\u{11459}'),
+        ('\u{1145e}', '\u{11461}'),
+        ('\u{11480}', '\u{114c5}'),
+        ('\u{114c7}', '\u{114c7}'),
+        ('\u{114d0}', '\u{114d9}'),
+        ('\u{11580}', '\u{115b5}'),
+        ('\u{115b8}', '\u{115c0}'),
+        ('\u{115d8}', '\u{115dd}'),
+        ('\u{11600}', '\u{11640}'),
+        ('\u{11644}', '\u{11644}'),
+        ('\u{11650}', '\u{11659}'),
+        ('\u{11680}', '\u{116b8}'),
+        ('\u{116c0}', '\u{116c9}'),
+        ('\u{11700}', '\u{1171a}'),
+        ('\u{1171d}', '\u{1172b}'),
+        ('\u{11730}', '\u{11739}'),
+        ('\u{11740}', '\u{11746}'),
+        ('\u{11800}', '\u{1183a}'),
+        ('\u{118a0}', '\u{118e9}'),
+        ('\u{118ff}', '\u{11906}'),
+        ('\u{11909}', '\u{11909}'),
+        ('\u{1190c}', '\u{11913}'),
+        ('\u{11915}', '\u{11916}'),
+        ('\u{11918}', '\u{11935}'),
+        ('\u{11937}', '\u{11938}'),
+        ('\u{1193b}', '\u{11943}'),
+        ('\u{11950}', '\u{11959}'),
+        ('\u{119a0}', '\u{119a7}'),
+        ('\u{119aa}', '\u{119d7}'),
+        ('\u{119da}', '\u{119e1}'),
+        ('\u{119e3}', '\u{119e4}'),
+        ('\u{11a00}', '\u{11a3e}'),
+        ('\u{11a47}', '\u{11a47}'),
+        ('\u{11a50}', '\u{11a99}'),
+        ('\u{11a9d}', '\u{11a9d}'),
+        ('\u{11ab0}', '\u{11af8}'),
+        ('\u{11c00}', '\u{11c08}'),
+        ('\u{11c0a}', '\u{11c36}'),
+        ('\u{11c38}', '\u{11c40}'),
+        ('\u{11c50}', '\u{11c59}'),
+        ('\u{11c72}', '\u{11c8f}'),
+        ('\u{11c92}', '\u{11ca7}'),
+        ('\u{11ca9}', '\u{11cb6}'),
+        ('\u{11d00}', '\u{11d06}'),
+        ('\u{11d08}', '\u{11d09}'),
+        ('\u{11d0b}', '\u{11d36}'),
+        ('\u{11d3a}', '\u{11d3a}'),
+        ('\u{11d3c}', '\u{11d3d}'),
+        ('\u{11d3f}', '\u{11d47}'),
+        ('\u{11d50}', '\u{11d59}'),
+        ('\u{11d60}', '\u{11d65}'),
+        ('\u{11d67}', '\u{11d68}'),
+        ('\u{11d6a}', '\u{11d8e}'),
+        ('\u{11d90}', '\u{11d91}'),
+        ('\u{11d93}', '\u{11d98}'),
+        ('\u{11da0}', '\u{11da9}'),
+        ('\u{11ee0}', '\u{11ef6}'),
+        ('\u{11f00}', '\u{11f10}'),
+        ('\u{11f12}', '\u{11f3a}'),
+        ('\u{11f3e}', '\u{11f42}'),
+        ('\u{11f50}', '\u{11f59}'),
+        ('\u{11fb0}', '\u{11fb0}'),
+        ('\u{12000}', '\u{12399}'),
+        ('\u{12400}', '\u{1246e}'),
+        ('\u{12480}', '\u{12543}'),
+        ('\u{12f90}', '\u{12ff0}'),
+        ('\u{13000}', '\u{1342f}'),
+        ('\u{13440}', '\u{13455}'),
+        ('\u{14400}', '\u{14646}'),
+        ('\u{16800}', '\u{16a38}'),
+        ('\u{16a40}', '\u{16a5e}'),
+        ('\u{16a60}', '\u{16a69}'),
+        ('\u{16a70}', '\u{16abe}'),
+        ('\u{16ac0}', '\u{16ac9}'),
+        ('\u{16ad0}', '\u{16aed}'),
+        ('\u{16af0}', '\u{16af4}'),
+        ('\u{16b00}', '\u{16b36}'),
+        ('\u{16b40}', '\u{16b43}'),
+        ('\u{16b50}', '\u{16b59}'),
+        ('\u{16b63}', '\u{16b77}'),
+        ('\u{16b7d}', '\u{16b8f}'),
+        ('\u{16e40}', '\u{16e7f}'),
+        ('\u{16f00}', '\u{16f4a}'),
+        ('\u{16f4f}', '\u{16f87}'),
+        ('\u{16f8f}', '\u{16f9f}'),
+        ('\u{16fe0}', '\u{16fe1}'),
+        ('\u{16fe3}', '\u{16fe4}'),
+        ('\u{16ff0}', '\u{16ff1}'),
+        ('\u{17000}', '\u{187f7}'),
+        ('\u{18800}', '\u{18cd5}'),
+        ('\u{18d00}', '\u{18d08}'),
+        ('\u{1aff0}', '\u{1aff3}'),
+        ('\u{1aff5}', '\u{1affb}'),
+        ('\u{1affd}', '\u{1affe}'),
+        ('\u{1b000}', '\u{1b122}'),
+        ('\u{1b132}', '\u{1b132}'),
+        ('\u{1b150}', '\u{1b152}'),
+        ('\u{1b155}', '\u{1b155}'),
+        ('\u{1b164}', '\u{1b167}'),
+        ('\u{1b170}', '\u{1b2fb}'),
+        ('\u{1bc00}', '\u{1bc6a}'),
+        ('\u{1bc70}', '\u{1bc7c}'),
+        ('\u{1bc80}', '\u{1bc88}'),
+        ('\u{1bc90}', '\u{1bc99}'),
+        ('\u{1bc9d}', '\u{1bc9e}'),
+        ('\u{1cf00}', '\u{1cf2d}'),
+        ('\u{1cf30}', '\u{1cf46}'),
+        ('\u{1d165}', '\u{1d169}'),
+        ('\u{1d16d}', '\u{1d172}'),
+        ('\u{1d17b}', '\u{1d182}'),
+        ('\u{1d185}', '\u{1d18b}'),
+        ('\u{1d1aa}', '\u{1d1ad}'),
+        ('\u{1d242}', '\u{1d244}'),
+        ('\u{1d400}', '\u{1d454}'),
+        ('\u{1d456}', '\u{1d49c}'),
+        ('\u{1d49e}', '\u{1d49f}'),
+        ('\u{1d4a2}', '\u{1d4a2}'),
+        ('\u{1d4a5}', '\u{1d4a6}'),
+        ('\u{1d4a9}', '\u{1d4ac}'),
+        ('\u{1d4ae}', '\u{1d4b9}'),
+        ('\u{1d4bb}', '\u{1d4bb}'),
+        ('\u{1d4bd}', '\u{1d4c3}'),
+        ('\u{1d4c5}', '\u{1d505}'),
+        ('\u{1d507}', '\u{1d50a}'),
+        ('\u{1d50d}', '\u{1d514}'),
+        ('\u{1d516}', '\u{1d51c}'),
+        ('\u{1d51e}', '\u{1d539}'),
+        ('\u{1d53b}', '\u{1d53e}'),
+        ('\u{1d540}', '\u{1d544}'),
+        ('\u{1d546}', '\u{1d546}'),
+        ('\u{1d54a}', '\u{1d550}'),
+        ('\u{1d552}', '\u{1d6a5}'),
+        ('\u{1d6a8}', '\u{1d6c0}'),
+        ('\u{1d6c2}', '\u{1d6da}'),
+        ('\u{1d6dc}', '\u{1d6fa}'),
+        ('\u{1d6fc}', '\u{1d714}'),
+        ('\u{1d716}', '\u{1d734}'),
+        ('\u{1d736}', '\u{1d74e}'),
+        ('\u{1d750}', '\u{1d76e}'),
+        ('\u{1d770}', '\u{1d788}'),
+        ('\u{1d78a}', '\u{1d7a8}'),
+        ('\u{1d7aa}', '\u{1d7c2}'),
+        ('\u{1d7c4}', '\u{1d7cb}'),
+        ('\u{1d7ce}', '\u{1d7ff}'),
+        ('\u{1da00}', '\u{1da36}'),
+        ('\u{1da3b}', '\u{1da6c}'),
+        ('\u{1da75}', '\u{1da75}'),
+        ('\u{1da84}', '\u{1da84}'),
+        ('\u{1da9b}', '\u{1da9f}'),
+        ('\u{1daa1}', '\u{1daaf}'),
+        ('\u{1df00}', '\u{1df1e}'),
+        ('\u{1df25}', '\u{1df2a}'),
+        ('\u{1e000}', '\u{1e006}'),
+        ('\u{1e008}', '\u{1e018}'),
+        ('\u{1e01b}', '\u{1e021}'),
+        ('\u{1e023}', '\u{1e024}'),
+        ('\u{1e026}', '\u{1e02a}'),
+        ('\u{1e030}', '\u{1e06d}'),
+        ('\u{1e08f}', '\u{1e08f}'),
+        ('\u{1e100}', '\u{1e12c}'),
+        ('\u{1e130}', '\u{1e13d}'),
+        ('\u{1e140}', '\u{1e149}'),
+        ('\u{1e14e}', '\u{1e14e}'),
+        ('\u{1e290}', '\u{1e2ae}'),
+        ('\u{1e2c0}', '\u{1e2f9}'),
+        ('\u{1e4d0}', '\u{1e4f9}'),
+        ('\u{1e7e0}', '\u{1e7e6}'),
+        ('\u{1e7e8}', '\u{1e7eb}'),
+        ('\u{1e7ed}', '\u{1e7ee}'),
+        ('\u{1e7f0}', '\u{1e7fe}'),
+        ('\u{1e800}', '\u{1e8c4}'),
+        ('\u{1e8d0}', '\u{1e8d6}'),
+        ('\u{1e900}', '\u{1e94b}'),
+        ('\u{1e950}', '\u{1e959}'),
+        ('\u{1ee00}', '\u{1ee03}'),
+        ('\u{1ee05}', '\u{1ee1f}'),
+        ('\u{1ee21}', '\u{1ee22}'),
+        ('\u{1ee24}', '\u{1ee24}'),
+        ('\u{1ee27}', '\u{1ee27}'),
+        ('\u{1ee29}', '\u{1ee32}'),
+        ('\u{1ee34}', '\u{1ee37}'),
+        ('\u{1ee39}', '\u{1ee39}'),
+        ('\u{1ee3b}', '\u{1ee3b}'),
+        ('\u{1ee42}', '\u{1ee42}'),
+        ('\u{1ee47}', '\u{1ee47}'),
+        ('\u{1ee49}', '\u{1ee49}'),
+        ('\u{1ee4b}', '\u{1ee4b}'),
+        ('\u{1ee4d}', '\u{1ee4f}'),
+        ('\u{1ee51}', '\u{1ee52}'),
+        ('\u{1ee54}', '\u{1ee54}'),
+        ('\u{1ee57}', '\u{1ee57}'),
+        ('\u{1ee59}', '\u{1ee59}'),
+        ('\u{1ee5b}', '\u{1ee5b}'),
+        ('\u{1ee5d}', '\u{1ee5d}'),
+        ('\u{1ee5f}', '\u{1ee5f}'),
+        ('\u{1ee61}', '\u{1ee62}'),
+        ('\u{1ee64}', '\u{1ee64}'),
+        ('\u{1ee67}', '\u{1ee6a}'),
+        ('\u{1ee6c}', '\u{1ee72}'),
+        ('\u{1ee74}', '\u{1ee77}'),
+        ('\u{1ee79}', '\u{1ee7c}'),
+        ('\u{1ee7e}', '\u{1ee7e}'),
+        ('\u{1ee80}', '\u{1ee89}'),
+        ('\u{1ee8b}', '\u{1ee9b}'),
+        ('\u{1eea1}', '\u{1eea3}'),
+        ('\u{1eea5}', '\u{1eea9}'),
+        ('\u{1eeab}', '\u{1eebb}'),
+        ('\u{1fbf0}', '\u{1fbf9}'),
+        ('\u{20000}', '\u{2a6df}'),
+        ('\u{2a700}', '\u{2b739}'),
+        ('\u{2b740}', '\u{2b81d}'),
+        ('\u{2b820}', '\u{2cea1}'),
+        ('\u{2ceb0}', '\u{2ebe0}'),
+        ('\u{2f800}', '\u{2fa1d}'),
+        ('\u{30000}', '\u{3134a}'),
+        ('\u{31350}', '\u{323af}'),
+        ('\u{e0100}', '\u{e01ef}'),
+    ];
+
+    pub fn XID_Continue(c: char) -> bool {
+        super::bsearch_range_table(c, XID_Continue_table)
+    }
+
+    static XID_Start_table: &[(char, char)] = &[
+        ('\u{41}', '\u{5a}'),
+        ('\u{61}', '\u{7a}'),
+        ('\u{aa}', '\u{aa}'),
+        ('\u{b5}', '\u{b5}'),
+        ('\u{ba}', '\u{ba}'),
+        ('\u{c0}', '\u{d6}'),
+        ('\u{d8}', '\u{f6}'),
+        ('\u{f8}', '\u{2c1}'),
+        ('\u{2c6}', '\u{2d1}'),
+        ('\u{2e0}', '\u{2e4}'),
+        ('\u{2ec}', '\u{2ec}'),
+        ('\u{2ee}', '\u{2ee}'),
+        ('\u{370}', '\u{374}'),
+        ('\u{376}', '\u{377}'),
+        ('\u{37b}', '\u{37d}'),
+        ('\u{37f}', '\u{37f}'),
+        ('\u{386}', '\u{386}'),
+        ('\u{388}', '\u{38a}'),
+        ('\u{38c}', '\u{38c}'),
+        ('\u{38e}', '\u{3a1}'),
+        ('\u{3a3}', '\u{3f5}'),
+        ('\u{3f7}', '\u{481}'),
+        ('\u{48a}', '\u{52f}'),
+        ('\u{531}', '\u{556}'),
+        ('\u{559}', '\u{559}'),
+        ('\u{560}', '\u{588}'),
+        ('\u{5d0}', '\u{5ea}'),
+        ('\u{5ef}', '\u{5f2}'),
+        ('\u{620}', '\u{64a}'),
+        ('\u{66e}', '\u{66f}'),
+        ('\u{671}', '\u{6d3}'),
+        ('\u{6d5}', '\u{6d5}'),
+        ('\u{6e5}', '\u{6e6}'),
+        ('\u{6ee}', '\u{6ef}'),
+        ('\u{6fa}', '\u{6fc}'),
+        ('\u{6ff}', '\u{6ff}'),
+        ('\u{710}', '\u{710}'),
+        ('\u{712}', '\u{72f}'),
+        ('\u{74d}', '\u{7a5}'),
+        ('\u{7b1}', '\u{7b1}'),
+        ('\u{7ca}', '\u{7ea}'),
+        ('\u{7f4}', '\u{7f5}'),
+        ('\u{7fa}', '\u{7fa}'),
+        ('\u{800}', '\u{815}'),
+        ('\u{81a}', '\u{81a}'),
+        ('\u{824}', '\u{824}'),
+        ('\u{828}', '\u{828}'),
+        ('\u{840}', '\u{858}'),
+        ('\u{860}', '\u{86a}'),
+        ('\u{870}', '\u{887}'),
+        ('\u{889}', '\u{88e}'),
+        ('\u{8a0}', '\u{8c9}'),
+        ('\u{904}', '\u{939}'),
+        ('\u{93d}', '\u{93d}'),
+        ('\u{950}', '\u{950}'),
+        ('\u{958}', '\u{961}'),
+        ('\u{971}', '\u{980}'),
+        ('\u{985}', '\u{98c}'),
+        ('\u{98f}', '\u{990}'),
+        ('\u{993}', '\u{9a8}'),
+        ('\u{9aa}', '\u{9b0}'),
+        ('\u{9b2}', '\u{9b2}'),
+        ('\u{9b6}', '\u{9b9}'),
+        ('\u{9bd}', '\u{9bd}'),
+        ('\u{9ce}', '\u{9ce}'),
+        ('\u{9dc}', '\u{9dd}'),
+        ('\u{9df}', '\u{9e1}'),
+        ('\u{9f0}', '\u{9f1}'),
+        ('\u{9fc}', '\u{9fc}'),
+        ('\u{a05}', '\u{a0a}'),
+        ('\u{a0f}', '\u{a10}'),
+        ('\u{a13}', '\u{a28}'),
+        ('\u{a2a}', '\u{a30}'),
+        ('\u{a32}', '\u{a33}'),
+        ('\u{a35}', '\u{a36}'),
+        ('\u{a38}', '\u{a39}'),
+        ('\u{a59}', '\u{a5c}'),
+        ('\u{a5e}', '\u{a5e}'),
+        ('\u{a72}', '\u{a74}'),
+        ('\u{a85}', '\u{a8d}'),
+        ('\u{a8f}', '\u{a91}'),
+        ('\u{a93}', '\u{aa8}'),
+        ('\u{aaa}', '\u{ab0}'),
+        ('\u{ab2}', '\u{ab3}'),
+        ('\u{ab5}', '\u{ab9}'),
+        ('\u{abd}', '\u{abd}'),
+        ('\u{ad0}', '\u{ad0}'),
+        ('\u{ae0}', '\u{ae1}'),
+        ('\u{af9}', '\u{af9}'),
+        ('\u{b05}', '\u{b0c}'),
+        ('\u{b0f}', '\u{b10}'),
+        ('\u{b13}', '\u{b28}'),
+        ('\u{b2a}', '\u{b30}'),
+        ('\u{b32}', '\u{b33}'),
+        ('\u{b35}', '\u{b39}'),
+        ('\u{b3d}', '\u{b3d}'),
+        ('\u{b5c}', '\u{b5d}'),
+        ('\u{b5f}', '\u{b61}'),
+        ('\u{b71}', '\u{b71}'),
+        ('\u{b83}', '\u{b83}'),
+        ('\u{b85}', '\u{b8a}'),
+        ('\u{b8e}', '\u{b90}'),
+        ('\u{b92}', '\u{b95}'),
+        ('\u{b99}', '\u{b9a}'),
+        ('\u{b9c}', '\u{b9c}'),
+        ('\u{b9e}', '\u{b9f}'),
+        ('\u{ba3}', '\u{ba4}'),
+        ('\u{ba8}', '\u{baa}'),
+        ('\u{bae}', '\u{bb9}'),
+        ('\u{bd0}', '\u{bd0}'),
+        ('\u{c05}', '\u{c0c}'),
+        ('\u{c0e}', '\u{c10}'),
+        ('\u{c12}', '\u{c28}'),
+        ('\u{c2a}', '\u{c39}'),
+        ('\u{c3d}', '\u{c3d}'),
+        ('\u{c58}', '\u{c5a}'),
+        ('\u{c5d}', '\u{c5d}'),
+        ('\u{c60}', '\u{c61}'),
+        ('\u{c80}', '\u{c80}'),
+        ('\u{c85}', '\u{c8c}'),
+        ('\u{c8e}', '\u{c90}'),
+        ('\u{c92}', '\u{ca8}'),
+        ('\u{caa}', '\u{cb3}'),
+        ('\u{cb5}', '\u{cb9}'),
+        ('\u{cbd}', '\u{cbd}'),
+        ('\u{cdd}', '\u{cde}'),
+        ('\u{ce0}', '\u{ce1}'),
+        ('\u{cf1}', '\u{cf2}'),
+        ('\u{d04}', '\u{d0c}'),
+        ('\u{d0e}', '\u{d10}'),
+        ('\u{d12}', '\u{d3a}'),
+        ('\u{d3d}', '\u{d3d}'),
+        ('\u{d4e}', '\u{d4e}'),
+        ('\u{d54}', '\u{d56}'),
+        ('\u{d5f}', '\u{d61}'),
+        ('\u{d7a}', '\u{d7f}'),
+        ('\u{d85}', '\u{d96}'),
+        ('\u{d9a}', '\u{db1}'),
+        ('\u{db3}', '\u{dbb}'),
+        ('\u{dbd}', '\u{dbd}'),
+        ('\u{dc0}', '\u{dc6}'),
+        ('\u{e01}', '\u{e30}'),
+        ('\u{e32}', '\u{e32}'),
+        ('\u{e40}', '\u{e46}'),
+        ('\u{e81}', '\u{e82}'),
+        ('\u{e84}', '\u{e84}'),
+        ('\u{e86}', '\u{e8a}'),
+        ('\u{e8c}', '\u{ea3}'),
+        ('\u{ea5}', '\u{ea5}'),
+        ('\u{ea7}', '\u{eb0}'),
+        ('\u{eb2}', '\u{eb2}'),
+        ('\u{ebd}', '\u{ebd}'),
+        ('\u{ec0}', '\u{ec4}'),
+        ('\u{ec6}', '\u{ec6}'),
+        ('\u{edc}', '\u{edf}'),
+        ('\u{f00}', '\u{f00}'),
+        ('\u{f40}', '\u{f47}'),
+        ('\u{f49}', '\u{f6c}'),
+        ('\u{f88}', '\u{f8c}'),
+        ('\u{1000}', '\u{102a}'),
+        ('\u{103f}', '\u{103f}'),
+        ('\u{1050}', '\u{1055}'),
+        ('\u{105a}', '\u{105d}'),
+        ('\u{1061}', '\u{1061}'),
+        ('\u{1065}', '\u{1066}'),
+        ('\u{106e}', '\u{1070}'),
+        ('\u{1075}', '\u{1081}'),
+        ('\u{108e}', '\u{108e}'),
+        ('\u{10a0}', '\u{10c5}'),
+        ('\u{10c7}', '\u{10c7}'),
+        ('\u{10cd}', '\u{10cd}'),
+        ('\u{10d0}', '\u{10fa}'),
+        ('\u{10fc}', '\u{1248}'),
+        ('\u{124a}', '\u{124d}'),
+        ('\u{1250}', '\u{1256}'),
+        ('\u{1258}', '\u{1258}'),
+        ('\u{125a}', '\u{125d}'),
+        ('\u{1260}', '\u{1288}'),
+        ('\u{128a}', '\u{128d}'),
+        ('\u{1290}', '\u{12b0}'),
+        ('\u{12b2}', '\u{12b5}'),
+        ('\u{12b8}', '\u{12be}'),
+        ('\u{12c0}', '\u{12c0}'),
+        ('\u{12c2}', '\u{12c5}'),
+        ('\u{12c8}', '\u{12d6}'),
+        ('\u{12d8}', '\u{1310}'),
+        ('\u{1312}', '\u{1315}'),
+        ('\u{1318}', '\u{135a}'),
+        ('\u{1380}', '\u{138f}'),
+        ('\u{13a0}', '\u{13f5}'),
+        ('\u{13f8}', '\u{13fd}'),
+        ('\u{1401}', '\u{166c}'),
+        ('\u{166f}', '\u{167f}'),
+        ('\u{1681}', '\u{169a}'),
+        ('\u{16a0}', '\u{16ea}'),
+        ('\u{16ee}', '\u{16f8}'),
+        ('\u{1700}', '\u{1711}'),
+        ('\u{171f}', '\u{1731}'),
+        ('\u{1740}', '\u{1751}'),
+        ('\u{1760}', '\u{176c}'),
+        ('\u{176e}', '\u{1770}'),
+        ('\u{1780}', '\u{17b3}'),
+        ('\u{17d7}', '\u{17d7}'),
+        ('\u{17dc}', '\u{17dc}'),
+        ('\u{1820}', '\u{1878}'),
+        ('\u{1880}', '\u{18a8}'),
+        ('\u{18aa}', '\u{18aa}'),
+        ('\u{18b0}', '\u{18f5}'),
+        ('\u{1900}', '\u{191e}'),
+        ('\u{1950}', '\u{196d}'),
+        ('\u{1970}', '\u{1974}'),
+        ('\u{1980}', '\u{19ab}'),
+        ('\u{19b0}', '\u{19c9}'),
+        ('\u{1a00}', '\u{1a16}'),
+        ('\u{1a20}', '\u{1a54}'),
+        ('\u{1aa7}', '\u{1aa7}'),
+        ('\u{1b05}', '\u{1b33}'),
+        ('\u{1b45}', '\u{1b4c}'),
+        ('\u{1b83}', '\u{1ba0}'),
+        ('\u{1bae}', '\u{1baf}'),
+        ('\u{1bba}', '\u{1be5}'),
+        ('\u{1c00}', '\u{1c23}'),
+        ('\u{1c4d}', '\u{1c4f}'),
+        ('\u{1c5a}', '\u{1c7d}'),
+        ('\u{1c80}', '\u{1c88}'),
+        ('\u{1c90}', '\u{1cba}'),
+        ('\u{1cbd}', '\u{1cbf}'),
+        ('\u{1ce9}', '\u{1cec}'),
+        ('\u{1cee}', '\u{1cf3}'),
+        ('\u{1cf5}', '\u{1cf6}'),
+        ('\u{1cfa}', '\u{1cfa}'),
+        ('\u{1d00}', '\u{1dbf}'),
+        ('\u{1e00}', '\u{1f15}'),
+        ('\u{1f18}', '\u{1f1d}'),
+        ('\u{1f20}', '\u{1f45}'),
+        ('\u{1f48}', '\u{1f4d}'),
+        ('\u{1f50}', '\u{1f57}'),
+        ('\u{1f59}', '\u{1f59}'),
+        ('\u{1f5b}', '\u{1f5b}'),
+        ('\u{1f5d}', '\u{1f5d}'),
+        ('\u{1f5f}', '\u{1f7d}'),
+        ('\u{1f80}', '\u{1fb4}'),
+        ('\u{1fb6}', '\u{1fbc}'),
+        ('\u{1fbe}', '\u{1fbe}'),
+        ('\u{1fc2}', '\u{1fc4}'),
+        ('\u{1fc6}', '\u{1fcc}'),
+        ('\u{1fd0}', '\u{1fd3}'),
+        ('\u{1fd6}', '\u{1fdb}'),
+        ('\u{1fe0}', '\u{1fec}'),
+        ('\u{1ff2}', '\u{1ff4}'),
+        ('\u{1ff6}', '\u{1ffc}'),
+        ('\u{2071}', '\u{2071}'),
+        ('\u{207f}', '\u{207f}'),
+        ('\u{2090}', '\u{209c}'),
+        ('\u{2102}', '\u{2102}'),
+        ('\u{2107}', '\u{2107}'),
+        ('\u{210a}', '\u{2113}'),
+        ('\u{2115}', '\u{2115}'),
+        ('\u{2118}', '\u{211d}'),
+        ('\u{2124}', '\u{2124}'),
+        ('\u{2126}', '\u{2126}'),
+        ('\u{2128}', '\u{2128}'),
+        ('\u{212a}', '\u{2139}'),
+        ('\u{213c}', '\u{213f}'),
+        ('\u{2145}', '\u{2149}'),
+        ('\u{214e}', '\u{214e}'),
+        ('\u{2160}', '\u{2188}'),
+        ('\u{2c00}', '\u{2ce4}'),
+        ('\u{2ceb}', '\u{2cee}'),
+        ('\u{2cf2}', '\u{2cf3}'),
+        ('\u{2d00}', '\u{2d25}'),
+        ('\u{2d27}', '\u{2d27}'),
+        ('\u{2d2d}', '\u{2d2d}'),
+        ('\u{2d30}', '\u{2d67}'),
+        ('\u{2d6f}', '\u{2d6f}'),
+        ('\u{2d80}', '\u{2d96}'),
+        ('\u{2da0}', '\u{2da6}'),
+        ('\u{2da8}', '\u{2dae}'),
+        ('\u{2db0}', '\u{2db6}'),
+        ('\u{2db8}', '\u{2dbe}'),
+        ('\u{2dc0}', '\u{2dc6}'),
+        ('\u{2dc8}', '\u{2dce}'),
+        ('\u{2dd0}', '\u{2dd6}'),
+        ('\u{2dd8}', '\u{2dde}'),
+        ('\u{3005}', '\u{3007}'),
+        ('\u{3021}', '\u{3029}'),
+        ('\u{3031}', '\u{3035}'),
+        ('\u{3038}', '\u{303c}'),
+        ('\u{3041}', '\u{3096}'),
+        ('\u{309d}', '\u{309f}'),
+        ('\u{30a1}', '\u{30fa}'),
+        ('\u{30fc}', '\u{30ff}'),
+        ('\u{3105}', '\u{312f}'),
+        ('\u{3131}', '\u{318e}'),
+        ('\u{31a0}', '\u{31bf}'),
+        ('\u{31f0}', '\u{31ff}'),
+        ('\u{3400}', '\u{4dbf}'),
+        ('\u{4e00}', '\u{a48c}'),
+        ('\u{a4d0}', '\u{a4fd}'),
+        ('\u{a500}', '\u{a60c}'),
+        ('\u{a610}', '\u{a61f}'),
+        ('\u{a62a}', '\u{a62b}'),
+        ('\u{a640}', '\u{a66e}'),
+        ('\u{a67f}', '\u{a69d}'),
+        ('\u{a6a0}', '\u{a6ef}'),
+        ('\u{a717}', '\u{a71f}'),
+        ('\u{a722}', '\u{a788}'),
+        ('\u{a78b}', '\u{a7ca}'),
+        ('\u{a7d0}', '\u{a7d1}'),
+        ('\u{a7d3}', '\u{a7d3}'),
+        ('\u{a7d5}', '\u{a7d9}'),
+        ('\u{a7f2}', '\u{a801}'),
+        ('\u{a803}', '\u{a805}'),
+        ('\u{a807}', '\u{a80a}'),
+        ('\u{a80c}', '\u{a822}'),
+        ('\u{a840}', '\u{a873}'),
+        ('\u{a882}', '\u{a8b3}'),
+        ('\u{a8f2}', '\u{a8f7}'),
+        ('\u{a8fb}', '\u{a8fb}'),
+        ('\u{a8fd}', '\u{a8fe}'),
+        ('\u{a90a}', '\u{a925}'),
+        ('\u{a930}', '\u{a946}'),
+        ('\u{a960}', '\u{a97c}'),
+        ('\u{a984}', '\u{a9b2}'),
+        ('\u{a9cf}', '\u{a9cf}'),
+        ('\u{a9e0}', '\u{a9e4}'),
+        ('\u{a9e6}', '\u{a9ef}'),
+        ('\u{a9fa}', '\u{a9fe}'),
+        ('\u{aa00}', '\u{aa28}'),
+        ('\u{aa40}', '\u{aa42}'),
+        ('\u{aa44}', '\u{aa4b}'),
+        ('\u{aa60}', '\u{aa76}'),
+        ('\u{aa7a}', '\u{aa7a}'),
+        ('\u{aa7e}', '\u{aaaf}'),
+        ('\u{aab1}', '\u{aab1}'),
+        ('\u{aab5}', '\u{aab6}'),
+        ('\u{aab9}', '\u{aabd}'),
+        ('\u{aac0}', '\u{aac0}'),
+        ('\u{aac2}', '\u{aac2}'),
+        ('\u{aadb}', '\u{aadd}'),
+        ('\u{aae0}', '\u{aaea}'),
+        ('\u{aaf2}', '\u{aaf4}'),
+        ('\u{ab01}', '\u{ab06}'),
+        ('\u{ab09}', '\u{ab0e}'),
+        ('\u{ab11}', '\u{ab16}'),
+        ('\u{ab20}', '\u{ab26}'),
+        ('\u{ab28}', '\u{ab2e}'),
+        ('\u{ab30}', '\u{ab5a}'),
+        ('\u{ab5c}', '\u{ab69}'),
+        ('\u{ab70}', '\u{abe2}'),
+        ('\u{ac00}', '\u{d7a3}'),
+        ('\u{d7b0}', '\u{d7c6}'),
+        ('\u{d7cb}', '\u{d7fb}'),
+        ('\u{f900}', '\u{fa6d}'),
+        ('\u{fa70}', '\u{fad9}'),
+        ('\u{fb00}', '\u{fb06}'),
+        ('\u{fb13}', '\u{fb17}'),
+        ('\u{fb1d}', '\u{fb1d}'),
+        ('\u{fb1f}', '\u{fb28}'),
+        ('\u{fb2a}', '\u{fb36}'),
+        ('\u{fb38}', '\u{fb3c}'),
+        ('\u{fb3e}', '\u{fb3e}'),
+        ('\u{fb40}', '\u{fb41}'),
+        ('\u{fb43}', '\u{fb44}'),
+        ('\u{fb46}', '\u{fbb1}'),
+        ('\u{fbd3}', '\u{fc5d}'),
+        ('\u{fc64}', '\u{fd3d}'),
+        ('\u{fd50}', '\u{fd8f}'),
+        ('\u{fd92}', '\u{fdc7}'),
+        ('\u{fdf0}', '\u{fdf9}'),
+        ('\u{fe71}', '\u{fe71}'),
+        ('\u{fe73}', '\u{fe73}'),
+        ('\u{fe77}', '\u{fe77}'),
+        ('\u{fe79}', '\u{fe79}'),
+        ('\u{fe7b}', '\u{fe7b}'),
+        ('\u{fe7d}', '\u{fe7d}'),
+        ('\u{fe7f}', '\u{fefc}'),
+        ('\u{ff21}', '\u{ff3a}'),
+        ('\u{ff41}', '\u{ff5a}'),
+        ('\u{ff66}', '\u{ff9d}'),
+        ('\u{ffa0}', '\u{ffbe}'),
+        ('\u{ffc2}', '\u{ffc7}'),
+        ('\u{ffca}', '\u{ffcf}'),
+        ('\u{ffd2}', '\u{ffd7}'),
+        ('\u{ffda}', '\u{ffdc}'),
+        ('\u{10000}', '\u{1000b}'),
+        ('\u{1000d}', '\u{10026}'),
+        ('\u{10028}', '\u{1003a}'),
+        ('\u{1003c}', '\u{1003d}'),
+        ('\u{1003f}', '\u{1004d}'),
+        ('\u{10050}', '\u{1005d}'),
+        ('\u{10080}', '\u{100fa}'),
+        ('\u{10140}', '\u{10174}'),
+        ('\u{10280}', '\u{1029c}'),
+        ('\u{102a0}', '\u{102d0}'),
+        ('\u{10300}', '\u{1031f}'),
+        ('\u{1032d}', '\u{1034a}'),
+        ('\u{10350}', '\u{10375}'),
+        ('\u{10380}', '\u{1039d}'),
+        ('\u{103a0}', '\u{103c3}'),
+        ('\u{103c8}', '\u{103cf}'),
+        ('\u{103d1}', '\u{103d5}'),
+        ('\u{10400}', '\u{1049d}'),
+        ('\u{104b0}', '\u{104d3}'),
+        ('\u{104d8}', '\u{104fb}'),
+        ('\u{10500}', '\u{10527}'),
+        ('\u{10530}', '\u{10563}'),
+        ('\u{10570}', '\u{1057a}'),
+        ('\u{1057c}', '\u{1058a}'),
+        ('\u{1058c}', '\u{10592}'),
+        ('\u{10594}', '\u{10595}'),
+        ('\u{10597}', '\u{105a1}'),
+        ('\u{105a3}', '\u{105b1}'),
+        ('\u{105b3}', '\u{105b9}'),
+        ('\u{105bb}', '\u{105bc}'),
+        ('\u{10600}', '\u{10736}'),
+        ('\u{10740}', '\u{10755}'),
+        ('\u{10760}', '\u{10767}'),
+        ('\u{10780}', '\u{10785}'),
+        ('\u{10787}', '\u{107b0}'),
+        ('\u{107b2}', '\u{107ba}'),
+        ('\u{10800}', '\u{10805}'),
+        ('\u{10808}', '\u{10808}'),
+        ('\u{1080a}', '\u{10835}'),
+        ('\u{10837}', '\u{10838}'),
+        ('\u{1083c}', '\u{1083c}'),
+        ('\u{1083f}', '\u{10855}'),
+        ('\u{10860}', '\u{10876}'),
+        ('\u{10880}', '\u{1089e}'),
+        ('\u{108e0}', '\u{108f2}'),
+        ('\u{108f4}', '\u{108f5}'),
+        ('\u{10900}', '\u{10915}'),
+        ('\u{10920}', '\u{10939}'),
+        ('\u{10980}', '\u{109b7}'),
+        ('\u{109be}', '\u{109bf}'),
+        ('\u{10a00}', '\u{10a00}'),
+        ('\u{10a10}', '\u{10a13}'),
+        ('\u{10a15}', '\u{10a17}'),
+        ('\u{10a19}', '\u{10a35}'),
+        ('\u{10a60}', '\u{10a7c}'),
+        ('\u{10a80}', '\u{10a9c}'),
+        ('\u{10ac0}', '\u{10ac7}'),
+        ('\u{10ac9}', '\u{10ae4}'),
+        ('\u{10b00}', '\u{10b35}'),
+        ('\u{10b40}', '\u{10b55}'),
+        ('\u{10b60}', '\u{10b72}'),
+        ('\u{10b80}', '\u{10b91}'),
+        ('\u{10c00}', '\u{10c48}'),
+        ('\u{10c80}', '\u{10cb2}'),
+        ('\u{10cc0}', '\u{10cf2}'),
+        ('\u{10d00}', '\u{10d23}'),
+        ('\u{10e80}', '\u{10ea9}'),
+        ('\u{10eb0}', '\u{10eb1}'),
+        ('\u{10f00}', '\u{10f1c}'),
+        ('\u{10f27}', '\u{10f27}'),
+        ('\u{10f30}', '\u{10f45}'),
+        ('\u{10f70}', '\u{10f81}'),
+        ('\u{10fb0}', '\u{10fc4}'),
+        ('\u{10fe0}', '\u{10ff6}'),
+        ('\u{11003}', '\u{11037}'),
+        ('\u{11071}', '\u{11072}'),
+        ('\u{11075}', '\u{11075}'),
+        ('\u{11083}', '\u{110af}'),
+        ('\u{110d0}', '\u{110e8}'),
+        ('\u{11103}', '\u{11126}'),
+        ('\u{11144}', '\u{11144}'),
+        ('\u{11147}', '\u{11147}'),
+        ('\u{11150}', '\u{11172}'),
+        ('\u{11176}', '\u{11176}'),
+        ('\u{11183}', '\u{111b2}'),
+        ('\u{111c1}', '\u{111c4}'),
+        ('\u{111da}', '\u{111da}'),
+        ('\u{111dc}', '\u{111dc}'),
+        ('\u{11200}', '\u{11211}'),
+        ('\u{11213}', '\u{1122b}'),
+        ('\u{1123f}', '\u{11240}'),
+        ('\u{11280}', '\u{11286}'),
+        ('\u{11288}', '\u{11288}'),
+        ('\u{1128a}', '\u{1128d}'),
+        ('\u{1128f}', '\u{1129d}'),
+        ('\u{1129f}', '\u{112a8}'),
+        ('\u{112b0}', '\u{112de}'),
+        ('\u{11305}', '\u{1130c}'),
+        ('\u{1130f}', '\u{11310}'),
+        ('\u{11313}', '\u{11328}'),
+        ('\u{1132a}', '\u{11330}'),
+        ('\u{11332}', '\u{11333}'),
+        ('\u{11335}', '\u{11339}'),
+        ('\u{1133d}', '\u{1133d}'),
+        ('\u{11350}', '\u{11350}'),
+        ('\u{1135d}', '\u{11361}'),
+        ('\u{11400}', '\u{11434}'),
+        ('\u{11447}', '\u{1144a}'),
+        ('\u{1145f}', '\u{11461}'),
+        ('\u{11480}', '\u{114af}'),
+        ('\u{114c4}', '\u{114c5}'),
+        ('\u{114c7}', '\u{114c7}'),
+        ('\u{11580}', '\u{115ae}'),
+        ('\u{115d8}', '\u{115db}'),
+        ('\u{11600}', '\u{1162f}'),
+        ('\u{11644}', '\u{11644}'),
+        ('\u{11680}', '\u{116aa}'),
+        ('\u{116b8}', '\u{116b8}'),
+        ('\u{11700}', '\u{1171a}'),
+        ('\u{11740}', '\u{11746}'),
+        ('\u{11800}', '\u{1182b}'),
+        ('\u{118a0}', '\u{118df}'),
+        ('\u{118ff}', '\u{11906}'),
+        ('\u{11909}', '\u{11909}'),
+        ('\u{1190c}', '\u{11913}'),
+        ('\u{11915}', '\u{11916}'),
+        ('\u{11918}', '\u{1192f}'),
+        ('\u{1193f}', '\u{1193f}'),
+        ('\u{11941}', '\u{11941}'),
+        ('\u{119a0}', '\u{119a7}'),
+        ('\u{119aa}', '\u{119d0}'),
+        ('\u{119e1}', '\u{119e1}'),
+        ('\u{119e3}', '\u{119e3}'),
+        ('\u{11a00}', '\u{11a00}'),
+        ('\u{11a0b}', '\u{11a32}'),
+        ('\u{11a3a}', '\u{11a3a}'),
+        ('\u{11a50}', '\u{11a50}'),
+        ('\u{11a5c}', '\u{11a89}'),
+        ('\u{11a9d}', '\u{11a9d}'),
+        ('\u{11ab0}', '\u{11af8}'),
+        ('\u{11c00}', '\u{11c08}'),
+        ('\u{11c0a}', '\u{11c2e}'),
+        ('\u{11c40}', '\u{11c40}'),
+        ('\u{11c72}', '\u{11c8f}'),
+        ('\u{11d00}', '\u{11d06}'),
+        ('\u{11d08}', '\u{11d09}'),
+        ('\u{11d0b}', '\u{11d30}'),
+        ('\u{11d46}', '\u{11d46}'),
+        ('\u{11d60}', '\u{11d65}'),
+        ('\u{11d67}', '\u{11d68}'),
+        ('\u{11d6a}', '\u{11d89}'),
+        ('\u{11d98}', '\u{11d98}'),
+        ('\u{11ee0}', '\u{11ef2}'),
+        ('\u{11f02}', '\u{11f02}'),
+        ('\u{11f04}', '\u{11f10}'),
+        ('\u{11f12}', '\u{11f33}'),
+        ('\u{11fb0}', '\u{11fb0}'),
+        ('\u{12000}', '\u{12399}'),
+        ('\u{12400}', '\u{1246e}'),
+        ('\u{12480}', '\u{12543}'),
+        ('\u{12f90}', '\u{12ff0}'),
+        ('\u{13000}', '\u{1342f}'),
+        ('\u{13441}', '\u{13446}'),
+        ('\u{14400}', '\u{14646}'),
+        ('\u{16800}', '\u{16a38}'),
+        ('\u{16a40}', '\u{16a5e}'),
+        ('\u{16a70}', '\u{16abe}'),
+        ('\u{16ad0}', '\u{16aed}'),
+        ('\u{16b00}', '\u{16b2f}'),
+        ('\u{16b40}', '\u{16b43}'),
+        ('\u{16b63}', '\u{16b77}'),
+        ('\u{16b7d}', '\u{16b8f}'),
+        ('\u{16e40}', '\u{16e7f}'),
+        ('\u{16f00}', '\u{16f4a}'),
+        ('\u{16f50}', '\u{16f50}'),
+        ('\u{16f93}', '\u{16f9f}'),
+        ('\u{16fe0}', '\u{16fe1}'),
+        ('\u{16fe3}', '\u{16fe3}'),
+        ('\u{17000}', '\u{187f7}'),
+        ('\u{18800}', '\u{18cd5}'),
+        ('\u{18d00}', '\u{18d08}'),
+        ('\u{1aff0}', '\u{1aff3}'),
+        ('\u{1aff5}', '\u{1affb}'),
+        ('\u{1affd}', '\u{1affe}'),
+        ('\u{1b000}', '\u{1b122}'),
+        ('\u{1b132}', '\u{1b132}'),
+        ('\u{1b150}', '\u{1b152}'),
+        ('\u{1b155}', '\u{1b155}'),
+        ('\u{1b164}', '\u{1b167}'),
+        ('\u{1b170}', '\u{1b2fb}'),
+        ('\u{1bc00}', '\u{1bc6a}'),
+        ('\u{1bc70}', '\u{1bc7c}'),
+        ('\u{1bc80}', '\u{1bc88}'),
+        ('\u{1bc90}', '\u{1bc99}'),
+        ('\u{1d400}', '\u{1d454}'),
+        ('\u{1d456}', '\u{1d49c}'),
+        ('\u{1d49e}', '\u{1d49f}'),
+        ('\u{1d4a2}', '\u{1d4a2}'),
+        ('\u{1d4a5}', '\u{1d4a6}'),
+        ('\u{1d4a9}', '\u{1d4ac}'),
+        ('\u{1d4ae}', '\u{1d4b9}'),
+        ('\u{1d4bb}', '\u{1d4bb}'),
+        ('\u{1d4bd}', '\u{1d4c3}'),
+        ('\u{1d4c5}', '\u{1d505}'),
+        ('\u{1d507}', '\u{1d50a}'),
+        ('\u{1d50d}', '\u{1d514}'),
+        ('\u{1d516}', '\u{1d51c}'),
+        ('\u{1d51e}', '\u{1d539}'),
+        ('\u{1d53b}', '\u{1d53e}'),
+        ('\u{1d540}', '\u{1d544}'),
+        ('\u{1d546}', '\u{1d546}'),
+        ('\u{1d54a}', '\u{1d550}'),
+        ('\u{1d552}', '\u{1d6a5}'),
+        ('\u{1d6a8}', '\u{1d6c0}'),
+        ('\u{1d6c2}', '\u{1d6da}'),
+        ('\u{1d6dc}', '\u{1d6fa}'),
+        ('\u{1d6fc}', '\u{1d714}'),
+        ('\u{1d716}', '\u{1d734}'),
+        ('\u{1d736}', '\u{1d74e}'),
+        ('\u{1d750}', '\u{1d76e}'),
+        ('\u{1d770}', '\u{1d788}'),
+        ('\u{1d78a}', '\u{1d7a8}'),
+        ('\u{1d7aa}', '\u{1d7c2}'),
+        ('\u{1d7c4}', '\u{1d7cb}'),
+        ('\u{1df00}', '\u{1df1e}'),
+        ('\u{1df25}', '\u{1df2a}'),
+        ('\u{1e030}', '\u{1e06d}'),
+        ('\u{1e100}', '\u{1e12c}'),
+        ('\u{1e137}', '\u{1e13d}'),
+        ('\u{1e14e}', '\u{1e14e}'),
+        ('\u{1e290}', '\u{1e2ad}'),
+        ('\u{1e2c0}', '\u{1e2eb}'),
+        ('\u{1e4d0}', '\u{1e4eb}'),
+        ('\u{1e7e0}', '\u{1e7e6}'),
+        ('\u{1e7e8}', '\u{1e7eb}'),
+        ('\u{1e7ed}', '\u{1e7ee}'),
+        ('\u{1e7f0}', '\u{1e7fe}'),
+        ('\u{1e800}', '\u{1e8c4}'),
+        ('\u{1e900}', '\u{1e943}'),
+        ('\u{1e94b}', '\u{1e94b}'),
+        ('\u{1ee00}', '\u{1ee03}'),
+        ('\u{1ee05}', '\u{1ee1f}'),
+        ('\u{1ee21}', '\u{1ee22}'),
+        ('\u{1ee24}', '\u{1ee24}'),
+        ('\u{1ee27}', '\u{1ee27}'),
+        ('\u{1ee29}', '\u{1ee32}'),
+        ('\u{1ee34}', '\u{1ee37}'),
+        ('\u{1ee39}', '\u{1ee39}'),
+        ('\u{1ee3b}', '\u{1ee3b}'),
+        ('\u{1ee42}', '\u{1ee42}'),
+        ('\u{1ee47}', '\u{1ee47}'),
+        ('\u{1ee49}', '\u{1ee49}'),
+        ('\u{1ee4b}', '\u{1ee4b}'),
+        ('\u{1ee4d}', '\u{1ee4f}'),
+        ('\u{1ee51}', '\u{1ee52}'),
+        ('\u{1ee54}', '\u{1ee54}'),
+        ('\u{1ee57}', '\u{1ee57}'),
+        ('\u{1ee59}', '\u{1ee59}'),
+        ('\u{1ee5b}', '\u{1ee5b}'),
+        ('\u{1ee5d}', '\u{1ee5d}'),
+        ('\u{1ee5f}', '\u{1ee5f}'),
+        ('\u{1ee61}', '\u{1ee62}'),
+        ('\u{1ee64}', '\u{1ee64}'),
+        ('\u{1ee67}', '\u{1ee6a}'),
+        ('\u{1ee6c}', '\u{1ee72}'),
+        ('\u{1ee74}', '\u{1ee77}'),
+        ('\u{1ee79}', '\u{1ee7c}'),
+        ('\u{1ee7e}', '\u{1ee7e}'),
+        ('\u{1ee80}', '\u{1ee89}'),
+        ('\u{1ee8b}', '\u{1ee9b}'),
+        ('\u{1eea1}', '\u{1eea3}'),
+        ('\u{1eea5}', '\u{1eea9}'),
+        ('\u{1eeab}', '\u{1eebb}'),
+        ('\u{20000}', '\u{2a6df}'),
+        ('\u{2a700}', '\u{2b739}'),
+        ('\u{2b740}', '\u{2b81d}'),
+        ('\u{2b820}', '\u{2cea1}'),
+        ('\u{2ceb0}', '\u{2ebe0}'),
+        ('\u{2f800}', '\u{2fa1d}'),
+        ('\u{30000}', '\u{3134a}'),
+        ('\u{31350}', '\u{323af}'),
+    ];
+
+    pub fn XID_Start(c: char) -> bool {
+        super::bsearch_range_table(c, XID_Start_table)
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/src/tests.rs b/libgrust/libformat_parser/vendor/unicode-xid/src/tests.rs
new file mode 100644
index 00000000000..97539eaa953
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/src/tests.rs
@@ -0,0 +1,95 @@
+// Copyright 2012-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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[cfg(feature = "bench")]
+use std::iter;
+#[cfg(feature = "bench")]
+use std::prelude::v1::*;
+#[cfg(feature = "bench")]
+use test::Bencher;
+
+#[cfg(feature = "bench")]
+use UnicodeXID;
+
+#[cfg(feature = "bench")]
+#[bench]
+fn cargo_is_xid_start(b: &mut Bencher) {
+    let string = iter::repeat('a').take(4096).collect::<String>();
+
+    b.bytes = string.len() as u64;
+    b.iter(|| string.chars().all(super::UnicodeXID::is_xid_start));
+}
+
+#[cfg(feature = "bench")]
+#[bench]
+fn stdlib_is_xid_start(b: &mut Bencher) {
+    let string = iter::repeat('a').take(4096).collect::<String>();
+
+    b.bytes = string.len() as u64;
+    b.iter(|| string.chars().all(char::is_xid_start));
+}
+
+#[cfg(feature = "bench")]
+#[bench]
+fn cargo_xid_continue(b: &mut Bencher) {
+    let string = iter::repeat('a').take(4096).collect::<String>();
+
+    b.bytes = string.len() as u64;
+    b.iter(|| string.chars().all(super::UnicodeXID::is_xid_continue));
+}
+
+#[cfg(feature = "bench")]
+#[bench]
+fn stdlib_xid_continue(b: &mut Bencher) {
+    let string = iter::repeat('a').take(4096).collect::<String>();
+
+    b.bytes = string.len() as u64;
+    b.iter(|| string.chars().all(char::is_xid_continue));
+}
+
+#[test]
+fn test_is_xid_start() {
+    let chars = ['A', 'Z', 'a', 'z', '\u{1000d}', '\u{10026}'];
+
+    for ch in &chars {
+        assert!(super::UnicodeXID::is_xid_start(*ch), "{}", ch);
+    }
+}
+
+#[test]
+fn test_is_not_xid_start() {
+    let chars = [
+        '\x00', '\x01', '0', '9', ' ', '[', '<', '{', '(', '\u{02c2}', '\u{ffff}',
+    ];
+
+    for ch in &chars {
+        assert!(!super::UnicodeXID::is_xid_start(*ch), "{}", ch);
+    }
+}
+
+#[test]
+fn test_is_xid_continue() {
+    let chars = ['0', '9', 'A', 'Z', 'a', 'z', '_', '\u{1000d}', '\u{10026}'];
+
+    for ch in &chars {
+        assert!(super::UnicodeXID::is_xid_continue(*ch), "{}", ch);
+    }
+}
+
+#[test]
+fn test_is_not_xid_continue() {
+    let chars = [
+        '\x00', '\x01', ' ', '[', '<', '{', '(', '\u{02c2}', '\u{ffff}',
+    ];
+
+    for &ch in &chars {
+        assert!(!super::UnicodeXID::is_xid_continue(ch), "{}", ch);
+    }
+}
diff --git a/libgrust/libformat_parser/vendor/unicode-xid/tests/exhaustive_tests.rs b/libgrust/libformat_parser/vendor/unicode-xid/tests/exhaustive_tests.rs
new file mode 100644
index 00000000000..9baac20327c
--- /dev/null
+++ b/libgrust/libformat_parser/vendor/unicode-xid/tests/exhaustive_tests.rs
@@ -0,0 +1,25 @@
+extern crate unicode_xid;
+use unicode_xid::UnicodeXID;
+/// A `char` in Rust is a Unicode Scalar Value
+///
+/// See: http://www.unicode.org/glossary/#unicode_scalar_value
+fn all_valid_chars() -> impl Iterator<Item = char> {
+    (0u32..=0xD7FF).chain(0xE000u32..=0x10FFFF).map(|u| {
+        core::convert::TryFrom::try_from(u)
+            .expect("The selected range should be infallible if the docs match impl")
+    })
+}
+
+#[test]
+fn all_valid_chars_do_not_panic_for_is_xid_start() {
+    for c in all_valid_chars() {
+        let _ = UnicodeXID::is_xid_start(c);
+    }
+}
+
+#[test]
+fn all_valid_chars_do_not_panic_for_is_xid_continue() {
+    for c in all_valid_chars() {
+        let _ = UnicodeXID::is_xid_continue(c);
+    }
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 008/125] Rust: Don't cache 'libformat_parser.a'
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (5 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 007/125] gccrs: libgrust: Vendor Rust dependencies Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 009/125] Rust: Move 'libformat_parser' build into the GCC build directory Arthur Cohen
                   ` (116 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <tschwinge@baylibre.com>

	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to the actual build artifact.
	($(LIBFORMAT_PARSER)): Don't cache it.
---
 gcc/rust/Make-lang.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index bcf424e6c18..497a3c76166 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -212,7 +212,7 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
 rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
 
 LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
-LIBFORMAT_PARSER = rust/libformat_parser.a
+LIBFORMAT_PARSER = $(srcdir)/../libgrust/libformat_parser/target/debug/liblibformat_parser.a
 
 RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
 
@@ -417,7 +417,6 @@ rust/%.o: rust/lex/%.cc
 # TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
 $(LIBFORMAT_PARSER): $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
 	cd $(srcdir)/../libgrust/libformat_parser && cargo build --offline  # FIXME: Not always release, right?
-	cp $(srcdir)/../libgrust/libformat_parser/target/debug/liblibformat_parser.a $@
 
 # build all rust/parse files in rust folder, add cross-folder includes
 rust/%.o: rust/parse/%.cc
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 009/125] Rust: Move 'libformat_parser' build into the GCC build directory
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (6 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 008/125] Rust: Don't cache 'libformat_parser.a' Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 010/125] Rust: Move 'libformat_parser' build into libgrust Arthur Cohen
                   ` (115 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <tschwinge@baylibre.com>

Fixes #2883.

gcc/rust/ChangeLog:
	* Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
	directory.
	* ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
---
 gcc/rust/Make-lang.in | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 497a3c76166..b3301f5ce6f 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -212,7 +212,8 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
 rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
 
 LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
-LIBFORMAT_PARSER = $(srcdir)/../libgrust/libformat_parser/target/debug/liblibformat_parser.a
+LIBFORMAT_PARSER_D = rust/libformat_parser
+LIBFORMAT_PARSER = $(LIBFORMAT_PARSER_D)/debug/liblibformat_parser.a
 
 RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
 
@@ -416,7 +417,13 @@ rust/%.o: rust/lex/%.cc
 
 # TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
 $(LIBFORMAT_PARSER): $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
-	cd $(srcdir)/../libgrust/libformat_parser && cargo build --offline  # FIXME: Not always release, right?
+	cargo \
+	  --config $(srcdir)/../libgrust/libformat_parser/.cargo/config \
+	  build \
+	    --offline \
+	    --target-dir $(LIBFORMAT_PARSER_D) \
+	    --manifest-path $(srcdir)/../libgrust/libformat_parser/Cargo.toml \
+	    # FIXME: Not always '--release', right?
 
 # build all rust/parse files in rust folder, add cross-folder includes
 rust/%.o: rust/parse/%.cc
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 010/125] Rust: Move 'libformat_parser' build into libgrust
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (7 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 009/125] Rust: Move 'libformat_parser' build into the GCC build directory Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 011/125] gccrs: libformat_parser: Add FFI safe interface Arthur Cohen
                   ` (114 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <tschwinge@baylibre.com>

Addresses #2883.

	contrib/
	* gcc_update (files_and_dependencies): Update for
	'libformat_parser' in libgrust.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
	build in libgrust.
	(%.toml:, $(LIBFORMAT_PARSER):): Remove.
	libgrust/
	* libformat_parser/Makefile.am: New.
	* Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'.
	* configure.ac: Handle it.
	(TARGET_LIBRARY): New 'AM_CONDITIONAL'.
	* libformat_parser/Makefile.in: Generate.
	* Makefile.in: Regenerate.
	* configure: Likewise.
---
 contrib/gcc_update                    |   1 +
 gcc/rust/Make-lang.in                 |  16 +-
 libgrust/Makefile.am                  |   6 +-
 libgrust/Makefile.in                  |   5 +-
 libgrust/configure                    |  22 +-
 libgrust/configure.ac                 |   3 +
 libgrust/libformat_parser/Makefile.am |  13 +
 libgrust/libformat_parser/Makefile.in | 441 ++++++++++++++++++++++++++
 8 files changed, 487 insertions(+), 20 deletions(-)
 create mode 100644 libgrust/libformat_parser/Makefile.am
 create mode 100644 libgrust/libformat_parser/Makefile.in

diff --git a/contrib/gcc_update b/contrib/gcc_update
index fac86d0e33e..417e0483b3f 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -158,6 +158,7 @@ libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4
 libgrust/Makefile.in: libgrust/Makefile.am libgrust/aclocal.m4
 libgrust/aclocal.m4: libgrust/configure.ac
 libgrust/configure: libgrust/configure.ac libgrust/aclocal.m4
+libgrust/libformat_parser/Makefile.in: libgrust/libformat_parser/Makefile.am libgrust/aclocal.m4
 libgrust/libproc_macro_internal/Makefile.in: libgrust/libproc_macro_internal/Makefile.am libgrust/aclocal.m4
 libitm/aclocal.m4: libitm/configure.ac libitm/acinclude.m4
 libitm/Makefile.in: libitm/Makefile.am libitm/aclocal.m4
diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index b3301f5ce6f..baf55161d78 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -212,8 +212,7 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
 rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
 
 LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
-LIBFORMAT_PARSER_D = rust/libformat_parser
-LIBFORMAT_PARSER = $(LIBFORMAT_PARSER_D)/debug/liblibformat_parser.a
+LIBFORMAT_PARSER = ../libgrust/libformat_parser/debug/liblibformat_parser.a
 
 RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
 
@@ -412,19 +411,6 @@ rust/%.o: rust/lex/%.cc
 	$(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $<
 	$(POSTCOMPILE)
 
-%.toml: 
-	echo $@
-
-# TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
-$(LIBFORMAT_PARSER): $(srcdir)/../libgrust/libformat_parser/Cargo.toml $(wildcard $(srcdir)/../libgrust/libformat_parser/src/*.rs)
-	cargo \
-	  --config $(srcdir)/../libgrust/libformat_parser/.cargo/config \
-	  build \
-	    --offline \
-	    --target-dir $(LIBFORMAT_PARSER_D) \
-	    --manifest-path $(srcdir)/../libgrust/libformat_parser/Cargo.toml \
-	    # FIXME: Not always '--release', right?
-
 # build all rust/parse files in rust folder, add cross-folder includes
 rust/%.o: rust/parse/%.cc
 	$(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $<
diff --git a/libgrust/Makefile.am b/libgrust/Makefile.am
index 5b38c8842cb..7a4512cae96 100644
--- a/libgrust/Makefile.am
+++ b/libgrust/Makefile.am
@@ -11,7 +11,11 @@ TOP_GCCDIR := $(shell cd $(top_srcdir) && cd .. && pwd)
 GCC_DIR = $(TOP_GCCDIR)/gcc
 RUST_SRC = $(GCC_DIR)/rust
 
-SUBDIRS = libproc_macro_internal
+SUBDIRS =
+if !TARGET_LIBRARY
+SUBDIRS += libformat_parser
+endif
+SUBDIRS += libproc_macro_internal
 
 RUST_BUILDDIR := $(shell pwd)
 
diff --git a/libgrust/Makefile.in b/libgrust/Makefile.in
index d065584d196..6665f8da738 100644
--- a/libgrust/Makefile.in
+++ b/libgrust/Makefile.in
@@ -88,6 +88,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+@TARGET_LIBRARY_FALSE@am__append_1 = libformat_parser
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
@@ -165,7 +166,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = libformat_parser libproc_macro_internal
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -308,7 +309,7 @@ AM_CFLAGS = -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include
 TOP_GCCDIR := $(shell cd $(top_srcdir) && cd .. && pwd)
 GCC_DIR = $(TOP_GCCDIR)/gcc
 RUST_SRC = $(GCC_DIR)/rust
-SUBDIRS = libproc_macro_internal
+SUBDIRS = $(am__append_1) libproc_macro_internal
 RUST_BUILDDIR := $(shell pwd)
 
 # Work around what appears to be a GNU make bug handling MAKEFLAGS
diff --git a/libgrust/configure b/libgrust/configure
index dcdc3142fa2..14a391643c6 100755
--- a/libgrust/configure
+++ b/libgrust/configure
@@ -634,6 +634,8 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 get_gcc_base_ver
+TARGET_LIBRARY_FALSE
+TARGET_LIBRARY_TRUE
 toolexeclibdir
 toolexecdir
 target_subdir
@@ -12655,7 +12657,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12658 "configure"
+#line 12660 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12761,7 +12763,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12764 "configure"
+#line 12766 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16192,6 +16194,17 @@ esac
 
 
 
+ if test -n "$with_target_subdir"; then
+  TARGET_LIBRARY_TRUE=
+  TARGET_LIBRARY_FALSE='#'
+else
+  TARGET_LIBRARY_TRUE='#'
+  TARGET_LIBRARY_FALSE=
+fi
+
+
+ac_config_files="$ac_config_files libformat_parser/Makefile"
+
 
 ac_config_files="$ac_config_files libproc_macro_internal/Makefile"
 
@@ -16398,6 +16411,10 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${TARGET_LIBRARY_TRUE}" && test -z "${TARGET_LIBRARY_FALSE}"; then
+  as_fn_error $? "conditional \"TARGET_LIBRARY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
@@ -17348,6 +17365,7 @@ do
     "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "libformat_parser/Makefile") CONFIG_FILES="$CONFIG_FILES libformat_parser/Makefile" ;;
     "libproc_macro_internal/Makefile") CONFIG_FILES="$CONFIG_FILES libproc_macro_internal/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
diff --git a/libgrust/configure.ac b/libgrust/configure.ac
index d55e698fdd8..f9e59a5fc24 100644
--- a/libgrust/configure.ac
+++ b/libgrust/configure.ac
@@ -103,6 +103,9 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
+
+AC_CONFIG_FILES([libformat_parser/Makefile])
 
 AC_CONFIG_FILES(AC_FOREACH([DIR], [libproc_macro_internal], [DIR/Makefile ]),
  [ cat > vpsed$$ << \_EOF
diff --git a/libgrust/libformat_parser/Makefile.am b/libgrust/libformat_parser/Makefile.am
new file mode 100644
index 00000000000..e0e1f45703f
--- /dev/null
+++ b/libgrust/libformat_parser/Makefile.am
@@ -0,0 +1,13 @@
+LIBFORMAT_PARSER = debug/liblibformat_parser.a
+
+all-local: $(LIBFORMAT_PARSER)
+
+# TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
+$(LIBFORMAT_PARSER): $(srcdir)/Cargo.toml $(srcdir)/src/*.rs
+	cargo \
+	  --config $(srcdir)/.cargo/config \
+	  build \
+	    --offline \
+	    --target-dir . \
+	    --manifest-path $(srcdir)/Cargo.toml \
+	    # FIXME: Not always '--release', right?
diff --git a/libgrust/libformat_parser/Makefile.in b/libgrust/libformat_parser/Makefile.in
new file mode 100644
index 00000000000..526b53dc053
--- /dev/null
+++ b/libgrust/libformat_parser/Makefile.in
@@ -0,0 +1,441 @@
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = libformat_parser
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+	$(top_srcdir)/../config/cet.m4 \
+	$(top_srcdir)/../config/depstand.m4 \
+	$(top_srcdir)/../config/enable.m4 \
+	$(top_srcdir)/../config/lead-dot.m4 \
+	$(top_srcdir)/../config/multi.m4 \
+	$(top_srcdir)/../config/no-executables.m4 \
+	$(top_srcdir)/../config/override.m4 \
+	$(top_srcdir)/../config/toolexeclibdir.m4 \
+	$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
+	$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
+	$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_libsubdir = @build_libsubdir@
+build_os = @build_os@
+build_subdir = @build_subdir@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+get_gcc_base_ver = @get_gcc_base_ver@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_noncanonical = @host_noncanonical@
+host_os = @host_os@
+host_subdir = @host_subdir@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_noncanonical = @target_noncanonical@
+target_os = @target_os@
+target_subdir = @target_subdir@
+target_vendor = @target_vendor@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+LIBFORMAT_PARSER = debug/liblibformat_parser.a
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libformat_parser/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign libformat_parser/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+check-am: all-am
+check: check-am
+all-am: Makefile all-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+	clean-libtool cscopelist-am ctags-am distclean \
+	distclean-generic distclean-libtool dvi dvi-am html html-am \
+	info info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+all-local: $(LIBFORMAT_PARSER)
+
+# TODO: Improve `cargo` invocation with host specific flags, possibly creating a $(CARGO) variable?
+$(LIBFORMAT_PARSER): $(srcdir)/Cargo.toml $(srcdir)/src/*.rs
+	cargo \
+	  --config $(srcdir)/.cargo/config \
+	  build \
+	    --offline \
+	    --target-dir . \
+	    --manifest-path $(srcdir)/Cargo.toml \
+	    # FIXME: Not always '--release', right?
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 011/125] gccrs: libformat_parser: Add FFI safe interface
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (8 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 010/125] Rust: Move 'libformat_parser' build into libgrust Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 012/125] gccrs: libformat_parser: Start experimenting with cbindgen Arthur Cohen
                   ` (113 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

libgrust/ChangeLog:

	* libformat_parser/generic_format_parser/src/lib.rs: Add generic
	library.
	* libformat_parser/src/lib.rs: Add base for FFI interface.
---
 .../generic_format_parser/src/lib.rs          |   2 +-
 libgrust/libformat_parser/src/lib.rs          | 301 +++++++++++++++++-
 2 files changed, 298 insertions(+), 5 deletions(-)

diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
index f42c9d8dffb..87a20dc18c5 100644
--- a/libgrust/libformat_parser/generic_format_parser/src/lib.rs
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -1099,4 +1099,4 @@ fn unescape_string(string: &str) -> Option<string::String> {
 // rustc_index::static_assert_size!(Piece<'_>, 16);
 
 // #[cfg(test)]
-// mod tests;
\ No newline at end of file
+// mod tests;
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index e6dc16eeb49..49821e7cd2f 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -5,8 +5,298 @@
 
 use std::ffi::CStr;
 
-// TODO: Use rustc's version here #3
-use generic_format_parser::Piece;
+mod ffi {
+    use std::ops::Deref;
+
+    // Note: copied from rustc_span
+    /// Range inside of a `Span` used for diagnostics when we only have access to relative positions.
+    #[derive(Copy, Clone, PartialEq, Eq, Debug)]
+    #[repr(C)]
+    pub struct InnerSpan {
+        pub start: usize,
+        pub end: usize,
+    }
+
+    // impl InnerSpan {
+    //     pub fn new(start: usize, end: usize) -> InnerSpan {
+    //         InnerSpan { start, end }
+    //     }
+    // }
+
+    /// The location and before/after width of a character whose width has changed from its source code
+    /// representation
+    #[derive(Copy, Clone, PartialEq, Eq)]
+    #[repr(C)]
+    pub struct InnerWidthMapping {
+        /// Index of the character in the source
+        pub position: usize,
+        /// The inner width in characters
+        pub before: usize,
+        /// The transformed width in characters
+        pub after: usize,
+    }
+
+    // impl InnerWidthMapping {
+    //     pub fn new(position: usize, before: usize, after: usize) -> InnerWidthMapping {
+    //         InnerWidthMapping {
+    //             position,
+    //             before,
+    //             after,
+    //         }
+    //     }
+    // }
+
+    /// Whether the input string is a literal. If yes, it contains the inner width mappings.
+    #[derive(Clone, PartialEq, Eq)]
+    #[repr(C)]
+    enum InputStringKind {
+        NotALiteral,
+        Literal {
+            width_mappings: Vec<InnerWidthMapping>,
+        },
+    }
+
+    /// The type of format string that we are parsing.
+    #[derive(Copy, Clone, Debug, Eq, PartialEq)]
+    #[repr(C)]
+    pub enum ParseMode {
+        /// A normal format string as per `format_args!`.
+        Format,
+        /// An inline assembly template string for `asm!`.
+        InlineAsm,
+    }
+
+    #[derive(Copy, Clone)]
+    #[repr(C)]
+    struct InnerOffset(usize);
+
+    /// A piece is a portion of the format string which represents the next part
+    /// to emit. These are emitted as a stream by the `Parser` class.
+    #[derive(Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub enum Piece<'a> {
+        /// A literal string which should directly be emitted
+        String(&'a str),
+        /// This describes that formatting should process the next argument (as
+        /// specified inside) for emission.
+        NextArgument(Box<Argument<'a>>),
+    }
+
+    /// Representation of an argument specification.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub struct Argument<'a> {
+        /// Where to find this argument
+        pub position: Position<'a>,
+        /// The span of the position indicator. Includes any whitespace in implicit
+        /// positions (`{  }`).
+        pub position_span: InnerSpan,
+        /// How to format the argument
+        pub format: FormatSpec<'a>,
+    }
+
+    /// Specification for the formatting of an argument in the format string.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub struct FormatSpec<'a> {
+        /// Optionally specified character to fill alignment with.
+        pub fill: Option<char>,
+        /// Span of the optionally specified fill character.
+        pub fill_span: Option<InnerSpan>,
+        /// Optionally specified alignment.
+        pub align: Alignment,
+        /// The `+` or `-` flag.
+        pub sign: Option<Sign>,
+        /// The `#` flag.
+        pub alternate: bool,
+        /// The `0` flag.
+        pub zero_pad: bool,
+        /// The `x` or `X` flag. (Only for `Debug`.)
+        pub debug_hex: Option<DebugHex>,
+        /// The integer precision to use.
+        pub precision: Count<'a>,
+        /// The span of the precision formatting flag (for diagnostics).
+        pub precision_span: Option<InnerSpan>,
+        /// The string width requested for the resulting format.
+        pub width: Count<'a>,
+        /// The span of the width formatting flag (for diagnostics).
+        pub width_span: Option<InnerSpan>,
+        /// The descriptor string representing the name of the format desired for
+        /// this argument, this can be empty or any number of characters, although
+        /// it is required to be one word.
+        pub ty: &'a str,
+        /// The span of the descriptor string (for diagnostics).
+        pub ty_span: Option<InnerSpan>,
+    }
+
+    /// Enum describing where an argument for a format can be located.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub enum Position<'a> {
+        /// The argument is implied to be located at an index
+        ArgumentImplicitlyIs(usize),
+        /// The argument is located at a specific index given in the format,
+        ArgumentIs(usize),
+        /// The argument has a name.
+        ArgumentNamed(&'a str),
+    }
+
+    /// Enum of alignments which are supported.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub enum Alignment {
+        /// The value will be aligned to the left.
+        AlignLeft,
+        /// The value will be aligned to the right.
+        AlignRight,
+        /// The value will be aligned in the center.
+        AlignCenter,
+        /// The value will take on a default alignment.
+        AlignUnknown,
+    }
+
+    /// Enum for the sign flags.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub enum Sign {
+        /// The `+` flag.
+        Plus,
+        /// The `-` flag.
+        Minus,
+    }
+
+    /// Enum for the debug hex flags.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub enum DebugHex {
+        /// The `x` flag in `{:x?}`.
+        Lower,
+        /// The `X` flag in `{:X?}`.
+        Upper,
+    }
+
+    /// A count is used for the precision and width parameters of an integer, and
+    /// can reference either an argument or a literal integer.
+    #[derive(Copy, Clone, Debug, PartialEq)]
+    #[repr(C)]
+    pub enum Count<'a> {
+        /// The count is specified explicitly.
+        CountIs(usize),
+        /// The count is specified by the argument with the given name.
+        CountIsName(&'a str, InnerSpan),
+        /// The count is specified by the argument at the given index.
+        CountIsParam(usize),
+        /// The count is specified by a star (like in `{:.*}`) that refers to the argument at the given index.
+        CountIsStar(usize),
+        /// The count is implied and cannot be explicitly specified.
+        CountImplied,
+    }
+
+    impl<'a> From<generic_format_parser::Piece<'a>> for Piece<'a> {
+        fn from(old: generic_format_parser::Piece<'a>) -> Self {
+            match old {
+                generic_format_parser::Piece::String(x) => Piece::String(x),
+                generic_format_parser::Piece::NextArgument(x) => {
+                    Piece::NextArgument(Box::new(Into::<Argument>::into(*x)))
+                }
+            }
+        }
+    }
+
+    impl<'a> From<generic_format_parser::Argument<'a>> for Argument<'a> {
+        fn from(old: generic_format_parser::Argument<'a>) -> Self {
+            Argument {
+                position: old.position.into(),
+                position_span: old.position_span.into(),
+                format: old.format.into(),
+            }
+        }
+    }
+
+    impl<'a> From<generic_format_parser::Position<'a>> for Position<'a> {
+        fn from(old: generic_format_parser::Position<'a>) -> Self {
+            match old {
+                generic_format_parser::Position::ArgumentImplicitlyIs(x) => {
+                    Position::ArgumentImplicitlyIs(x.into())
+                }
+                generic_format_parser::Position::ArgumentIs(x) => Position::ArgumentIs(x.into()),
+                generic_format_parser::Position::ArgumentNamed(x) => {
+                    Position::ArgumentNamed(x.into())
+                }
+            }
+        }
+    }
+
+    impl From<generic_format_parser::InnerSpan> for InnerSpan {
+        fn from(old: generic_format_parser::InnerSpan) -> Self {
+            InnerSpan {
+                start: old.start,
+                end: old.end,
+            }
+        }
+    }
+
+    impl<'a> From<generic_format_parser::FormatSpec<'a>> for FormatSpec<'a> {
+        fn from(old: generic_format_parser::FormatSpec<'a>) -> Self {
+            FormatSpec {
+                fill: old.fill,
+                fill_span: old.fill_span.map(Into::into),
+                align: old.align.into(),
+                sign: old.sign.map(Into::into),
+                alternate: old.alternate,
+                zero_pad: old.zero_pad,
+                debug_hex: old.debug_hex.map(Into::into),
+                precision: old.precision.into(),
+                precision_span: old.precision_span.map(Into::into),
+                width: old.width.into(),
+                width_span: old.width_span.map(Into::into),
+                ty: old.ty,
+                ty_span: old.ty_span.map(Into::into),
+            }
+        }
+    }
+
+    impl From<generic_format_parser::DebugHex> for DebugHex {
+        fn from(old: generic_format_parser::DebugHex) -> Self {
+            match old {
+                generic_format_parser::DebugHex::Lower => DebugHex::Lower,
+                generic_format_parser::DebugHex::Upper => DebugHex::Upper,
+            }
+        }
+    }
+
+    impl<'a> From<generic_format_parser::Count<'a>> for Count<'a> {
+        fn from(old: generic_format_parser::Count<'a>) -> Self {
+            match old {
+                generic_format_parser::Count::CountIs(x) => Count::CountIs(x),
+                generic_format_parser::Count::CountIsName(x, y) => Count::CountIsName(x, y.into()),
+                generic_format_parser::Count::CountIsParam(x) => Count::CountIsParam(x),
+                generic_format_parser::Count::CountIsStar(x) => Count::CountIsStar(x),
+                generic_format_parser::Count::CountImplied => Count::CountImplied,
+            }
+        }
+    }
+
+    impl From<generic_format_parser::Sign> for Sign {
+        fn from(old: generic_format_parser::Sign) -> Self {
+            match old {
+                generic_format_parser::Sign::Plus => Sign::Plus,
+                generic_format_parser::Sign::Minus => Sign::Minus,
+            }
+        }
+    }
+
+    impl From<generic_format_parser::Alignment> for Alignment {
+        fn from(old: generic_format_parser::Alignment) -> Self {
+            match old {
+                generic_format_parser::Alignment::AlignLeft => Alignment::AlignLeft,
+                generic_format_parser::Alignment::AlignRight => Alignment::AlignRight,
+                generic_format_parser::Alignment::AlignCenter => Alignment::AlignCenter,
+                generic_format_parser::Alignment::AlignUnknown => Alignment::AlignUnknown,
+            }
+        }
+    }
+}
 
 // FIXME: Rename?
 pub mod rust {
@@ -22,7 +312,7 @@ pub mod rust {
 
 #[repr(C)]
 pub struct PieceSlice {
-    base_ptr: *const Piece<'static /* FIXME: That's wrong */>,
+    base_ptr: *const ffi::Piece<'static /* FIXME: That's wrong */>,
     len: usize,
 }
 
@@ -32,7 +322,10 @@ pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
     let str = unsafe { CStr::from_ptr(input) };
 
     // FIXME: No unwrap
-    let pieces = rust::collect_pieces(str.to_str().unwrap());
+    let pieces: Vec<ffi::Piece<'_>> = rust::collect_pieces(str.to_str().unwrap())
+        .into_iter()
+        .map(Into::into)
+        .collect();
 
     PieceSlice {
         base_ptr: pieces.as_ptr(),
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 012/125] gccrs: libformat_parser: Start experimenting with cbindgen
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (9 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 011/125] gccrs: libformat_parser: Add FFI safe interface Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 013/125] gccrs: libformat_parser: Update header and remove old interface Arthur Cohen
                   ` (112 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

libgrust/ChangeLog:

	* libformat_parser/cbindgen.toml: New file.
	* libformat_parser/libformat-parser.h: New file.

gcc/rust/ChangeLog:

	* ast/rust-fmt.h: Add remaining FFI types.
---
 gcc/rust/ast/rust-fmt.h                      |   4 +-
 libgrust/libformat_parser/cbindgen.toml      |   0
 libgrust/libformat_parser/libformat-parser.h | 224 +++++++++++++++++++
 3 files changed, 226 insertions(+), 2 deletions(-)
 create mode 100644 libgrust/libformat_parser/cbindgen.toml
 create mode 100644 libgrust/libformat_parser/libformat-parser.h

diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 0050977358f..27c1c3625d3 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -92,11 +92,11 @@ struct FormatSpec
   /// The `x` or `X` flag. (Only for `Debug`.)
   tl::optional<DebugHex> debug_hex;
   /// The integer precision to use.
-  // Count <'a> precision;
+  Count precision;
   /// The span of the precision formatting flag (for diagnostics).
   tl::optional<InnerSpan> precision_span;
   /// The string width requested for the resulting format.
-  // Count <'a> width;
+  Count width;
   /// The span of the width formatting flag (for diagnostics).
   tl::optional<InnerSpan> width_span;
   /// The descriptor string representing the name of the format desired for
diff --git a/libgrust/libformat_parser/cbindgen.toml b/libgrust/libformat_parser/cbindgen.toml
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/libgrust/libformat_parser/libformat-parser.h b/libgrust/libformat_parser/libformat-parser.h
new file mode 100644
index 00000000000..a4bc8a75494
--- /dev/null
+++ b/libgrust/libformat_parser/libformat-parser.h
@@ -0,0 +1,224 @@
+#include <cstdarg>
+#include <cstdint>
+#include <cstdlib>
+#include <ostream>
+#include <new>
+
+/// Enum of alignments which are supported.
+enum class Alignment
+{
+  /// The value will be aligned to the left.
+  AlignLeft,
+  /// The value will be aligned to the right.
+  AlignRight,
+  /// The value will be aligned in the center.
+  AlignCenter,
+  /// The value will take on a default alignment.
+  AlignUnknown,
+};
+
+/// Enum for the debug hex flags.
+enum class DebugHex
+{
+  /// The `x` flag in `{:x?}`.
+  Lower,
+  /// The `X` flag in `{:X?}`.
+  Upper,
+};
+
+/// Enum for the sign flags.
+enum class Sign
+{
+  /// The `+` flag.
+  Plus,
+  /// The `-` flag.
+  Minus,
+};
+
+template <typename T = void> struct Box;
+
+template <typename T = void> struct Option;
+
+/// Enum describing where an argument for a format can be located.
+struct Position
+{
+  enum class Tag
+  {
+    /// The argument is implied to be located at an index
+    ArgumentImplicitlyIs,
+    /// The argument is located at a specific index given in the format,
+    ArgumentIs,
+    /// The argument has a name.
+    ArgumentNamed,
+  };
+
+  struct ArgumentImplicitlyIs_Body
+  {
+    uintptr_t _0;
+  };
+
+  struct ArgumentIs_Body
+  {
+    uintptr_t _0;
+  };
+
+  struct ArgumentNamed_Body
+  {
+    const str *_0;
+  };
+
+  Tag tag;
+  union
+  {
+    ArgumentImplicitlyIs_Body argument_implicitly_is;
+    ArgumentIs_Body argument_is;
+    ArgumentNamed_Body argument_named;
+  };
+};
+
+/// Range inside of a `Span` used for diagnostics when we only have access to
+/// relative positions.
+struct InnerSpan
+{
+  uintptr_t start;
+  uintptr_t end;
+};
+
+/// A count is used for the precision and width parameters of an integer, and
+/// can reference either an argument or a literal integer.
+struct Count
+{
+  enum class Tag
+  {
+    /// The count is specified explicitly.
+    CountIs,
+    /// The count is specified by the argument with the given name.
+    CountIsName,
+    /// The count is specified by the argument at the given index.
+    CountIsParam,
+    /// The count is specified by a star (like in `{:.*}`) that refers to the
+    /// argument at the given index.
+    CountIsStar,
+    /// The count is implied and cannot be explicitly specified.
+    CountImplied,
+  };
+
+  struct CountIs_Body
+  {
+    uintptr_t _0;
+  };
+
+  struct CountIsName_Body
+  {
+    const str *_0;
+    InnerSpan _1;
+  };
+
+  struct CountIsParam_Body
+  {
+    uintptr_t _0;
+  };
+
+  struct CountIsStar_Body
+  {
+    uintptr_t _0;
+  };
+
+  Tag tag;
+  union
+  {
+    CountIs_Body count_is;
+    CountIsName_Body count_is_name;
+    CountIsParam_Body count_is_param;
+    CountIsStar_Body count_is_star;
+  };
+};
+
+/// Specification for the formatting of an argument in the format string.
+struct FormatSpec
+{
+  /// Optionally specified character to fill alignment with.
+  Option<uint32_t> fill;
+  /// Span of the optionally specified fill character.
+  Option<InnerSpan> fill_span;
+  /// Optionally specified alignment.
+  Alignment align;
+  /// The `+` or `-` flag.
+  Option<Sign> sign;
+  /// The `#` flag.
+  bool alternate;
+  /// The `0` flag.
+  bool zero_pad;
+  /// The `x` or `X` flag. (Only for `Debug`.)
+  Option<DebugHex> debug_hex;
+  /// The integer precision to use.
+  Count precision;
+  /// The span of the precision formatting flag (for diagnostics).
+  Option<InnerSpan> precision_span;
+  /// The string width requested for the resulting format.
+  Count width;
+  /// The span of the width formatting flag (for diagnostics).
+  Option<InnerSpan> width_span;
+  /// The descriptor string representing the name of the format desired for
+  /// this argument, this can be empty or any number of characters, although
+  /// it is required to be one word.
+  const str *ty;
+  /// The span of the descriptor string (for diagnostics).
+  Option<InnerSpan> ty_span;
+};
+
+/// Representation of an argument specification.
+struct Argument
+{
+  /// Where to find this argument
+  Position position;
+  /// The span of the position indicator. Includes any whitespace in implicit
+  /// positions (`{  }`).
+  InnerSpan position_span;
+  /// How to format the argument
+  FormatSpec format;
+};
+
+/// A piece is a portion of the format string which represents the next part
+/// to emit. These are emitted as a stream by the `Parser` class.
+struct Piece
+{
+  enum class Tag
+  {
+    /// A literal string which should directly be emitted
+    String,
+    /// This describes that formatting should process the next argument (as
+    /// specified inside) for emission.
+    NextArgument,
+  };
+
+  struct String_Body
+  {
+    const str *_0;
+  };
+
+  struct NextArgument_Body
+  {
+    Box<Argument> _0;
+  };
+
+  Tag tag;
+  union
+  {
+    String_Body string;
+    NextArgument_Body next_argument;
+  };
+};
+
+struct PieceSlice
+{
+  const Piece *base_ptr;
+  uintptr_t len;
+};
+
+extern "C" {
+
+PieceSlice
+collect_pieces (const char *input);
+
+} // extern "C"
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 013/125] gccrs: libformat_parser: Update header and remove old interface
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (10 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 012/125] gccrs: libformat_parser: Start experimenting with cbindgen Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 014/125] gccrs: libformat_parser: Send boxed values across FFI properly Arthur Cohen
                   ` (111 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-fmt.cc (Pieces::collect): Use new Pieces API.
	* ast/rust-fmt.h: Update interface with new FFI bindings.

libgrust/ChangeLog:

	* libformat_parser/src/lib.rs: Add IntoFFI trait.
	* libformat_parser/libformat-parser.h: Removed.
---
 gcc/rust/ast/rust-fmt.cc                     |  10 +-
 gcc/rust/ast/rust-fmt.h                      | 199 ++++++++++++----
 libgrust/libformat_parser/libformat-parser.h | 224 -------------------
 libgrust/libformat_parser/src/lib.rs         |  56 +++--
 4 files changed, 200 insertions(+), 289 deletions(-)
 delete mode 100644 libgrust/libformat_parser/libformat-parser.h

diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index 559b1c8b579..a7c4341c52d 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -17,6 +17,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-fmt.h"
+#include "rust-diagnostics.h"
 
 namespace Rust {
 namespace Fmt {
@@ -26,13 +27,12 @@ Pieces::collect (const std::string &to_parse)
 {
   auto piece_slice = collect_pieces (to_parse.c_str ());
 
-  rust_debug ("[ARTHUR] %p, %lu", (void *) piece_slice.ptr, piece_slice.len);
+  rust_debug ("[ARTHUR] %p, %lu", (const void *) piece_slice.base_ptr,
+	      piece_slice.len);
 
   // this performs multiple copies, can we avoid them maybe?
-  auto pieces
-    = std::vector (piece_slice.ptr, piece_slice.ptr + piece_slice.len);
-
-  rust_debug ("[ARTHUR] %p, %lu", (void *) pieces.data (), pieces.size ());
+  // auto pieces = std::vector<Piece> (piece_slice.base_ptr,
+  // 	     piece_slice.base_ptr + piece_slice.len);
 
   return Pieces{};
 }
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 27c1c3625d3..7ec9a2a199d 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+// Copyright (C) 2023-2024 Free Software Foundation, Inc.
 
 // This file is part of GCC.
 
@@ -19,9 +19,10 @@
 #ifndef RUST_FMT_H
 #define RUST_FMT_H
 
-#include "rust-diagnostics.h"
 #include "rust-system.h"
 
+// FIXME: How to encode Option?
+
 namespace Rust {
 namespace Fmt {
 
@@ -30,116 +31,220 @@ struct RustHamster
   // hehe
 };
 
-struct InnerSpan
+/// Enum of alignments which are supported.
+enum class Alignment
 {
+  /// The value will be aligned to the left.
+  AlignLeft,
+  /// The value will be aligned to the right.
+  AlignRight,
+  /// The value will be aligned in the center.
+  AlignCenter,
+  /// The value will take on a default alignment.
+  AlignUnknown,
 };
 
-struct Count
+/// Enum for the debug hex flags.
+enum class DebugHex
 {
-  enum class Kind
-  {
-    Is,
-    IsName,
-    IsParam,
-    IsStar,
-    Implied
-  } kind;
-
-  union
-  {
-    size_t is;
-    std::pair<RustHamster, InnerSpan> is_name;
-    size_t is_param;
-    size_t is_star;
-  } data;
+  /// The `x` flag in `{:x?}`.
+  Lower,
+  /// The `X` flag in `{:X?}`.
+  Upper,
 };
 
-struct DebugHex
+/// Enum for the sign flags.
+enum class Sign
 {
+  /// The `+` flag.
+  Plus,
+  /// The `-` flag.
+  Minus,
 };
 
-struct Sign
+/// Enum describing where an argument for a format can be located.
+struct Position
 {
-};
+  enum class Tag
+  {
+    /// The argument is implied to be located at an index
+    ArgumentImplicitlyIs,
+    /// The argument is located at a specific index given in the format,
+    ArgumentIs,
+    /// The argument has a name.
+    ArgumentNamed,
+  };
 
-struct Alignment
-{
+  struct ArgumentImplicitlyIs_Body
+  {
+    size_t _0;
+  };
+
+  struct ArgumentIs_Body
+  {
+    size_t _0;
+  };
+
+  struct ArgumentNamed_Body
+  {
+    RustHamster _0;
+  };
+
+  Tag tag;
+  union
+  {
+    ArgumentImplicitlyIs_Body argument_implicitly_is;
+    ArgumentIs_Body argument_is;
+    ArgumentNamed_Body argument_named;
+  };
 };
 
-struct RustString
+/// Range inside of a `Span` used for diagnostics when we only have access to
+/// relative positions.
+struct InnerSpan
 {
-  // hehe
+  size_t start;
+  size_t end;
 };
 
-struct Position
+/// A count is used for the precision and width parameters of an integer, and
+/// can reference either an argument or a literal integer.
+struct Count
 {
+  enum class Tag
+  {
+    /// The count is specified explicitly.
+    CountIs,
+    /// The count is specified by the argument with the given name.
+    CountIsName,
+    /// The count is specified by the argument at the given index.
+    CountIsParam,
+    /// The count is specified by a star (like in `{:.*}`) that refers to the
+    /// argument at the given index.
+    CountIsStar,
+    /// The count is implied and cannot be explicitly specified.
+    CountImplied,
+  };
+
+  struct CountIs_Body
+  {
+    size_t _0;
+  };
+
+  struct CountIsName_Body
+  {
+    RustHamster _0;
+    InnerSpan _1;
+  };
+
+  struct CountIsParam_Body
+  {
+    size_t _0;
+  };
+
+  struct CountIsStar_Body
+  {
+    size_t _0;
+  };
+
+  Tag tag;
+  union
+  {
+    CountIs_Body count_is;
+    CountIsName_Body count_is_name;
+    CountIsParam_Body count_is_param;
+    CountIsStar_Body count_is_star;
+  };
 };
 
+/// Specification for the formatting of an argument in the format string.
 struct FormatSpec
 {
   /// Optionally specified character to fill alignment with.
-  tl::optional<char /* FIXME: This is a Rust char, not a C++ char - use an uint32_t instead?  */> fill;
+  const uint32_t *fill;
   /// Span of the optionally specified fill character.
-  tl::optional<InnerSpan> fill_span;
+  const InnerSpan *fill_span;
   /// Optionally specified alignment.
   Alignment align;
   /// The `+` or `-` flag.
-  tl::optional<Sign> sign;
+  const Sign *sign;
   /// The `#` flag.
   bool alternate;
   /// The `0` flag.
   bool zero_pad;
   /// The `x` or `X` flag. (Only for `Debug`.)
-  tl::optional<DebugHex> debug_hex;
+  const DebugHex *debug_hex;
   /// The integer precision to use.
   Count precision;
   /// The span of the precision formatting flag (for diagnostics).
-  tl::optional<InnerSpan> precision_span;
+  const InnerSpan *precision_span;
   /// The string width requested for the resulting format.
   Count width;
   /// The span of the width formatting flag (for diagnostics).
-  tl::optional<InnerSpan> width_span;
+  const InnerSpan *width_span;
   /// The descriptor string representing the name of the format desired for
   /// this argument, this can be empty or any number of characters, although
   /// it is required to be one word.
   RustHamster ty;
-  // &'a str ty;
   /// The span of the descriptor string (for diagnostics).
-  tl::optional<InnerSpan> ty_span;
+  const InnerSpan *ty_span;
 };
 
+/// Representation of an argument specification.
 struct Argument
 {
+  /// Where to find this argument
   Position position;
-  InnerSpan inner_span;
+  /// The span of the position indicator. Includes any whitespace in implicit
+  /// positions (`{  }`).
+  InnerSpan position_span;
+  /// How to format the argument
   FormatSpec format;
 };
 
+/// A piece is a portion of the format string which represents the next part
+/// to emit. These are emitted as a stream by the `Parser` class.
 struct Piece
 {
-  enum class Kind
+  enum class Tag
   {
+    /// A literal string which should directly be emitted
     String,
-    NextArgument
-  } kind;
+    /// This describes that formatting should process the next argument (as
+    /// specified inside) for emission.
+    NextArgument,
+  };
+
+  struct String_Body
+  {
+    RustHamster _0;
+  };
+
+  struct NextArgument_Body
+  {
+    const Argument *_0;
+  };
 
+  Tag tag;
   union
   {
-    RustString string;
-    Argument *next_argument;
-  } data;
+    String_Body string;
+    NextArgument_Body next_argument;
+  };
 };
 
 struct PieceSlice
 {
-  Piece *ptr;
+  const Piece *base_ptr;
   size_t len;
 };
 
 extern "C" {
+
 PieceSlice
-collect_pieces (const char *);
-}
+collect_pieces (const char *input);
+
+} // extern "C"
 
 struct Pieces
 {
@@ -149,4 +254,4 @@ struct Pieces
 } // namespace Fmt
 } // namespace Rust
 
-#endif // ! RUST_FMT_H
+#endif // !RUST_FMT_H
diff --git a/libgrust/libformat_parser/libformat-parser.h b/libgrust/libformat_parser/libformat-parser.h
deleted file mode 100644
index a4bc8a75494..00000000000
--- a/libgrust/libformat_parser/libformat-parser.h
+++ /dev/null
@@ -1,224 +0,0 @@
-#include <cstdarg>
-#include <cstdint>
-#include <cstdlib>
-#include <ostream>
-#include <new>
-
-/// Enum of alignments which are supported.
-enum class Alignment
-{
-  /// The value will be aligned to the left.
-  AlignLeft,
-  /// The value will be aligned to the right.
-  AlignRight,
-  /// The value will be aligned in the center.
-  AlignCenter,
-  /// The value will take on a default alignment.
-  AlignUnknown,
-};
-
-/// Enum for the debug hex flags.
-enum class DebugHex
-{
-  /// The `x` flag in `{:x?}`.
-  Lower,
-  /// The `X` flag in `{:X?}`.
-  Upper,
-};
-
-/// Enum for the sign flags.
-enum class Sign
-{
-  /// The `+` flag.
-  Plus,
-  /// The `-` flag.
-  Minus,
-};
-
-template <typename T = void> struct Box;
-
-template <typename T = void> struct Option;
-
-/// Enum describing where an argument for a format can be located.
-struct Position
-{
-  enum class Tag
-  {
-    /// The argument is implied to be located at an index
-    ArgumentImplicitlyIs,
-    /// The argument is located at a specific index given in the format,
-    ArgumentIs,
-    /// The argument has a name.
-    ArgumentNamed,
-  };
-
-  struct ArgumentImplicitlyIs_Body
-  {
-    uintptr_t _0;
-  };
-
-  struct ArgumentIs_Body
-  {
-    uintptr_t _0;
-  };
-
-  struct ArgumentNamed_Body
-  {
-    const str *_0;
-  };
-
-  Tag tag;
-  union
-  {
-    ArgumentImplicitlyIs_Body argument_implicitly_is;
-    ArgumentIs_Body argument_is;
-    ArgumentNamed_Body argument_named;
-  };
-};
-
-/// Range inside of a `Span` used for diagnostics when we only have access to
-/// relative positions.
-struct InnerSpan
-{
-  uintptr_t start;
-  uintptr_t end;
-};
-
-/// A count is used for the precision and width parameters of an integer, and
-/// can reference either an argument or a literal integer.
-struct Count
-{
-  enum class Tag
-  {
-    /// The count is specified explicitly.
-    CountIs,
-    /// The count is specified by the argument with the given name.
-    CountIsName,
-    /// The count is specified by the argument at the given index.
-    CountIsParam,
-    /// The count is specified by a star (like in `{:.*}`) that refers to the
-    /// argument at the given index.
-    CountIsStar,
-    /// The count is implied and cannot be explicitly specified.
-    CountImplied,
-  };
-
-  struct CountIs_Body
-  {
-    uintptr_t _0;
-  };
-
-  struct CountIsName_Body
-  {
-    const str *_0;
-    InnerSpan _1;
-  };
-
-  struct CountIsParam_Body
-  {
-    uintptr_t _0;
-  };
-
-  struct CountIsStar_Body
-  {
-    uintptr_t _0;
-  };
-
-  Tag tag;
-  union
-  {
-    CountIs_Body count_is;
-    CountIsName_Body count_is_name;
-    CountIsParam_Body count_is_param;
-    CountIsStar_Body count_is_star;
-  };
-};
-
-/// Specification for the formatting of an argument in the format string.
-struct FormatSpec
-{
-  /// Optionally specified character to fill alignment with.
-  Option<uint32_t> fill;
-  /// Span of the optionally specified fill character.
-  Option<InnerSpan> fill_span;
-  /// Optionally specified alignment.
-  Alignment align;
-  /// The `+` or `-` flag.
-  Option<Sign> sign;
-  /// The `#` flag.
-  bool alternate;
-  /// The `0` flag.
-  bool zero_pad;
-  /// The `x` or `X` flag. (Only for `Debug`.)
-  Option<DebugHex> debug_hex;
-  /// The integer precision to use.
-  Count precision;
-  /// The span of the precision formatting flag (for diagnostics).
-  Option<InnerSpan> precision_span;
-  /// The string width requested for the resulting format.
-  Count width;
-  /// The span of the width formatting flag (for diagnostics).
-  Option<InnerSpan> width_span;
-  /// The descriptor string representing the name of the format desired for
-  /// this argument, this can be empty or any number of characters, although
-  /// it is required to be one word.
-  const str *ty;
-  /// The span of the descriptor string (for diagnostics).
-  Option<InnerSpan> ty_span;
-};
-
-/// Representation of an argument specification.
-struct Argument
-{
-  /// Where to find this argument
-  Position position;
-  /// The span of the position indicator. Includes any whitespace in implicit
-  /// positions (`{  }`).
-  InnerSpan position_span;
-  /// How to format the argument
-  FormatSpec format;
-};
-
-/// A piece is a portion of the format string which represents the next part
-/// to emit. These are emitted as a stream by the `Parser` class.
-struct Piece
-{
-  enum class Tag
-  {
-    /// A literal string which should directly be emitted
-    String,
-    /// This describes that formatting should process the next argument (as
-    /// specified inside) for emission.
-    NextArgument,
-  };
-
-  struct String_Body
-  {
-    const str *_0;
-  };
-
-  struct NextArgument_Body
-  {
-    Box<Argument> _0;
-  };
-
-  Tag tag;
-  union
-  {
-    String_Body string;
-    NextArgument_Body next_argument;
-  };
-};
-
-struct PieceSlice
-{
-  const Piece *base_ptr;
-  uintptr_t len;
-};
-
-extern "C" {
-
-PieceSlice
-collect_pieces (const char *input);
-
-} // extern "C"
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 49821e7cd2f..4bbc468c755 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -5,8 +5,31 @@
 
 use std::ffi::CStr;
 
+trait IntoFFI {
+    type Output;
+
+    fn into_ffi(&self) -> Self::Output;
+}
+
+impl<T> IntoFFI for Option<T>
+where
+    T: Sized,
+{
+    type Output = *const T;
+
+    fn into_ffi(&self) -> Self::Output {
+        match self.as_ref() {
+            None => std::ptr::null(),
+            Some(r) => r as *const T,
+        }
+    }
+}
+
+// FIXME: Make an ffi module in a separate file
+// FIXME: Remember to leak the boxed type somehow
+// FIXME: How to encode the Option type? As a pointer? Option<T> -> Option<&T> -> *const T could work maybe?
 mod ffi {
-    use std::ops::Deref;
+    use super::IntoFFI;
 
     // Note: copied from rustc_span
     /// Range inside of a `Span` used for diagnostics when we only have access to relative positions.
@@ -102,31 +125,31 @@ mod ffi {
         /// Optionally specified character to fill alignment with.
         pub fill: Option<char>,
         /// Span of the optionally specified fill character.
-        pub fill_span: Option<InnerSpan>,
+        pub fill_span: *const InnerSpan,
         /// Optionally specified alignment.
         pub align: Alignment,
         /// The `+` or `-` flag.
-        pub sign: Option<Sign>,
+        pub sign: *const Sign,
         /// The `#` flag.
         pub alternate: bool,
         /// The `0` flag.
         pub zero_pad: bool,
         /// The `x` or `X` flag. (Only for `Debug`.)
-        pub debug_hex: Option<DebugHex>,
+        pub debug_hex: *const DebugHex,
         /// The integer precision to use.
         pub precision: Count<'a>,
         /// The span of the precision formatting flag (for diagnostics).
-        pub precision_span: Option<InnerSpan>,
+        pub precision_span: *const InnerSpan,
         /// The string width requested for the resulting format.
         pub width: Count<'a>,
         /// The span of the width formatting flag (for diagnostics).
-        pub width_span: Option<InnerSpan>,
+        pub width_span: *const InnerSpan,
         /// The descriptor string representing the name of the format desired for
         /// this argument, this can be empty or any number of characters, although
         /// it is required to be one word.
         pub ty: &'a str,
         /// The span of the descriptor string (for diagnostics).
-        pub ty_span: Option<InnerSpan>,
+        pub ty_span: *const InnerSpan,
     }
 
     /// Enum describing where an argument for a format can be located.
@@ -197,6 +220,11 @@ mod ffi {
             match old {
                 generic_format_parser::Piece::String(x) => Piece::String(x),
                 generic_format_parser::Piece::NextArgument(x) => {
+                    // FIXME: This is problematic - if we do this, then we probably run into the issue that the Box
+                    // is freed at the end of the call to collect_pieces. if we just .leak() it, then we have
+                    // a memory leak... should we resend the info back to the Rust lib afterwards to free it?
+                    // this is definitely the best way - store that pointer in the FFI piece and rebuild the box
+                    // in a Rust destructor
                     Piece::NextArgument(Box::new(Into::<Argument>::into(*x)))
                 }
             }
@@ -240,18 +268,18 @@ mod ffi {
         fn from(old: generic_format_parser::FormatSpec<'a>) -> Self {
             FormatSpec {
                 fill: old.fill,
-                fill_span: old.fill_span.map(Into::into),
+                fill_span: old.fill_span.map(Into::into).into_ffi(),
                 align: old.align.into(),
-                sign: old.sign.map(Into::into),
+                sign: old.sign.map(Into::into).into_ffi(),
                 alternate: old.alternate,
                 zero_pad: old.zero_pad,
-                debug_hex: old.debug_hex.map(Into::into),
+                debug_hex: old.debug_hex.map(Into::into).into_ffi(),
                 precision: old.precision.into(),
-                precision_span: old.precision_span.map(Into::into),
+                precision_span: old.precision_span.map(Into::into).into_ffi(),
                 width: old.width.into(),
-                width_span: old.width_span.map(Into::into),
+                width_span: old.width_span.map(Into::into).into_ffi(),
                 ty: old.ty,
-                ty_span: old.ty_span.map(Into::into),
+                ty_span: old.ty_span.map(Into::into).into_ffi(),
             }
         }
     }
@@ -327,6 +355,8 @@ pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
         .map(Into::into)
         .collect();
 
+    println!("debug: {:?}, {:?}", pieces.as_ptr(), pieces.len());
+
     PieceSlice {
         base_ptr: pieces.as_ptr(),
         len: pieces.len(),
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 014/125] gccrs: libformat_parser: Send boxed values across FFI properly
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (11 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 013/125] gccrs: libformat_parser: Update header and remove old interface Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 015/125] gccrs: format_args: Parse format string properly Arthur Cohen
                   ` (110 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-fmt.cc (Pieces::~Pieces): Call libformat_parser's release
	function in destructor.
	* ast/rust-fmt.h (struct PieceSlice): Add capacity.
	(destroy_pieces): New.
	(struct Pieces): Add destructor.

libgrust/ChangeLog:

	* libformat_parser/src/lib.rs: Leak Boxes properly for C++ to
	see them, add memory release function.
---
 gcc/rust/ast/rust-fmt.cc             |  4 +-
 gcc/rust/ast/rust-fmt.h              |  9 +++
 libgrust/libformat_parser/src/lib.rs | 94 ++++++++++++++--------------
 3 files changed, 58 insertions(+), 49 deletions(-)

diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index a7c4341c52d..f6ee8a20913 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -34,8 +34,10 @@ Pieces::collect (const std::string &to_parse)
   // auto pieces = std::vector<Piece> (piece_slice.base_ptr,
   // 	     piece_slice.base_ptr + piece_slice.len);
 
-  return Pieces{};
+  return Pieces (piece_slice);
 }
 
+Pieces::~Pieces () { destroy_pieces (slice); }
+
 } // namespace Fmt
 } // namespace Rust
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 7ec9a2a199d..50aeff6433e 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -237,6 +237,7 @@ struct PieceSlice
 {
   const Piece *base_ptr;
   size_t len;
+  size_t cap;
 };
 
 extern "C" {
@@ -244,11 +245,19 @@ extern "C" {
 PieceSlice
 collect_pieces (const char *input);
 
+void destroy_pieces (PieceSlice);
+
 } // extern "C"
 
 struct Pieces
 {
   static Pieces collect (const std::string &to_parse);
+  ~Pieces ();
+
+private:
+  Pieces (PieceSlice slice) : slice (slice) {}
+
+  PieceSlice slice;
 };
 
 } // namespace Fmt
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 4bbc468c755..9b2bffed05d 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -3,21 +3,17 @@
 // what's the plan? Have a function return something that can be constructed into a vector?
 // or an iterator?
 
-use std::ffi::CStr;
+use std::{ffi::CStr, mem};
 
-trait IntoFFI {
-    type Output;
-
-    fn into_ffi(&self) -> Self::Output;
+trait IntoFFI<T> {
+    fn into_ffi(self) -> T;
 }
 
-impl<T> IntoFFI for Option<T>
+impl<T> IntoFFI<*const T> for Option<T>
 where
     T: Sized,
 {
-    type Output = *const T;
-
-    fn into_ffi(&self) -> Self::Output {
+    fn into_ffi(self) -> *const T {
         match self.as_ref() {
             None => std::ptr::null(),
             Some(r) => r as *const T,
@@ -40,12 +36,6 @@ mod ffi {
         pub end: usize,
     }
 
-    // impl InnerSpan {
-    //     pub fn new(start: usize, end: usize) -> InnerSpan {
-    //         InnerSpan { start, end }
-    //     }
-    // }
-
     /// The location and before/after width of a character whose width has changed from its source code
     /// representation
     #[derive(Copy, Clone, PartialEq, Eq)]
@@ -59,35 +49,27 @@ mod ffi {
         pub after: usize,
     }
 
-    // impl InnerWidthMapping {
-    //     pub fn new(position: usize, before: usize, after: usize) -> InnerWidthMapping {
-    //         InnerWidthMapping {
-    //             position,
-    //             before,
-    //             after,
-    //         }
-    //     }
+    // TODO: Not needed for now?
+    // /// Whether the input string is a literal. If yes, it contains the inner width mappings.
+    // #[derive(Clone, PartialEq, Eq)]
+    // #[repr(C)]
+    // enum InputStringKind {
+    //     NotALiteral,
+    //     Literal {
+    //         width_mappings: Vec<InnerWidthMapping>,
+    //     },
     // }
 
-    /// Whether the input string is a literal. If yes, it contains the inner width mappings.
-    #[derive(Clone, PartialEq, Eq)]
-    #[repr(C)]
-    enum InputStringKind {
-        NotALiteral,
-        Literal {
-            width_mappings: Vec<InnerWidthMapping>,
-        },
-    }
-
-    /// The type of format string that we are parsing.
-    #[derive(Copy, Clone, Debug, Eq, PartialEq)]
-    #[repr(C)]
-    pub enum ParseMode {
-        /// A normal format string as per `format_args!`.
-        Format,
-        /// An inline assembly template string for `asm!`.
-        InlineAsm,
-    }
+    // TODO: Not needed for now?
+    // /// The type of format string that we are parsing.
+    // #[derive(Copy, Clone, Debug, Eq, PartialEq)]
+    // #[repr(C)]
+    // pub enum ParseMode {
+    //     /// A normal format string as per `format_args!`.
+    //     Format,
+    //     /// An inline assembly template string for `asm!`.
+    //     InlineAsm,
+    // }
 
     #[derive(Copy, Clone)]
     #[repr(C)]
@@ -102,7 +84,13 @@ mod ffi {
         String(&'a str),
         /// This describes that formatting should process the next argument (as
         /// specified inside) for emission.
-        NextArgument(Box<Argument<'a>>),
+        NextArgument(*const Argument<'a>),
+    }
+
+    impl<'a> Drop for Piece<'a> {
+        fn drop(&mut self) {
+            println!("dropping Piece: {:?}", self)
+        }
     }
 
     /// Representation of an argument specification.
@@ -225,7 +213,10 @@ mod ffi {
                     // a memory leak... should we resend the info back to the Rust lib afterwards to free it?
                     // this is definitely the best way - store that pointer in the FFI piece and rebuild the box
                     // in a Rust destructor
-                    Piece::NextArgument(Box::new(Into::<Argument>::into(*x)))
+                    let ptr = Box::leak(x);
+                    let dst = Into::<Argument>::into(*ptr);
+
+                    Piece::NextArgument(&dst as *const Argument)
                 }
             }
         }
@@ -331,17 +322,18 @@ pub mod rust {
     use generic_format_parser::{ParseMode, Parser, Piece};
 
     pub fn collect_pieces(input: &str) -> Vec<Piece<'_>> {
-        // let parser = Parser::new();
         let parser = Parser::new(input, None, None, true, ParseMode::Format);
 
         parser.into_iter().collect()
     }
 }
 
+// TODO: Should we instead make an FFIVector struct?
 #[repr(C)]
 pub struct PieceSlice {
-    base_ptr: *const ffi::Piece<'static /* FIXME: That's wrong */>,
+    base_ptr: *mut ffi::Piece<'static /* FIXME: That's wrong */>,
     len: usize,
+    cap: usize,
 }
 
 #[no_mangle]
@@ -355,10 +347,16 @@ pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
         .map(Into::into)
         .collect();
 
-    println!("debug: {:?}, {:?}", pieces.as_ptr(), pieces.len());
+    println!("[ARTHUR]: debug: {:?}, {:?}", pieces.as_ptr(), pieces.len());
 
     PieceSlice {
-        base_ptr: pieces.as_ptr(),
         len: pieces.len(),
+        cap: pieces.capacity(),
+        base_ptr: pieces.leak().as_mut_ptr(),
     }
 }
+
+#[no_mangle]
+pub extern "C" fn destroy_pieces(PieceSlice { base_ptr, len, cap }: PieceSlice) {
+    let _ = unsafe { Vec::from_raw_parts(base_ptr, len, cap) };
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 015/125] gccrs: format_args: Parse format string properly
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (12 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 014/125] gccrs: libformat_parser: Send boxed values across FFI properly Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 016/125] gccrs: format_args: Parse entire token invocation Arthur Cohen
                   ` (109 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
	Construct string to parser properly.
---
 gcc/rust/expand/rust-macro-builtins.cc | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 0e57406f10f..19ea9109453 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -947,7 +947,24 @@ tl::optional<AST::Fragment>
 MacroBuiltin::format_args_handler (location_t invoc_locus,
 				   AST::MacroInvocData &invoc)
 {
-  Fmt::Pieces::collect ("heyo this {is} what I {} want to {3}, {parse}");
+  auto fmt_expr
+    = parse_single_string_literal (BuiltinMacro::FormatArgs,
+				   invoc.get_delim_tok_tree (), invoc_locus,
+				   invoc.get_expander ());
+
+  if (!fmt_expr)
+    return AST::Fragment::create_error ();
+
+  // if it is not a literal, it's an eager macro invocation - return it
+  if (!fmt_expr->is_literal ())
+    {
+      auto token_tree = invoc.get_delim_tok_tree ();
+      return AST::Fragment ({AST::SingleASTNode (std::move (fmt_expr))},
+			    token_tree.to_token_stream ());
+    }
+
+  auto format_string = fmt_expr->as_string ();
+  auto pieces = Fmt::Pieces::collect (format_string);
 
   return AST::Fragment::create_empty ();
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 016/125] gccrs: format_args: Parse entire token invocation
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (13 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 015/125] gccrs: format_args: Parse format string properly Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 017/125] gccrs: rust-fmt: Store parsed string in Pieces struct Arthur Cohen
                   ` (108 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
	Transform entire invocation token stream into string for the parser.
---
 gcc/rust/expand/rust-macro-builtins.cc | 40 ++++++++++++++------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 19ea9109453..2af05a5e377 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -16,6 +16,8 @@
 // along with GCC; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include "libproc_macro_internal/tokenstream.h"
+#include "rust-token-converter.h"
 #include "rust-system.h"
 #include "rust-macro-builtins.h"
 #include "rust-ast-fragment.h"
@@ -947,24 +949,26 @@ tl::optional<AST::Fragment>
 MacroBuiltin::format_args_handler (location_t invoc_locus,
 				   AST::MacroInvocData &invoc)
 {
-  auto fmt_expr
-    = parse_single_string_literal (BuiltinMacro::FormatArgs,
-				   invoc.get_delim_tok_tree (), invoc_locus,
-				   invoc.get_expander ());
-
-  if (!fmt_expr)
-    return AST::Fragment::create_error ();
-
-  // if it is not a literal, it's an eager macro invocation - return it
-  if (!fmt_expr->is_literal ())
-    {
-      auto token_tree = invoc.get_delim_tok_tree ();
-      return AST::Fragment ({AST::SingleASTNode (std::move (fmt_expr))},
-			    token_tree.to_token_stream ());
-    }
-
-  auto format_string = fmt_expr->as_string ();
-  auto pieces = Fmt::Pieces::collect (format_string);
+  auto tokens = invoc.get_delim_tok_tree ().to_token_stream ();
+  tokens.erase (tokens.begin ());
+  tokens.pop_back ();
+
+  std::stringstream stream;
+  for (const auto &tok : tokens)
+    stream << tok->as_string () << ' ';
+
+  rust_debug ("[ARTHU]: `%s`", stream.str ().c_str ());
+
+  // FIXME: We need to handle this
+  // // if it is not a literal, it's an eager macro invocation - return it
+  // if (!fmt_expr->is_literal ())
+  //   {
+  //     auto token_tree = invoc.get_delim_tok_tree ();
+  //     return AST::Fragment ({AST::SingleASTNode (std::move (fmt_expr))},
+  // 	    token_tree.to_token_stream ());
+  //   }
+
+  auto pieces = Fmt::Pieces::collect (stream.str ());
 
   return AST::Fragment::create_empty ();
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 017/125] gccrs: rust-fmt: Store parsed string in Pieces struct
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (14 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 016/125] gccrs: format_args: Parse entire token invocation Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 018/125] gccrs: libformat_parser: Fix Rust warnings Arthur Cohen
                   ` (107 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-fmt.cc (Pieces::collect): Fix signature to take ownership
	of the given string.
	* ast/rust-fmt.h (struct Pieces): Store parsed string in the struct.

libgrust/ChangeLog:

	* libformat_parser/src/lib.rs: Add debug prompt.
---
 gcc/rust/ast/rust-fmt.cc             | 4 ++--
 gcc/rust/ast/rust-fmt.h              | 7 +++++--
 libgrust/libformat_parser/src/lib.rs | 1 +
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index f6ee8a20913..511e94740c5 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -23,7 +23,7 @@ namespace Rust {
 namespace Fmt {
 
 Pieces
-Pieces::collect (const std::string &to_parse)
+Pieces::collect (std::string &&to_parse)
 {
   auto piece_slice = collect_pieces (to_parse.c_str ());
 
@@ -34,7 +34,7 @@ Pieces::collect (const std::string &to_parse)
   // auto pieces = std::vector<Piece> (piece_slice.base_ptr,
   // 	     piece_slice.base_ptr + piece_slice.len);
 
-  return Pieces (piece_slice);
+  return Pieces (piece_slice, std::move (to_parse));
 }
 
 Pieces::~Pieces () { destroy_pieces (slice); }
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 50aeff6433e..0bf9695bb6d 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -251,13 +251,16 @@ void destroy_pieces (PieceSlice);
 
 struct Pieces
 {
-  static Pieces collect (const std::string &to_parse);
+  static Pieces collect (std::string &&to_parse);
   ~Pieces ();
 
 private:
-  Pieces (PieceSlice slice) : slice (slice) {}
+  Pieces (PieceSlice slice, std::string &&to_parse)
+    : slice (slice), to_parse (std::move (to_parse))
+  {}
 
   PieceSlice slice;
+  std::string to_parse;
 };
 
 } // namespace Fmt
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 9b2bffed05d..eb3e1060e5d 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -340,6 +340,7 @@ pub struct PieceSlice {
 pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
     // FIXME: Add comment
     let str = unsafe { CStr::from_ptr(input) };
+    dbg!(str);
 
     // FIXME: No unwrap
     let pieces: Vec<ffi::Piece<'_>> = rust::collect_pieces(str.to_str().unwrap())
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 018/125] gccrs: libformat_parser: Fix Rust warnings.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (15 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 017/125] gccrs: rust-fmt: Store parsed string in Pieces struct Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 019/125] gccrs: format-parser: Add `is_some_and` method for Option<T> Arthur Cohen
                   ` (106 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

libgrust/ChangeLog:

	* libformat_parser/generic_format_parser/src/lib.rs: Remove
	unused deprecated attribute and unused import.
	* libformat_parser/src/lib.rs: Remove unused import.
---
 libgrust/libformat_parser/generic_format_parser/src/lib.rs | 2 --
 libgrust/libformat_parser/src/lib.rs                       | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
index 87a20dc18c5..6a366177f25 100644
--- a/libgrust/libformat_parser/generic_format_parser/src/lib.rs
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -14,12 +14,10 @@
 // WARNING: We want to be able to build this crate with a stable compiler,
 //          so no `#![feature]` attributes should be added!
 
-#[deprecated(note = "Use a proper lexer function for this")]
 fn is_id_start(c: char) -> bool {
     c == '_' || unicode_xid::UnicodeXID::is_xid_start(c)
 }
 
-#[deprecated(note = "Use a proper lexer function for this")]
 fn is_id_continue(c: char) -> bool {
     unicode_xid::UnicodeXID::is_xid_continue(c)
 }
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index eb3e1060e5d..c164578a103 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -3,7 +3,7 @@
 // what's the plan? Have a function return something that can be constructed into a vector?
 // or an iterator?
 
-use std::{ffi::CStr, mem};
+use std::ffi::CStr;
 
 trait IntoFFI<T> {
     fn into_ffi(self) -> T;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 019/125] gccrs: format-parser: Add `is_some_and` method for Option<T>
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (16 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 018/125] gccrs: libformat_parser: Fix Rust warnings Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 020/125] gccrs: Adjust error checks to match name resolution 2.0 Arthur Cohen
                   ` (105 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

Workaround for Ubuntu 18.04, since we still use it for the GCC 4.8 CI.
The default Rust package is 1.65 (and unlikely to change I assume?),
but the generic format parser library uses `is_some_and` which was
introduced in 1.70. So this is a simple reimplementation, directly taken
from the standard library sources.

libgrust/ChangeLog:

	* libformat_parser/generic_format_parser/src/lib.rs: Add IsSomeAnd<T>
	trait, impl it for Option<T>.
---
 .../generic_format_parser/src/lib.rs             | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
index 6a366177f25..8062bf9e5ce 100644
--- a/libgrust/libformat_parser/generic_format_parser/src/lib.rs
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -22,6 +22,22 @@ fn is_id_continue(c: char) -> bool {
     unicode_xid::UnicodeXID::is_xid_continue(c)
 }
 
+// Workaround for Ubuntu 18.04. The default Rust package is 1.65 (and unlikely to change I assume?), but the
+// generic format parser library uses `is_some_and` which was introduced in 1.70. So this is a reimplementation,
+// directly taken from the standard library sources
+trait IsSomeAnd<T> {
+    fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool;
+}
+
+impl<T> IsSomeAnd<T> for Option<T> {
+    fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
+        match self {
+            None => false,
+            Some(x) => f(x),
+        }
+    }
+}
+
 // use rustc_lexer::unescape;
 pub use Alignment::*;
 pub use Count::*;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 020/125] gccrs: Adjust error checks to match name resolution 2.0
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (17 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 019/125] gccrs: format-parser: Add `is_some_and` method for Option<T> Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 021/125] gccrs: Fix small FixMe task in rust macro builtins Arthur Cohen
                   ` (104 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/testsuite/ChangeLog:

	* rust/compile/bad_stmt_enums.rs: Adjust redefinition error.
	* rust/compile/bad_toplevel_enums.rs: Likewise.
	* rust/compile/redef_error1.rs: Likewise.
	* rust/compile/redef_error3.rs: Likewise.
	* rust/compile/redef_error4.rs: Likewise.
	* rust/compile/redef_error6.rs: Likewise.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/testsuite/rust/compile/bad_stmt_enums.rs     | 6 +++---
 gcc/testsuite/rust/compile/bad_toplevel_enums.rs | 6 +++---
 gcc/testsuite/rust/compile/redef_error1.rs       | 2 +-
 gcc/testsuite/rust/compile/redef_error3.rs       | 2 +-
 gcc/testsuite/rust/compile/redef_error4.rs       | 2 +-
 gcc/testsuite/rust/compile/redef_error6.rs       | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gcc/testsuite/rust/compile/bad_stmt_enums.rs b/gcc/testsuite/rust/compile/bad_stmt_enums.rs
index 7b09a94fd27..b83137f96b8 100644
--- a/gcc/testsuite/rust/compile/bad_stmt_enums.rs
+++ b/gcc/testsuite/rust/compile/bad_stmt_enums.rs
@@ -5,17 +5,17 @@ fn main ()
       Alpha { alpha: i32 },
       pub Beta (u8),
       pub Gamma,
-      Gamma { gamma: u32 } // { dg-error "redefined" }
+      Gamma { gamma: u32 } // { dg-error "defined multiple times" }
     }
 
   struct EE2 { }
-  enum EE2 { } // { dg-error "redefined" }
+  enum EE2 { } // { dg-error "defined multiple times" }
 
   enum EE1
     {
       pub Alpha,
       Beta = 41,
-      Beta = 42, // { dg-error "redefined" }
+      Beta = 42, // { dg-error "defined multiple times" }
       pub Gamma = 3,
       D,
     }
diff --git a/gcc/testsuite/rust/compile/bad_toplevel_enums.rs b/gcc/testsuite/rust/compile/bad_toplevel_enums.rs
index b655e30a93d..137095bf00c 100644
--- a/gcc/testsuite/rust/compile/bad_toplevel_enums.rs
+++ b/gcc/testsuite/rust/compile/bad_toplevel_enums.rs
@@ -3,17 +3,17 @@ pub enum E
   pub A { a: i32 },
   B (u8),
   pub C,
-  B // { dg-error "redefined" }
+  B // { dg-error "defined multiple times" }
 }
 
 enum E2 { }
-struct E2 { } // { dg-error "redefined" }
+struct E2 { } // { dg-error "defined multiple times" }
 
 enum E1
 {
   A,
   pub B = 42,
   C = 3,
-  A { a: u8 }, // { dg-error "redefined" }
+  A { a: u8 }, // { dg-error "defined multiple times" }
   pub D
 }
diff --git a/gcc/testsuite/rust/compile/redef_error1.rs b/gcc/testsuite/rust/compile/redef_error1.rs
index ae51e36c87f..5a85f1e50fe 100644
--- a/gcc/testsuite/rust/compile/redef_error1.rs
+++ b/gcc/testsuite/rust/compile/redef_error1.rs
@@ -3,6 +3,6 @@ struct S1 {
     y: f64,
 }
 
-struct S1(i32, bool); // { dg-error "redefined multiple times" }
+struct S1(i32, bool); // { dg-error "defined multiple times" }
 
 fn main() {}
diff --git a/gcc/testsuite/rust/compile/redef_error3.rs b/gcc/testsuite/rust/compile/redef_error3.rs
index a4bf1ed3d8c..cc1cceba8bb 100644
--- a/gcc/testsuite/rust/compile/redef_error3.rs
+++ b/gcc/testsuite/rust/compile/redef_error3.rs
@@ -2,7 +2,7 @@ fn test() -> bool {
     true
 }
 
-fn test() -> i32 { // { dg-error "redefined multiple times" }
+fn test() -> i32 { // { dg-error "defined multiple times" }
     123
 }
 
diff --git a/gcc/testsuite/rust/compile/redef_error4.rs b/gcc/testsuite/rust/compile/redef_error4.rs
index a250c0ac00e..3faebb75abe 100644
--- a/gcc/testsuite/rust/compile/redef_error4.rs
+++ b/gcc/testsuite/rust/compile/redef_error4.rs
@@ -9,7 +9,7 @@ impl Foo {
         test()
     }
 
-    fn test() -> bool { // { dg-error "redefined multiple times" }
+    fn test() -> bool { // { dg-error "defined multiple times" }
         true
     }
 }
diff --git a/gcc/testsuite/rust/compile/redef_error6.rs b/gcc/testsuite/rust/compile/redef_error6.rs
index 664c6ae9894..f7f688b5f36 100644
--- a/gcc/testsuite/rust/compile/redef_error6.rs
+++ b/gcc/testsuite/rust/compile/redef_error6.rs
@@ -5,7 +5,7 @@ impl Foo<i32> {
         123
     }
 
-    fn test(self) -> i32 { // { dg-error "redefined multiple times" }
+    fn test(self) -> i32 { // { dg-error "defined multiple times" }
         self.0
     }
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 021/125] gccrs: Fix small FixMe task in rust macro builtins
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (18 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 020/125] gccrs: Adjust error checks to match name resolution 2.0 Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 022/125] gccrs: lang-items: Cleanup parsing and lookups of lang items Arthur Cohen
                   ` (103 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, jjasmine

From: jjasmine <tanghocle456@gmail.com>

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc: Change BuiltinMacro in
	builtin_macro_from_string to tl::optional<>
	* expand/rust-macro-builtins.h (enum class): Change BuiltinMacro
	in builtin_macro_from_string to tl::optional<>
	* resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit):
	Resolved wrong type dependency of builtin_macro_from_string

Signed-off-by: jjasmine <tanghocle456@gmail.com>
---
 gcc/rust/expand/rust-macro-builtins.cc       | 3 +--
 gcc/rust/expand/rust-macro-builtins.h        | 2 +-
 gcc/rust/resolve/rust-early-name-resolver.cc | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 2af05a5e377..f103759acdd 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -126,8 +126,7 @@ std::unordered_map<std::string, AST::MacroTranscriberFunc>
     {"Hash", MacroBuiltin::proc_macro_builtin},
 };
 
-// FIXME: This should return an tl::optional
-BuiltinMacro
+tl::optional<BuiltinMacro>
 builtin_macro_from_string (const std::string &identifier)
 {
   auto macro = MacroBuiltin::builtins.lookup (identifier);
diff --git a/gcc/rust/expand/rust-macro-builtins.h b/gcc/rust/expand/rust-macro-builtins.h
index f9ab3fc3698..1d6b30b5933 100644
--- a/gcc/rust/expand/rust-macro-builtins.h
+++ b/gcc/rust/expand/rust-macro-builtins.h
@@ -75,7 +75,7 @@ enum class BuiltinMacro
   Hash,
 };
 
-BuiltinMacro
+tl::optional<BuiltinMacro>
 builtin_macro_from_string (const std::string &identifier);
 
 /**
diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc
index 422dd92e462..d70f9ca9806 100644
--- a/gcc/rust/resolve/rust-early-name-resolver.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver.cc
@@ -497,7 +497,7 @@ EarlyNameResolver::visit (AST::MacroInvocation &invoc)
     {
       auto builtin_kind
 	= builtin_macro_from_string (rules_def->get_rule_name ().as_string ());
-      invoc.map_to_builtin (builtin_kind);
+      invoc.map_to_builtin (builtin_kind.value ());
     }
 
   auto attributes = rules_def->get_outer_attrs ();
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 022/125] gccrs: lang-items: Cleanup parsing and lookups of lang items.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (19 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 021/125] gccrs: Fix small FixMe task in rust macro builtins Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 023/125] gccrs: lang-items: Make lang items enum stronger, rename class, cleanup ns Arthur Cohen
                   ` (102 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* Make-lang.in: Compile new rust-lang-item.o.
	* util/rust-lang-item.h: Split into header and source.
	* util/rust-lang-item.cc: Cleanup parsing of lang items by using a hashmap
	and returning optional values, cleanup handling of exhaustive lang item
	lookups.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_lang_item_attribute): Use
	new optional API.
---
 gcc/rust/Make-lang.in               |   1 +
 gcc/rust/hir/rust-ast-lower-base.cc |  13 +-
 gcc/rust/util/rust-lang-item.cc     | 191 +++++++++++
 gcc/rust/util/rust-lang-item.h      | 508 +---------------------------
 4 files changed, 206 insertions(+), 507 deletions(-)
 create mode 100644 gcc/rust/util/rust-lang-item.cc

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index baf55161d78..af5d775a3a6 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -203,6 +203,7 @@ GRS_OBJS = \
     rust/rust-dir-owner.o \
     rust/rust-unicode.o \
     rust/rust-punycode.o \
+	rust/rust-lang-item.o \
     $(END)
 # removed object files from here
 
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index 3ff0f52e0c6..815b98f9f0a 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -789,13 +789,12 @@ ASTLoweringBase::handle_lang_item_attribute (const ItemWrapper &item,
   auto &literal = static_cast<AST::AttrInputLiteral &> (attr.get_attr_input ());
   const auto &lang_item_type_str = literal.get_literal ().as_string ();
   auto lang_item_type = Analysis::RustLangItem::Parse (lang_item_type_str);
-  if (lang_item_type == Analysis::RustLangItem::ItemType::UNKNOWN)
-    {
-      rust_error_at (attr.get_locus (), "unknown lang item");
-      return;
-    }
-  mappings->insert_lang_item (lang_item_type,
-			      item.get_mappings ().get_defid ());
+
+  if (lang_item_type)
+    mappings->insert_lang_item (*lang_item_type,
+				item.get_mappings ().get_defid ());
+  else
+    rust_error_at (attr.get_locus (), "unknown lang item");
 }
 
 bool
diff --git a/gcc/rust/util/rust-lang-item.cc b/gcc/rust/util/rust-lang-item.cc
new file mode 100644
index 00000000000..9fe212d412d
--- /dev/null
+++ b/gcc/rust/util/rust-lang-item.cc
@@ -0,0 +1,191 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-lang-item.h"
+#include "rust-system.h"
+
+namespace Rust {
+namespace Analysis {
+
+const BiMap<std::string, RustLangItem::ItemType>
+  Rust::Analysis::RustLangItem::lang_items = {{
+    {"add", ADD},
+    {"sub", SUBTRACT},
+    {"mul", MULTIPLY},
+    {"div", DIVIDE},
+    {"rem", REMAINDER},
+    {"bitand", BITAND},
+    {"bitor", BITOR},
+    {"bitxor", BITXOR},
+    {"shl", SHL},
+    {"shr", SHR},
+    {"neg", NEGATION},
+    {"not", NOT},
+    {"add_assign", ADD_ASSIGN},
+    {"sub_assign", SUB_ASSIGN},
+    {"mul_assign", MUL_ASSIGN},
+    {"div_assign", DIV_ASSIGN},
+    {"rem_assign", REM_ASSIGN},
+    {"bitand_assign", BITAND_ASSIGN},
+    {"bitor_assign", BITOR_ASSIGN},
+    {"bitxor_assign", BITXOR_ASSIGN},
+    {"shl_assign", SHL_ASSIGN},
+    {"shr_assign", SHR_ASSIGN},
+    {"deref", DEREF},
+    {"deref_mut", DEREF_MUT},
+    {"index", INDEX},
+    {"index_mut", INDEX_MUT},
+    {"RangeFull", RANGE_FULL},
+    {"Range", RANGE},
+    {"RangeFrom", RANGE_FROM},
+    {"RangeTo", RANGE_TO},
+    {"RangeInclusive", RANGE_INCLUSIVE},
+    {"RangeToInclusive", RANGE_TO_INCLUSIVE},
+    {"phantom_data", PHANTOM_DATA},
+    {"fn", FN},
+    {"fn_mut", FN_MUT},
+    {"fn_once", FN_ONCE},
+    {"fn_once_output", FN_ONCE_OUTPUT},
+    {"copy", COPY},
+    {"clone", CLONE},
+    {"sized", SIZED},
+    {"slice_alloc", SLICE_ALLOC},
+    {"slice_u8_alloc", SLICE_U8_ALLOC},
+    {"str_alloc", STR_ALLOC},
+    {"array", ARRAY},
+    {"bool", BOOL},
+    {"char", CHAR},
+    {"f32", F32},
+    {"f64", F64},
+    {"i8", I8},
+    {"i16", I16},
+    {"i32", I32},
+    {"i64", I64},
+    {"i128", I128},
+    {"isize", ISIZE},
+    {"u8", U8},
+    {"u16", U16},
+    {"u32", U32},
+    {"u64", U64},
+    {"u128", U128},
+    {"usize", USIZE},
+    {"const_ptr", CONST_PTR},
+    {"const_slice_ptr", CONST_SLICE_PTR},
+    {"mut_ptr", MUT_PTR},
+    {"mut_slice_ptr", MUT_SLICE_PTR},
+    {"slice_u8", SLICE_U8},
+    {"slice", SLICE},
+    {"str", STR},
+    {"f32_runtime", F32_RUNTIME},
+    {"f64_runtime", F64_RUNTIME},
+  }};
+
+tl::optional<RustLangItem::ItemType>
+RustLangItem::Parse (const std::string &item)
+{
+  auto lang_item = RustLangItem::lang_items.lookup (item);
+  if (!RustLangItem::lang_items.is_iter_ok (lang_item))
+    return tl::nullopt;
+
+  return lang_item->second;
+}
+
+std::string
+RustLangItem::ToString (RustLangItem::ItemType type)
+{
+  auto str = RustLangItem::lang_items.lookup (type);
+  return str->second;
+}
+
+RustLangItem::ItemType
+RustLangItem::OperatorToLangItem (ArithmeticOrLogicalOperator op)
+{
+  switch (op)
+    {
+    case ArithmeticOrLogicalOperator::ADD:
+      return RustLangItem::ItemType::ADD;
+    case ArithmeticOrLogicalOperator::SUBTRACT:
+      return RustLangItem::ItemType::SUBTRACT;
+    case ArithmeticOrLogicalOperator::MULTIPLY:
+      return RustLangItem::ItemType::MULTIPLY;
+    case ArithmeticOrLogicalOperator::DIVIDE:
+      return RustLangItem::ItemType::DIVIDE;
+    case ArithmeticOrLogicalOperator::MODULUS:
+      return RustLangItem::ItemType::REMAINDER;
+    case ArithmeticOrLogicalOperator::BITWISE_AND:
+      return RustLangItem::ItemType::BITAND;
+    case ArithmeticOrLogicalOperator::BITWISE_OR:
+      return RustLangItem::ItemType::BITOR;
+    case ArithmeticOrLogicalOperator::BITWISE_XOR:
+      return RustLangItem::ItemType::BITXOR;
+    case ArithmeticOrLogicalOperator::LEFT_SHIFT:
+      return RustLangItem::ItemType::SHL;
+    case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
+      return RustLangItem::ItemType::SHR;
+    }
+
+  rust_unreachable ();
+}
+
+RustLangItem::ItemType
+RustLangItem::CompoundAssignmentOperatorToLangItem (
+  ArithmeticOrLogicalOperator op)
+{
+  switch (op)
+    {
+    case ArithmeticOrLogicalOperator::ADD:
+      return RustLangItem::ItemType::ADD_ASSIGN;
+    case ArithmeticOrLogicalOperator::SUBTRACT:
+      return RustLangItem::ItemType::SUB_ASSIGN;
+    case ArithmeticOrLogicalOperator::MULTIPLY:
+      return RustLangItem::ItemType::MUL_ASSIGN;
+    case ArithmeticOrLogicalOperator::DIVIDE:
+      return RustLangItem::ItemType::DIV_ASSIGN;
+    case ArithmeticOrLogicalOperator::MODULUS:
+      return RustLangItem::ItemType::REM_ASSIGN;
+    case ArithmeticOrLogicalOperator::BITWISE_AND:
+      return RustLangItem::ItemType::BITAND_ASSIGN;
+    case ArithmeticOrLogicalOperator::BITWISE_OR:
+      return RustLangItem::ItemType::BITOR_ASSIGN;
+    case ArithmeticOrLogicalOperator::BITWISE_XOR:
+      return RustLangItem::ItemType::BITXOR_ASSIGN;
+    case ArithmeticOrLogicalOperator::LEFT_SHIFT:
+      return RustLangItem::ItemType::SHL_ASSIGN;
+    case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
+      return RustLangItem::ItemType::SHR_ASSIGN;
+    }
+
+  rust_unreachable ();
+}
+
+RustLangItem::ItemType
+RustLangItem::NegationOperatorToLangItem (NegationOperator op)
+{
+  switch (op)
+    {
+    case NegationOperator::NEGATE:
+      return RustLangItem::ItemType::NEGATION;
+    case NegationOperator::NOT:
+      return RustLangItem::ItemType::NOT;
+    }
+
+  rust_unreachable ();
+}
+
+} // namespace Analysis
+} // namespace Rust
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index 86323d9e267..3447e3680c8 100644
--- a/gcc/rust/util/rust-lang-item.h
+++ b/gcc/rust/util/rust-lang-item.h
@@ -18,6 +18,8 @@
 
 #include "rust-system.h"
 #include "rust-operators.h"
+#include "optional.h"
+#include "bi-map.h"
 
 namespace Rust {
 namespace Analysis {
@@ -115,510 +117,16 @@ public:
     STR,
     F32_RUNTIME,
     F64_RUNTIME,
-
-    // delimiter
-    UNKNOWN,
   };
 
-  static ItemType Parse (const std::string &item)
-  {
-    if (item.compare ("add") == 0)
-      {
-	return ItemType::ADD;
-      }
-    else if (item.compare ("sub") == 0)
-      {
-	return ItemType::SUBTRACT;
-      }
-    else if (item.compare ("mul") == 0)
-      {
-	return ItemType::MULTIPLY;
-      }
-    else if (item.compare ("div") == 0)
-      {
-	return ItemType::DIVIDE;
-      }
-    else if (item.compare ("rem") == 0)
-      {
-	return ItemType::REMAINDER;
-      }
-    else if (item.compare ("bitand") == 0)
-      {
-	return ItemType::BITAND;
-      }
-    else if (item.compare ("bitor") == 0)
-      {
-	return ItemType::BITOR;
-      }
-    else if (item.compare ("bitxor") == 0)
-      {
-	return ItemType::BITXOR;
-      }
-    else if (item.compare ("shl") == 0)
-      {
-	return ItemType::SHL;
-      }
-    else if (item.compare ("shr") == 0)
-      {
-	return ItemType::SHR;
-      }
-    else if (item.compare ("neg") == 0)
-      {
-	return ItemType::NEGATION;
-      }
-    else if (item.compare ("not") == 0)
-      {
-	return ItemType::NOT;
-      }
-    else if (item.compare ("add_assign") == 0)
-      {
-	return ItemType::ADD_ASSIGN;
-      }
-    else if (item.compare ("sub_assign") == 0)
-      {
-	return ItemType::SUB_ASSIGN;
-      }
-    else if (item.compare ("mul_assign") == 0)
-      {
-	return ItemType::MUL_ASSIGN;
-      }
-    else if (item.compare ("div_assign") == 0)
-      {
-	return ItemType::DIV_ASSIGN;
-      }
-    else if (item.compare ("rem_assign") == 0)
-      {
-	return ItemType::REM_ASSIGN;
-      }
-    else if (item.compare ("bitand_assign") == 0)
-      {
-	return ItemType::BITAND_ASSIGN;
-      }
-    else if (item.compare ("bitor_assign") == 0)
-      {
-	return ItemType::BITOR_ASSIGN;
-      }
-    else if (item.compare ("bitxor_assign") == 0)
-      {
-	return ItemType::BITXOR_ASSIGN;
-      }
-    else if (item.compare ("shl_assign") == 0)
-      {
-	return ItemType::SHL_ASSIGN;
-      }
-    else if (item.compare ("shr_assign") == 0)
-      {
-	return ItemType::SHR_ASSIGN;
-      }
-    else if (item.compare ("deref") == 0)
-      {
-	return ItemType::DEREF;
-      }
-    else if (item.compare ("deref_mut") == 0)
-      {
-	return ItemType::DEREF_MUT;
-      }
-    else if (item.compare ("index") == 0)
-      {
-	return ItemType::INDEX;
-      }
-    else if (item.compare ("index_mut") == 0)
-      {
-	return ItemType::INDEX_MUT;
-      }
-    else if (item.compare ("RangeFull") == 0)
-      {
-	return ItemType::RANGE_FULL;
-      }
-    else if (item.compare ("Range") == 0)
-      {
-	return ItemType::RANGE;
-      }
-    else if (item.compare ("RangeFrom") == 0)
-      {
-	return ItemType::RANGE_FROM;
-      }
-    else if (item.compare ("RangeTo") == 0)
-      {
-	return ItemType::RANGE_TO;
-      }
-    else if (item.compare ("RangeInclusive") == 0)
-      {
-	return ItemType::RANGE_INCLUSIVE;
-      }
-    else if (item.compare ("RangeToInclusive") == 0)
-      {
-	return ItemType::RANGE_TO_INCLUSIVE;
-      }
-    else if (item.compare ("phantom_data") == 0)
-      {
-	return ItemType::PHANTOM_DATA;
-      }
-    else if (item.compare ("fn") == 0)
-      {
-	return ItemType::FN;
-      }
-    else if (item.compare ("fn_mut") == 0)
-      {
-	return ItemType::FN_MUT;
-      }
-    else if (item.compare ("fn_once") == 0)
-      {
-	return ItemType::FN_ONCE;
-      }
-    else if (item.compare ("fn_once_output") == 0)
-      {
-	return ItemType::FN_ONCE_OUTPUT;
-      }
-    else if (item.compare ("copy") == 0)
-      {
-	return ItemType::COPY;
-      }
-    else if (item.compare ("clone") == 0)
-      {
-	return ItemType::CLONE;
-      }
-    else if (item.compare ("sized") == 0)
-      {
-	return ItemType::SIZED;
-      }
-    else if (item.compare ("slice_alloc") == 0)
-      {
-	return ItemType::SLICE_ALLOC;
-      }
-    else if (item.compare ("slice_u8_alloc") == 0)
-      {
-	return ItemType::SLICE_U8_ALLOC;
-      }
-    else if (item.compare ("str_alloc") == 0)
-      {
-	return ItemType::STR_ALLOC;
-      }
-    else if (item.compare ("array") == 0)
-      {
-	return ItemType::ARRAY;
-      }
-    else if (item.compare ("bool") == 0)
-      {
-	return ItemType::BOOL;
-      }
-    else if (item.compare ("char") == 0)
-      {
-	return ItemType::CHAR;
-      }
-    else if (item.compare ("f32") == 0)
-      {
-	return ItemType::F32;
-      }
-    else if (item.compare ("f64") == 0)
-      {
-	return ItemType::F64;
-      }
-    else if (item.compare ("i8") == 0)
-      {
-	return ItemType::I8;
-      }
-    else if (item.compare ("i16") == 0)
-      {
-	return ItemType::I16;
-      }
-    else if (item.compare ("i32") == 0)
-      {
-	return ItemType::I32;
-      }
-    else if (item.compare ("i64") == 0)
-      {
-	return ItemType::I64;
-      }
-    else if (item.compare ("i128") == 0)
-      {
-	return ItemType::I128;
-      }
-    else if (item.compare ("isize") == 0)
-      {
-	return ItemType::ISIZE;
-      }
-    else if (item.compare ("u8") == 0)
-      {
-	return ItemType::U8;
-      }
-    else if (item.compare ("u16") == 0)
-      {
-	return ItemType::U16;
-      }
-    else if (item.compare ("u32") == 0)
-      {
-	return ItemType::U32;
-      }
-    else if (item.compare ("u64") == 0)
-      {
-	return ItemType::U64;
-      }
-    else if (item.compare ("u128") == 0)
-      {
-	return ItemType::U128;
-      }
-    else if (item.compare ("usize") == 0)
-      {
-	return ItemType::USIZE;
-      }
-    else if (item.compare ("const_ptr") == 0)
-      {
-	return ItemType::CONST_PTR;
-      }
-    else if (item.compare ("const_slice_ptr") == 0)
-      {
-	return ItemType::CONST_SLICE_PTR;
-      }
-    else if (item.compare ("mut_ptr") == 0)
-      {
-	return ItemType::MUT_PTR;
-      }
-    else if (item.compare ("mut_slice_ptr") == 0)
-      {
-	return ItemType::MUT_SLICE_PTR;
-      }
-    else if (item.compare ("slice_u8") == 0)
-      {
-	return ItemType::SLICE_U8;
-      }
-    else if (item.compare ("slice") == 0)
-      {
-	return ItemType::SLICE;
-      }
-    else if (item.compare ("str") == 0)
-      {
-	return ItemType::STR;
-      }
-    else if (item.compare ("f32_runtime") == 0)
-      {
-	return ItemType::F32_RUNTIME;
-      }
-    else if (item.compare ("f64_runtime") == 0)
-      {
-	return ItemType::F64_RUNTIME;
-      }
-
-    return ItemType::UNKNOWN;
-  }
-
-  static std::string ToString (ItemType type)
-  {
-    switch (type)
-      {
-      case ADD:
-	return "add";
-      case SUBTRACT:
-	return "sub";
-      case MULTIPLY:
-	return "mul";
-      case DIVIDE:
-	return "div";
-      case REMAINDER:
-	return "rem";
-      case BITAND:
-	return "bitand";
-      case BITOR:
-	return "bitor";
-      case BITXOR:
-	return "bitxor";
-      case SHL:
-	return "shl";
-      case SHR:
-	return "shr";
-      case NEGATION:
-	return "neg";
-      case NOT:
-	return "not";
-      case ADD_ASSIGN:
-	return "add_assign";
-      case SUB_ASSIGN:
-	return "sub_assign";
-      case MUL_ASSIGN:
-	return "mul_assign";
-      case DIV_ASSIGN:
-	return "div_assign";
-      case REM_ASSIGN:
-	return "rem_assign";
-      case BITAND_ASSIGN:
-	return "bitand_assign";
-      case BITOR_ASSIGN:
-	return "bitor_assign";
-      case BITXOR_ASSIGN:
-	return "bitxor_assign";
-      case SHL_ASSIGN:
-	return "shl_assign";
-      case SHR_ASSIGN:
-	return "shr_assign";
-      case DEREF:
-	return "deref";
-      case DEREF_MUT:
-	return "deref_mut";
-      case INDEX:
-	return "index";
-      case INDEX_MUT:
-	return "index_mut";
-      case RANGE_FULL:
-	return "RangeFull";
-      case RANGE:
-	return "Range";
-      case RANGE_FROM:
-	return "RangeFrom";
-      case RANGE_TO:
-	return "RangeTo";
-      case RANGE_INCLUSIVE:
-	return "RangeInclusive";
-      case RANGE_TO_INCLUSIVE:
-	return "RangeToInclusive";
-      case PHANTOM_DATA:
-	return "phantom_data";
-      case FN:
-	return "fn";
-      case FN_MUT:
-	return "fn_mut";
-      case FN_ONCE:
-	return "fn_once";
-      case FN_ONCE_OUTPUT:
-	return "fn_once_output";
-      case COPY:
-	return "copy";
-      case CLONE:
-	return "clone";
-      case SIZED:
-	return "sized";
-      case SLICE_ALLOC:
-	return "slice_alloc";
-      case SLICE_U8_ALLOC:
-	return "slice_u8_alloc";
-      case STR_ALLOC:
-	return "str_alloc";
-      case ARRAY:
-	return "array";
-      case BOOL:
-	return "bool";
-      case CHAR:
-	return "char";
-      case F32:
-	return "f32";
-      case F64:
-	return "f64";
-      case I8:
-	return "i8";
-      case I16:
-	return "i16";
-      case I32:
-	return "i32";
-      case I64:
-	return "i64";
-      case I128:
-	return "i128";
-      case ISIZE:
-	return "isize";
-      case U8:
-	return "u8";
-      case U16:
-	return "u16";
-      case U32:
-	return "u32";
-      case U64:
-	return "u64";
-      case U128:
-	return "u128";
-      case USIZE:
-	return "usize";
-      case CONST_PTR:
-	return "const_ptr";
-      case CONST_SLICE_PTR:
-	return "const_slice_ptr";
-      case MUT_PTR:
-	return "mut_ptr";
-      case MUT_SLICE_PTR:
-	return "mut_slice_ptr";
-      case SLICE_U8:
-	return "slice_u8";
-      case SLICE:
-	return "slice";
-      case STR:
-	return "str";
-      case F32_RUNTIME:
-	return "f32_runtime";
-      case F64_RUNTIME:
-	return "f64_runtime";
-
-      case UNKNOWN:
-	return "<UNKNOWN>";
-      }
-    return "<UNKNOWN>";
-  }
-
-  static ItemType OperatorToLangItem (ArithmeticOrLogicalOperator op)
-  {
-    switch (op)
-      {
-      case ArithmeticOrLogicalOperator::ADD:
-	return ItemType::ADD;
-      case ArithmeticOrLogicalOperator::SUBTRACT:
-	return ItemType::SUBTRACT;
-      case ArithmeticOrLogicalOperator::MULTIPLY:
-	return ItemType::MULTIPLY;
-      case ArithmeticOrLogicalOperator::DIVIDE:
-	return ItemType::DIVIDE;
-      case ArithmeticOrLogicalOperator::MODULUS:
-	return ItemType::REMAINDER;
-      case ArithmeticOrLogicalOperator::BITWISE_AND:
-	return ItemType::BITAND;
-      case ArithmeticOrLogicalOperator::BITWISE_OR:
-	return ItemType::BITOR;
-      case ArithmeticOrLogicalOperator::BITWISE_XOR:
-	return ItemType::BITXOR;
-      case ArithmeticOrLogicalOperator::LEFT_SHIFT:
-	return ItemType::SHL;
-      case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
-	return ItemType::SHR;
-      }
-    return ItemType::UNKNOWN;
-  }
+  static const BiMap<std::string, ItemType> lang_items;
 
+  static tl::optional<ItemType> Parse (const std::string &item);
+  static std::string ToString (ItemType type);
+  static ItemType OperatorToLangItem (ArithmeticOrLogicalOperator op);
   static ItemType
-  CompoundAssignmentOperatorToLangItem (ArithmeticOrLogicalOperator op)
-  {
-    switch (op)
-      {
-      case ArithmeticOrLogicalOperator::ADD:
-	return ItemType::ADD_ASSIGN;
-      case ArithmeticOrLogicalOperator::SUBTRACT:
-	return ItemType::SUB_ASSIGN;
-      case ArithmeticOrLogicalOperator::MULTIPLY:
-	return ItemType::MUL_ASSIGN;
-      case ArithmeticOrLogicalOperator::DIVIDE:
-	return ItemType::DIV_ASSIGN;
-      case ArithmeticOrLogicalOperator::MODULUS:
-	return ItemType::REM_ASSIGN;
-      case ArithmeticOrLogicalOperator::BITWISE_AND:
-	return ItemType::BITAND_ASSIGN;
-      case ArithmeticOrLogicalOperator::BITWISE_OR:
-	return ItemType::BITOR_ASSIGN;
-      case ArithmeticOrLogicalOperator::BITWISE_XOR:
-	return ItemType::BITXOR_ASSIGN;
-      case ArithmeticOrLogicalOperator::LEFT_SHIFT:
-	return ItemType::SHL_ASSIGN;
-      case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
-	return ItemType::SHR_ASSIGN;
-      }
-    return ItemType::UNKNOWN;
-  }
-
-  static ItemType NegationOperatorToLangItem (NegationOperator op)
-  {
-    switch (op)
-      {
-      case NegationOperator::NEGATE:
-	return ItemType::NEGATION;
-      case NegationOperator::NOT:
-	return ItemType::NOT;
-      }
-    return ItemType::UNKNOWN;
-  }
+  CompoundAssignmentOperatorToLangItem (ArithmeticOrLogicalOperator op);
+  static ItemType NegationOperatorToLangItem (NegationOperator op);
 };
 
 } // namespace Analysis
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 023/125] gccrs: lang-items: Make lang items enum stronger, rename class, cleanup ns.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (20 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 022/125] gccrs: lang-items: Cleanup parsing and lookups of lang items Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 024/125] gccrs: extern-types: Declare external types in name resolver Arthur Cohen
                   ` (101 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* util/rust-lang-item.h (class RustLangItem): Renamed to...
	(class LangItem): ...this. Rename ItemType enum to Kind
	* util/rust-lang-item.cc: Rename methods to use new class name.
	* backend/rust-compile-expr.cc (CompileExpr::visit): Use new lang-item API.
	(CompileExpr::resolve_operator_overload): Likewise.
	* backend/rust-compile-expr.h: Likewise.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_lang_item_attribute): Likewise.
	* typecheck/rust-autoderef.cc (Adjuster::try_deref_type): Likewise.
	(AutoderefCycle::cycle): Likewise.
	* typecheck/rust-autoderef.h: Likewise.
	* typecheck/rust-hir-type-bounds.h: Likewise.
	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate): Likewise.
	* typecheck/rust-hir-type-check-base.h: Likewise.
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
	* typecheck/rust-hir-type-check-expr.h: Likewise.
	* typecheck/rust-hir-type-check-type.cc (TypeResolveGenericParam::visit): Likewise.
	* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): Likewise.
	(TypeBoundsProbe::assemble_builtin_candidate): Likewise.
	(TypeCheckBase::get_predicate_from_bound): Likewise.
	* typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
	* util/rust-hir-map.cc (Mappings::get_lang_item): Likewise.
	(Mappings::lookup_trait_item_lang_item): Likewise.
	* util/rust-hir-map.h: Likewise.
---
 gcc/rust/backend/rust-compile-expr.cc         |  24 +-
 gcc/rust/backend/rust-compile-expr.h          |   8 +-
 gcc/rust/hir/rust-ast-lower-base.cc           |   2 +-
 gcc/rust/typecheck/rust-autoderef.cc          |  22 +-
 gcc/rust/typecheck/rust-autoderef.h           |   5 +-
 gcc/rust/typecheck/rust-hir-type-bounds.h     |   2 +-
 .../typecheck/rust-hir-type-check-base.cc     |   3 +-
 gcc/rust/typecheck/rust-hir-type-check-base.h |   5 +-
 .../typecheck/rust-hir-type-check-expr.cc     |  72 +++---
 gcc/rust/typecheck/rust-hir-type-check-expr.h |   7 +-
 .../typecheck/rust-hir-type-check-type.cc     |   3 +-
 gcc/rust/typecheck/rust-tyty-bounds.cc        |  12 +-
 gcc/rust/typecheck/rust-tyty.cc               |   5 +-
 gcc/rust/util/rust-hir-map.cc                 |   7 +-
 gcc/rust/util/rust-hir-map.h                  |  13 +-
 gcc/rust/util/rust-lang-item.cc               | 218 +++++++++---------
 gcc/rust/util/rust-lang-item.h                |  31 ++-
 17 files changed, 213 insertions(+), 226 deletions(-)

diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 596b848849e..65de24bf9d8 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -150,7 +150,7 @@ CompileExpr::visit (HIR::ArithmeticOrLogicalExpr &expr)
   if (is_op_overload)
     {
       auto lang_item_type
-	= Analysis::RustLangItem::OperatorToLangItem (expr.get_expr_type ());
+	= LangItem::OperatorToLangItem (expr.get_expr_type ());
       translated = resolve_operator_overload (lang_item_type, expr, lhs, rhs,
 					      expr.get_lhs ().get (),
 					      expr.get_rhs ().get ());
@@ -193,9 +193,8 @@ CompileExpr::visit (HIR::CompoundAssignmentExpr &expr)
     expr.get_mappings ().get_hirid (), &fntype);
   if (is_op_overload)
     {
-      auto lang_item_type
-	= Analysis::RustLangItem::CompoundAssignmentOperatorToLangItem (
-	  expr.get_expr_type ());
+      auto lang_item_type = LangItem::CompoundAssignmentOperatorToLangItem (
+	expr.get_expr_type ());
       auto compound_assignment
 	= resolve_operator_overload (lang_item_type, expr, lhs, rhs,
 				     expr.get_lhs ().get (),
@@ -244,8 +243,7 @@ CompileExpr::visit (HIR::NegationExpr &expr)
     expr.get_mappings ().get_hirid (), &fntype);
   if (is_op_overload)
     {
-      auto lang_item_type
-	= Analysis::RustLangItem::NegationOperatorToLangItem (op);
+      auto lang_item_type = LangItem::NegationOperatorToLangItem (op);
       translated
 	= resolve_operator_overload (lang_item_type, expr, negated_expr,
 				     nullptr, expr.get_expr ().get (), nullptr);
@@ -836,7 +834,7 @@ CompileExpr::visit (HIR::DereferenceExpr &expr)
     expr.get_mappings ().get_hirid (), &fntype);
   if (is_op_overload)
     {
-      auto lang_item_type = Analysis::RustLangItem::ItemType::DEREF;
+      auto lang_item_type = LangItem::Kind::DEREF;
       tree operator_overload_call
 	= resolve_operator_overload (lang_item_type, expr, main_expr, nullptr,
 				     expr.get_expr ().get (), nullptr);
@@ -1423,9 +1421,10 @@ CompileExpr::get_receiver_from_dyn (const TyTy::DynamicObjectType *dyn,
 }
 
 tree
-CompileExpr::resolve_operator_overload (
-  Analysis::RustLangItem::ItemType lang_item_type, HIR::OperatorExprMeta expr,
-  tree lhs, tree rhs, HIR::Expr *lhs_expr, HIR::Expr *rhs_expr)
+CompileExpr::resolve_operator_overload (LangItem::Kind lang_item_type,
+					HIR::OperatorExprMeta expr, tree lhs,
+					tree rhs, HIR::Expr *lhs_expr,
+					HIR::Expr *rhs_expr)
 {
   TyTy::FnType *fntype;
   bool is_op_overload = ctx->get_tyctx ()->lookup_operator_overload (
@@ -1446,8 +1445,7 @@ CompileExpr::resolve_operator_overload (
     }
 
   // lookup compiled functions since it may have already been compiled
-  HIR::PathIdentSegment segment_name (
-    Analysis::RustLangItem::ToString (lang_item_type));
+  HIR::PathIdentSegment segment_name (LangItem::ToString (lang_item_type));
   tree fn_expr = resolve_method_address (fntype, receiver, expr.get_locus ());
 
   // lookup the autoderef mappings
@@ -2120,7 +2118,7 @@ CompileExpr::visit (HIR::ArrayIndexExpr &expr)
     expr.get_mappings ().get_hirid (), &fntype);
   if (is_op_overload)
     {
-      auto lang_item_type = Analysis::RustLangItem::ItemType::INDEX;
+      auto lang_item_type = LangItem::Kind::INDEX;
       tree operator_overload_call
 	= resolve_operator_overload (lang_item_type, expr, array_reference,
 				     index, expr.get_array_expr ().get (),
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index e947825c2a9..af2e1bca1ec 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -97,10 +97,10 @@ protected:
 			      TyTy::BaseType *receiver, TyTy::FnType *fntype,
 			      tree receiver_ref, location_t expr_locus);
 
-  tree
-  resolve_operator_overload (Analysis::RustLangItem::ItemType lang_item_type,
-			     HIR::OperatorExprMeta expr, tree lhs, tree rhs,
-			     HIR::Expr *lhs_expr, HIR::Expr *rhs_expr);
+  tree resolve_operator_overload (LangItem::Kind lang_item_type,
+				  HIR::OperatorExprMeta expr, tree lhs,
+				  tree rhs, HIR::Expr *lhs_expr,
+				  HIR::Expr *rhs_expr);
 
   tree compile_bool_literal (const HIR::LiteralExpr &expr,
 			     const TyTy::BaseType *tyty);
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index 815b98f9f0a..bcc4797df77 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -788,7 +788,7 @@ ASTLoweringBase::handle_lang_item_attribute (const ItemWrapper &item,
 {
   auto &literal = static_cast<AST::AttrInputLiteral &> (attr.get_attr_input ());
   const auto &lang_item_type_str = literal.get_literal ().as_string ();
-  auto lang_item_type = Analysis::RustLangItem::Parse (lang_item_type_str);
+  auto lang_item_type = LangItem::Parse (lang_item_type_str);
 
   if (lang_item_type)
     mappings->insert_lang_item (*lang_item_type,
diff --git a/gcc/rust/typecheck/rust-autoderef.cc b/gcc/rust/typecheck/rust-autoderef.cc
index 9966c5469c5..232ee6130c9 100644
--- a/gcc/rust/typecheck/rust-autoderef.cc
+++ b/gcc/rust/typecheck/rust-autoderef.cc
@@ -28,8 +28,7 @@ namespace Resolver {
 
 static bool
 resolve_operator_overload_fn (
-  Analysis::RustLangItem::ItemType lang_item_type, TyTy::BaseType *ty,
-  TyTy::FnType **resolved_fn,
+  LangItem::Kind lang_item_type, TyTy::BaseType *ty, TyTy::FnType **resolved_fn,
   Adjustment::AdjustmentType *requires_ref_adjustment);
 
 TyTy::BaseType *
@@ -42,8 +41,7 @@ Adjuster::adjust_type (const std::vector<Adjustment> &adjustments)
 }
 
 Adjustment
-Adjuster::try_deref_type (TyTy::BaseType *ty,
-			  Analysis::RustLangItem::ItemType deref_lang_item)
+Adjuster::try_deref_type (TyTy::BaseType *ty, LangItem::Kind deref_lang_item)
 {
   TyTy::FnType *fn = nullptr;
   Adjustment::AdjustmentType requires_ref_adjustment
@@ -68,11 +66,11 @@ Adjuster::try_deref_type (TyTy::BaseType *ty,
     = Adjustment::AdjustmentType::ERROR;
   switch (deref_lang_item)
     {
-    case Analysis::RustLangItem::ItemType::DEREF:
+    case LangItem::Kind::DEREF:
       adjustment_type = Adjustment::AdjustmentType::DEREF;
       break;
 
-    case Analysis::RustLangItem::ItemType::DEREF_MUT:
+    case LangItem::Kind::DEREF_MUT:
       adjustment_type = Adjustment::AdjustmentType::DEREF_MUT;
       break;
 
@@ -122,7 +120,7 @@ Adjuster::try_unsize_type (TyTy::BaseType *ty)
 
 static bool
 resolve_operator_overload_fn (
-  Analysis::RustLangItem::ItemType lang_item_type, TyTy::BaseType *lhs,
+  LangItem::Kind lang_item_type, TyTy::BaseType *lhs,
   TyTy::FnType **resolved_fn,
   Adjustment::AdjustmentType *requires_ref_adjustment)
 {
@@ -130,8 +128,7 @@ resolve_operator_overload_fn (
   auto mappings = Analysis::Mappings::get ();
 
   // look up lang item for arithmetic type
-  std::string associated_item_name
-    = Analysis::RustLangItem::ToString (lang_item_type);
+  std::string associated_item_name = LangItem::ToString (lang_item_type);
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
     = mappings->lookup_lang_item (lang_item_type, &respective_lang_item_id);
@@ -359,8 +356,7 @@ AutoderefCycle::cycle (TyTy::BaseType *receiver)
 	  return false;
 	}
 
-      Adjustment deref
-	= Adjuster::try_deref_type (r, Analysis::RustLangItem::ItemType::DEREF);
+      Adjustment deref = Adjuster::try_deref_type (r, LangItem::Kind::DEREF);
       if (!deref.is_error ())
 	{
 	  auto deref_r = deref.get_expected ();
@@ -374,8 +370,8 @@ AutoderefCycle::cycle (TyTy::BaseType *receiver)
 	  adjustments.pop_back ();
 	}
 
-      Adjustment deref_mut = Adjuster::try_deref_type (
-	r, Analysis::RustLangItem::ItemType::DEREF_MUT);
+      Adjustment deref_mut
+	= Adjuster::try_deref_type (r, LangItem::Kind::DEREF_MUT);
       if (!deref_mut.is_error ())
 	{
 	  auto deref_r = deref_mut.get_expected ();
diff --git a/gcc/rust/typecheck/rust-autoderef.h b/gcc/rust/typecheck/rust-autoderef.h
index f9c759b6f3c..1937b0c1f4c 100644
--- a/gcc/rust/typecheck/rust-autoderef.h
+++ b/gcc/rust/typecheck/rust-autoderef.h
@@ -132,9 +132,8 @@ public:
 
   TyTy::BaseType *adjust_type (const std::vector<Adjustment> &adjustments);
 
-  static Adjustment
-  try_deref_type (TyTy::BaseType *ty,
-		  Analysis::RustLangItem::ItemType deref_lang_item);
+  static Adjustment try_deref_type (TyTy::BaseType *ty,
+				    LangItem::Kind deref_lang_item);
 
   static Adjustment try_raw_deref_type (TyTy::BaseType *ty);
 
diff --git a/gcc/rust/typecheck/rust-hir-type-bounds.h b/gcc/rust/typecheck/rust-hir-type-bounds.h
index 27fb32c7b43..4e781afd2a7 100644
--- a/gcc/rust/typecheck/rust-hir-type-bounds.h
+++ b/gcc/rust/typecheck/rust-hir-type-bounds.h
@@ -38,7 +38,7 @@ public:
 private:
   void scan ();
   void assemble_sized_builtin ();
-  void assemble_builtin_candidate (Analysis::RustLangItem::ItemType item);
+  void assemble_builtin_candidate (LangItem::Kind item);
 
 private:
   TypeBoundsProbe (const TyTy::BaseType *receiver);
diff --git a/gcc/rust/typecheck/rust-hir-type-check-base.cc b/gcc/rust/typecheck/rust-hir-type-check-base.cc
index b9b4f91ac9f..f3edfef4e27 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-base.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-base.cc
@@ -411,8 +411,7 @@ TypeCheckBase::resolve_generic_params (
 }
 
 TyTy::TypeBoundPredicate
-TypeCheckBase::get_marker_predicate (Analysis::RustLangItem::ItemType item_type,
-				     location_t locus)
+TypeCheckBase::get_marker_predicate (LangItem::Kind item_type, location_t locus)
 {
   DefId item_id = mappings->get_lang_item (item_type, locus);
   HIR::Item *item = mappings->lookup_defid (item_id);
diff --git a/gcc/rust/typecheck/rust-hir-type-check-base.h b/gcc/rust/typecheck/rust-hir-type-check-base.h
index 0491e0fe175..11a3a686df7 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-base.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-base.h
@@ -58,9 +58,8 @@ protected:
     const std::vector<std::unique_ptr<HIR::GenericParam> > &generic_params,
     std::vector<TyTy::SubstitutionParamMapping> &substitutions);
 
-  TyTy::TypeBoundPredicate
-  get_marker_predicate (Analysis::RustLangItem::ItemType item_type,
-			location_t locus);
+  TyTy::TypeBoundPredicate get_marker_predicate (LangItem::Kind item_type,
+						 location_t locus);
 
   Analysis::Mappings *mappings;
   Resolver *resolver;
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
index 9f5042a4ece..224d2fff4b8 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
@@ -260,8 +260,7 @@ TypeCheckExpr::visit (HIR::CompoundAssignmentExpr &expr)
 		 expr.get_locus ());
 
   auto lang_item_type
-    = Analysis::RustLangItem::CompoundAssignmentOperatorToLangItem (
-      expr.get_expr_type ());
+    = LangItem::CompoundAssignmentOperatorToLangItem (expr.get_expr_type ());
   bool operator_overloaded
     = resolve_operator_overload (lang_item_type, expr, lhs, rhs);
   if (operator_overloaded)
@@ -292,8 +291,7 @@ TypeCheckExpr::visit (HIR::ArithmeticOrLogicalExpr &expr)
   auto lhs = TypeCheckExpr::Resolve (expr.get_lhs ().get ());
   auto rhs = TypeCheckExpr::Resolve (expr.get_rhs ().get ());
 
-  auto lang_item_type
-    = Analysis::RustLangItem::OperatorToLangItem (expr.get_expr_type ());
+  auto lang_item_type = LangItem::OperatorToLangItem (expr.get_expr_type ());
   bool operator_overloaded
     = resolve_operator_overload (lang_item_type, expr, lhs, rhs);
   if (operator_overloaded)
@@ -384,8 +382,8 @@ TypeCheckExpr::visit (HIR::NegationExpr &expr)
   auto negated_expr_ty = TypeCheckExpr::Resolve (expr.get_expr ().get ());
 
   // check for operator overload
-  auto lang_item_type = Analysis::RustLangItem::NegationOperatorToLangItem (
-    expr.get_expr_type ());
+  auto lang_item_type
+    = LangItem::NegationOperatorToLangItem (expr.get_expr_type ());
   bool operator_overloaded
     = resolve_operator_overload (lang_item_type, expr, negated_expr_ty,
 				 nullptr);
@@ -628,7 +626,7 @@ TypeCheckExpr::visit (HIR::BlockExpr &expr)
 void
 TypeCheckExpr::visit (HIR::RangeFromToExpr &expr)
 {
-  auto lang_item_type = Analysis::RustLangItem::ItemType::RANGE;
+  auto lang_item_type = LangItem::Kind::RANGE;
 
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
@@ -637,9 +635,9 @@ TypeCheckExpr::visit (HIR::RangeFromToExpr &expr)
   // we need to have it maybe
   if (!lang_item_defined)
     {
-      rust_internal_error_at (
-	expr.get_locus (), "unable to find relevant lang item: %s",
-	Analysis::RustLangItem::ToString (lang_item_type).c_str ());
+      rust_internal_error_at (expr.get_locus (),
+			      "unable to find relevant lang item: %s",
+			      LangItem::ToString (lang_item_type).c_str ());
       return;
     }
 
@@ -683,7 +681,7 @@ TypeCheckExpr::visit (HIR::RangeFromToExpr &expr)
 void
 TypeCheckExpr::visit (HIR::RangeFromExpr &expr)
 {
-  auto lang_item_type = Analysis::RustLangItem::ItemType::RANGE_FROM;
+  auto lang_item_type = LangItem::Kind::RANGE_FROM;
 
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
@@ -692,9 +690,9 @@ TypeCheckExpr::visit (HIR::RangeFromExpr &expr)
   // we need to have it maybe
   if (!lang_item_defined)
     {
-      rust_internal_error_at (
-	expr.get_locus (), "unable to find relevant lang item: %s",
-	Analysis::RustLangItem::ToString (lang_item_type).c_str ());
+      rust_internal_error_at (expr.get_locus (),
+			      "unable to find relevant lang item: %s",
+			      LangItem::ToString (lang_item_type).c_str ());
       return;
     }
 
@@ -731,7 +729,7 @@ TypeCheckExpr::visit (HIR::RangeFromExpr &expr)
 void
 TypeCheckExpr::visit (HIR::RangeToExpr &expr)
 {
-  auto lang_item_type = Analysis::RustLangItem::ItemType::RANGE_TO;
+  auto lang_item_type = LangItem::Kind::RANGE_TO;
 
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
@@ -740,9 +738,9 @@ TypeCheckExpr::visit (HIR::RangeToExpr &expr)
   // we need to have it maybe
   if (!lang_item_defined)
     {
-      rust_internal_error_at (
-	expr.get_locus (), "unable to find relevant lang item: %s",
-	Analysis::RustLangItem::ToString (lang_item_type).c_str ());
+      rust_internal_error_at (expr.get_locus (),
+			      "unable to find relevant lang item: %s",
+			      LangItem::ToString (lang_item_type).c_str ());
       return;
     }
 
@@ -778,7 +776,7 @@ TypeCheckExpr::visit (HIR::RangeToExpr &expr)
 void
 TypeCheckExpr::visit (HIR::RangeFullExpr &expr)
 {
-  auto lang_item_type = Analysis::RustLangItem::ItemType::RANGE_FULL;
+  auto lang_item_type = LangItem::Kind::RANGE_FULL;
 
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
@@ -787,9 +785,9 @@ TypeCheckExpr::visit (HIR::RangeFullExpr &expr)
   // we need to have it maybe
   if (!lang_item_defined)
     {
-      rust_internal_error_at (
-	expr.get_locus (), "unable to find relevant lang item: %s",
-	Analysis::RustLangItem::ToString (lang_item_type).c_str ());
+      rust_internal_error_at (expr.get_locus (),
+			      "unable to find relevant lang item: %s",
+			      LangItem::ToString (lang_item_type).c_str ());
       return;
     }
 
@@ -809,7 +807,7 @@ TypeCheckExpr::visit (HIR::RangeFullExpr &expr)
 void
 TypeCheckExpr::visit (HIR::RangeFromToInclExpr &expr)
 {
-  auto lang_item_type = Analysis::RustLangItem::ItemType::RANGE_INCLUSIVE;
+  auto lang_item_type = LangItem::Kind::RANGE_INCLUSIVE;
 
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
@@ -818,9 +816,9 @@ TypeCheckExpr::visit (HIR::RangeFromToInclExpr &expr)
   // we need to have it maybe
   if (!lang_item_defined)
     {
-      rust_internal_error_at (
-	expr.get_locus (), "unable to find relevant lang item: %s",
-	Analysis::RustLangItem::ToString (lang_item_type).c_str ());
+      rust_internal_error_at (expr.get_locus (),
+			      "unable to find relevant lang item: %s",
+			      LangItem::ToString (lang_item_type).c_str ());
       return;
     }
 
@@ -903,7 +901,7 @@ TypeCheckExpr::visit (HIR::ArrayIndexExpr &expr)
     }
 
   // is this a case of core::ops::index?
-  auto lang_item_type = Analysis::RustLangItem::ItemType::INDEX;
+  auto lang_item_type = LangItem::Kind::INDEX;
   bool operator_overloaded
     = resolve_operator_overload (lang_item_type, expr, array_expr_ty,
 				 index_expr_ty);
@@ -1412,7 +1410,7 @@ TypeCheckExpr::visit (HIR::DereferenceExpr &expr)
     = TypeCheckExpr::Resolve (expr.get_expr ().get ());
 
   rust_debug_loc (expr.get_locus (), "attempting deref operator overload");
-  auto lang_item_type = Analysis::RustLangItem::ItemType::DEREF;
+  auto lang_item_type = LangItem::Kind::DEREF;
   bool operator_overloaded
     = resolve_operator_overload (lang_item_type, expr, resolved_base, nullptr);
   if (operator_overloaded)
@@ -1586,8 +1584,7 @@ TypeCheckExpr::visit (HIR::ClosureExpr &expr)
   // assume FnOnce for now. I think this is based on the return type of the
   // closure
 
-  Analysis::RustLangItem::ItemType lang_item_type
-    = Analysis::RustLangItem::ItemType::FN_ONCE;
+  LangItem::Kind lang_item_type = LangItem::Kind::FN_ONCE;
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
     = mappings->lookup_lang_item (lang_item_type, &respective_lang_item_id);
@@ -1596,9 +1593,8 @@ TypeCheckExpr::visit (HIR::ClosureExpr &expr)
       // FIXME
       // we need to have a unified way or error'ing when we are missing lang
       // items that is useful
-      rust_fatal_error (
-	expr.get_locus (), "unable to find lang item: %<%s%>",
-	Analysis::RustLangItem::ToString (lang_item_type).c_str ());
+      rust_fatal_error (expr.get_locus (), "unable to find lang item: %<%s%>",
+			LangItem::ToString (lang_item_type).c_str ());
     }
   rust_assert (lang_item_defined);
 
@@ -1637,13 +1633,13 @@ TypeCheckExpr::visit (HIR::ClosureExpr &expr)
 }
 
 bool
-TypeCheckExpr::resolve_operator_overload (
-  Analysis::RustLangItem::ItemType lang_item_type, HIR::OperatorExprMeta expr,
-  TyTy::BaseType *lhs, TyTy::BaseType *rhs)
+TypeCheckExpr::resolve_operator_overload (LangItem::Kind lang_item_type,
+					  HIR::OperatorExprMeta expr,
+					  TyTy::BaseType *lhs,
+					  TyTy::BaseType *rhs)
 {
   // look up lang item for arithmetic type
-  std::string associated_item_name
-    = Analysis::RustLangItem::ToString (lang_item_type);
+  std::string associated_item_name = LangItem::ToString (lang_item_type);
   DefId respective_lang_item_id = UNKNOWN_DEFID;
   bool lang_item_defined
     = mappings->lookup_lang_item (lang_item_type, &respective_lang_item_id);
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h
index c9df24e2dbe..9ea4dc6e59c 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h
@@ -96,10 +96,9 @@ public:
   }
 
 protected:
-  bool
-  resolve_operator_overload (Analysis::RustLangItem::ItemType lang_item_type,
-			     HIR::OperatorExprMeta expr, TyTy::BaseType *lhs,
-			     TyTy::BaseType *rhs);
+  bool resolve_operator_overload (LangItem::Kind lang_item_type,
+				  HIR::OperatorExprMeta expr,
+				  TyTy::BaseType *lhs, TyTy::BaseType *rhs);
 
   bool resolve_fn_trait_call (HIR::CallExpr &expr,
 			      TyTy::BaseType *function_tyty,
diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc
index 74a12c4b011..a132b386a96 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-type.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc
@@ -794,8 +794,7 @@ TypeResolveGenericParam::visit (HIR::TypeParam &param)
   if (apply_sized)
     {
       TyTy::TypeBoundPredicate sized_predicate
-	= get_marker_predicate (Analysis::RustLangItem::ItemType::SIZED,
-				param.get_locus ());
+	= get_marker_predicate (LangItem::Kind::SIZED, param.get_locus ());
 
       predicates[sized_predicate.get_id ()] = {sized_predicate};
     }
diff --git a/gcc/rust/typecheck/rust-tyty-bounds.cc b/gcc/rust/typecheck/rust-tyty-bounds.cc
index f37cf50d53c..6e4c3458118 100644
--- a/gcc/rust/typecheck/rust-tyty-bounds.cc
+++ b/gcc/rust/typecheck/rust-tyty-bounds.cc
@@ -131,7 +131,7 @@ TypeBoundsProbe::assemble_sized_builtin ()
     case TyTy::NEVER:
     case TyTy::PLACEHOLDER:
     case TyTy::PROJECTION:
-      assemble_builtin_candidate (Analysis::RustLangItem::SIZED);
+      assemble_builtin_candidate (LangItem::Kind::SIZED);
       break;
 
       // FIXME str and slice need to be moved and test cases updated
@@ -140,7 +140,7 @@ TypeBoundsProbe::assemble_sized_builtin ()
     case TyTy::ADT:
     case TyTy::TUPLE:
       // FIXME add extra checks
-      assemble_builtin_candidate (Analysis::RustLangItem::SIZED);
+      assemble_builtin_candidate (LangItem::Kind::SIZED);
       break;
 
     case TyTy::DYNAMIC:
@@ -150,8 +150,7 @@ TypeBoundsProbe::assemble_sized_builtin ()
 }
 
 void
-TypeBoundsProbe::assemble_builtin_candidate (
-  Analysis::RustLangItem::ItemType lang_item)
+TypeBoundsProbe::assemble_builtin_candidate (LangItem::Kind lang_item)
 {
   DefId id;
   bool found_lang_item = mappings->lookup_lang_item (lang_item, &id);
@@ -171,7 +170,7 @@ TypeBoundsProbe::assemble_builtin_candidate (
   trait_references.push_back ({trait_ref, mappings->lookup_builtin_marker ()});
 
   rust_debug ("Added builtin lang_item: %s for %s",
-	      Analysis::RustLangItem::ToString (lang_item).c_str (),
+	      LangItem::ToString (lang_item).c_str (),
 	      raw->get_name ().c_str ());
 }
 
@@ -246,8 +245,7 @@ TypeCheckBase::get_predicate_from_bound (HIR::TypePath &type_path,
 	TypeCheckType::Resolve (fn.get_return_type ().get ());
 
 	HIR::TraitItem *trait_item = mappings->lookup_trait_item_lang_item (
-	  Analysis::RustLangItem::ItemType::FN_ONCE_OUTPUT,
-	  final_seg->get_locus ());
+	  LangItem::Kind::FN_ONCE_OUTPUT, final_seg->get_locus ());
 
 	std::vector<HIR::GenericArgsBinding> bindings;
 	location_t output_locus = fn.get_return_type ()->get_locus ();
diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index d81311eed6e..51960efa406 100644
--- a/gcc/rust/typecheck/rust-tyty.cc
+++ b/gcc/rust/typecheck/rust-tyty.cc
@@ -2215,9 +2215,8 @@ void
 ClosureType::setup_fn_once_output () const
 {
   // lookup the lang items
-  auto fn_once_lang_item = Analysis::RustLangItem::ItemType::FN_ONCE;
-  auto fn_once_output_lang_item
-    = Analysis::RustLangItem::ItemType::FN_ONCE_OUTPUT;
+  auto fn_once_lang_item = LangItem::Kind::FN_ONCE;
+  auto fn_once_output_lang_item = LangItem::Kind::FN_ONCE_OUTPUT;
 
   DefId trait_id = UNKNOWN_DEFID;
   bool trait_lang_item_defined
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc
index 91fa2562c39..1f7cb4d2c48 100644
--- a/gcc/rust/util/rust-hir-map.cc
+++ b/gcc/rust/util/rust-hir-map.cc
@@ -1252,20 +1252,19 @@ Mappings::lookup_builtin_marker ()
 }
 
 DefId
-Mappings::get_lang_item (RustLangItem::ItemType item_type, location_t locus)
+Mappings::get_lang_item (LangItem::Kind item_type, location_t locus)
 {
   DefId item = UNKNOWN_DEFID;
   bool ok = lookup_lang_item (item_type, &item);
   if (!ok)
     rust_fatal_error (locus, "failed to find lang item %s",
-		      RustLangItem::ToString (item_type).c_str ());
+		      LangItem::ToString (item_type).c_str ());
 
   return item;
 }
 
 HIR::TraitItem *
-Mappings::lookup_trait_item_lang_item (Analysis::RustLangItem::ItemType item,
-				       location_t locus)
+Mappings::lookup_trait_item_lang_item (LangItem::Kind item, location_t locus)
 {
   DefId trait_item_id = get_lang_item (item, locus);
   return lookup_trait_item_defid (trait_item_id);
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h
index a663bfe4a56..927c01251db 100644
--- a/gcc/rust/util/rust-hir-map.h
+++ b/gcc/rust/util/rust-hir-map.h
@@ -255,7 +255,7 @@ public:
     return true;
   }
 
-  void insert_lang_item (RustLangItem::ItemType item_type, DefId id)
+  void insert_lang_item (LangItem::Kind item_type, DefId id)
   {
     auto it = lang_item_mappings.find (item_type);
     rust_assert (it == lang_item_mappings.end ());
@@ -263,7 +263,7 @@ public:
     lang_item_mappings[item_type] = id;
   }
 
-  bool lookup_lang_item (RustLangItem::ItemType item_type, DefId *id)
+  bool lookup_lang_item (LangItem::Kind item_type, DefId *id)
   {
     auto it = lang_item_mappings.find (item_type);
     if (it == lang_item_mappings.end ())
@@ -274,7 +274,7 @@ public:
   }
 
   // This will fatal_error when this lang item does not exist
-  DefId get_lang_item (RustLangItem::ItemType item_type, location_t locus);
+  DefId get_lang_item (LangItem::Kind item_type, location_t locus);
 
   void insert_macro_def (AST::MacroRulesDefinition *macro);
 
@@ -347,9 +347,8 @@ public:
 
   HIR::ImplBlock *lookup_builtin_marker ();
 
-  HIR::TraitItem *
-  lookup_trait_item_lang_item (Analysis::RustLangItem::ItemType item,
-			       location_t locus);
+  HIR::TraitItem *lookup_trait_item_lang_item (LangItem::Kind item,
+					       location_t locus);
 
 private:
   Mappings ();
@@ -388,7 +387,7 @@ private:
   std::map<HirId, HIR::GenericParam *> hirGenericParamMappings;
   std::map<HirId, HIR::Trait *> hirTraitItemsToTraitMappings;
   std::map<HirId, HIR::Pattern *> hirPatternMappings;
-  std::map<RustLangItem::ItemType, DefId> lang_item_mappings;
+  std::map<LangItem::Kind, DefId> lang_item_mappings;
   std::map<NodeId, const Resolver::CanonicalPath> paths;
   std::map<NodeId, location_t> locations;
   std::map<NodeId, HirId> nodeIdToHirMappings;
diff --git a/gcc/rust/util/rust-lang-item.cc b/gcc/rust/util/rust-lang-item.cc
index 9fe212d412d..38df90f29a1 100644
--- a/gcc/rust/util/rust-lang-item.cc
+++ b/gcc/rust/util/rust-lang-item.cc
@@ -20,172 +20,168 @@
 #include "rust-system.h"
 
 namespace Rust {
-namespace Analysis {
-
-const BiMap<std::string, RustLangItem::ItemType>
-  Rust::Analysis::RustLangItem::lang_items = {{
-    {"add", ADD},
-    {"sub", SUBTRACT},
-    {"mul", MULTIPLY},
-    {"div", DIVIDE},
-    {"rem", REMAINDER},
-    {"bitand", BITAND},
-    {"bitor", BITOR},
-    {"bitxor", BITXOR},
-    {"shl", SHL},
-    {"shr", SHR},
-    {"neg", NEGATION},
-    {"not", NOT},
-    {"add_assign", ADD_ASSIGN},
-    {"sub_assign", SUB_ASSIGN},
-    {"mul_assign", MUL_ASSIGN},
-    {"div_assign", DIV_ASSIGN},
-    {"rem_assign", REM_ASSIGN},
-    {"bitand_assign", BITAND_ASSIGN},
-    {"bitor_assign", BITOR_ASSIGN},
-    {"bitxor_assign", BITXOR_ASSIGN},
-    {"shl_assign", SHL_ASSIGN},
-    {"shr_assign", SHR_ASSIGN},
-    {"deref", DEREF},
-    {"deref_mut", DEREF_MUT},
-    {"index", INDEX},
-    {"index_mut", INDEX_MUT},
-    {"RangeFull", RANGE_FULL},
-    {"Range", RANGE},
-    {"RangeFrom", RANGE_FROM},
-    {"RangeTo", RANGE_TO},
-    {"RangeInclusive", RANGE_INCLUSIVE},
-    {"RangeToInclusive", RANGE_TO_INCLUSIVE},
-    {"phantom_data", PHANTOM_DATA},
-    {"fn", FN},
-    {"fn_mut", FN_MUT},
-    {"fn_once", FN_ONCE},
-    {"fn_once_output", FN_ONCE_OUTPUT},
-    {"copy", COPY},
-    {"clone", CLONE},
-    {"sized", SIZED},
-    {"slice_alloc", SLICE_ALLOC},
-    {"slice_u8_alloc", SLICE_U8_ALLOC},
-    {"str_alloc", STR_ALLOC},
-    {"array", ARRAY},
-    {"bool", BOOL},
-    {"char", CHAR},
-    {"f32", F32},
-    {"f64", F64},
-    {"i8", I8},
-    {"i16", I16},
-    {"i32", I32},
-    {"i64", I64},
-    {"i128", I128},
-    {"isize", ISIZE},
-    {"u8", U8},
-    {"u16", U16},
-    {"u32", U32},
-    {"u64", U64},
-    {"u128", U128},
-    {"usize", USIZE},
-    {"const_ptr", CONST_PTR},
-    {"const_slice_ptr", CONST_SLICE_PTR},
-    {"mut_ptr", MUT_PTR},
-    {"mut_slice_ptr", MUT_SLICE_PTR},
-    {"slice_u8", SLICE_U8},
-    {"slice", SLICE},
-    {"str", STR},
-    {"f32_runtime", F32_RUNTIME},
-    {"f64_runtime", F64_RUNTIME},
-  }};
-
-tl::optional<RustLangItem::ItemType>
-RustLangItem::Parse (const std::string &item)
+
+const BiMap<std::string, LangItem::Kind> Rust::LangItem::lang_items = {{
+  {"add", Kind::ADD},
+  {"sub", Kind::SUBTRACT},
+  {"mul", Kind::MULTIPLY},
+  {"div", Kind::DIVIDE},
+  {"rem", Kind::REMAINDER},
+  {"bitand", Kind::BITAND},
+  {"bitor", Kind::BITOR},
+  {"bitxor", Kind::BITXOR},
+  {"shl", Kind::SHL},
+  {"shr", Kind::SHR},
+  {"neg", Kind::NEGATION},
+  {"not", Kind::NOT},
+  {"add_assign", Kind::ADD_ASSIGN},
+  {"sub_assign", Kind::SUB_ASSIGN},
+  {"mul_assign", Kind::MUL_ASSIGN},
+  {"div_assign", Kind::DIV_ASSIGN},
+  {"rem_assign", Kind::REM_ASSIGN},
+  {"bitand_assign", Kind::BITAND_ASSIGN},
+  {"bitor_assign", Kind::BITOR_ASSIGN},
+  {"bitxor_assign", Kind::BITXOR_ASSIGN},
+  {"shl_assign", Kind::SHL_ASSIGN},
+  {"shr_assign", Kind::SHR_ASSIGN},
+  {"deref", Kind::DEREF},
+  {"deref_mut", Kind::DEREF_MUT},
+  {"index", Kind::INDEX},
+  {"index_mut", Kind::INDEX_MUT},
+  {"RangeFull", Kind::RANGE_FULL},
+  {"Range", Kind::RANGE},
+  {"RangeFrom", Kind::RANGE_FROM},
+  {"RangeTo", Kind::RANGE_TO},
+  {"RangeInclusive", Kind::RANGE_INCLUSIVE},
+  {"RangeToInclusive", Kind::RANGE_TO_INCLUSIVE},
+  {"phantom_data", Kind::PHANTOM_DATA},
+  {"fn", Kind::FN},
+  {"fn_mut", Kind::FN_MUT},
+  {"fn_once", Kind::FN_ONCE},
+  {"fn_once_output", Kind::FN_ONCE_OUTPUT},
+  {"copy", Kind::COPY},
+  {"clone", Kind::CLONE},
+  {"sized", Kind::SIZED},
+  {"slice_alloc", Kind::SLICE_ALLOC},
+  {"slice_u8_alloc", Kind::SLICE_U8_ALLOC},
+  {"str_alloc", Kind::STR_ALLOC},
+  {"array", Kind::ARRAY},
+  {"bool", Kind::BOOL},
+  {"char", Kind::CHAR},
+  {"f32", Kind::F32},
+  {"f64", Kind::F64},
+  {"i8", Kind::I8},
+  {"i16", Kind::I16},
+  {"i32", Kind::I32},
+  {"i64", Kind::I64},
+  {"i128", Kind::I128},
+  {"isize", Kind::ISIZE},
+  {"u8", Kind::U8},
+  {"u16", Kind::U16},
+  {"u32", Kind::U32},
+  {"u64", Kind::U64},
+  {"u128", Kind::U128},
+  {"usize", Kind::USIZE},
+  {"const_ptr", Kind::CONST_PTR},
+  {"const_slice_ptr", Kind::CONST_SLICE_PTR},
+  {"mut_ptr", Kind::MUT_PTR},
+  {"mut_slice_ptr", Kind::MUT_SLICE_PTR},
+  {"slice_u8", Kind::SLICE_U8},
+  {"slice", Kind::SLICE},
+  {"str", Kind::STR},
+  {"f32_runtime", Kind::F32_RUNTIME},
+  {"f64_runtime", Kind::F64_RUNTIME},
+}};
+
+tl::optional<LangItem::Kind>
+LangItem::Parse (const std::string &item)
 {
-  auto lang_item = RustLangItem::lang_items.lookup (item);
-  if (!RustLangItem::lang_items.is_iter_ok (lang_item))
+  auto lang_item = LangItem::lang_items.lookup (item);
+  if (!LangItem::lang_items.is_iter_ok (lang_item))
     return tl::nullopt;
 
   return lang_item->second;
 }
 
 std::string
-RustLangItem::ToString (RustLangItem::ItemType type)
+LangItem::ToString (LangItem::Kind type)
 {
-  auto str = RustLangItem::lang_items.lookup (type);
+  auto str = LangItem::lang_items.lookup (type);
   return str->second;
 }
 
-RustLangItem::ItemType
-RustLangItem::OperatorToLangItem (ArithmeticOrLogicalOperator op)
+LangItem::Kind
+LangItem::OperatorToLangItem (ArithmeticOrLogicalOperator op)
 {
   switch (op)
     {
     case ArithmeticOrLogicalOperator::ADD:
-      return RustLangItem::ItemType::ADD;
+      return LangItem::Kind::ADD;
     case ArithmeticOrLogicalOperator::SUBTRACT:
-      return RustLangItem::ItemType::SUBTRACT;
+      return LangItem::Kind::SUBTRACT;
     case ArithmeticOrLogicalOperator::MULTIPLY:
-      return RustLangItem::ItemType::MULTIPLY;
+      return LangItem::Kind::MULTIPLY;
     case ArithmeticOrLogicalOperator::DIVIDE:
-      return RustLangItem::ItemType::DIVIDE;
+      return LangItem::Kind::DIVIDE;
     case ArithmeticOrLogicalOperator::MODULUS:
-      return RustLangItem::ItemType::REMAINDER;
+      return LangItem::Kind::REMAINDER;
     case ArithmeticOrLogicalOperator::BITWISE_AND:
-      return RustLangItem::ItemType::BITAND;
+      return LangItem::Kind::BITAND;
     case ArithmeticOrLogicalOperator::BITWISE_OR:
-      return RustLangItem::ItemType::BITOR;
+      return LangItem::Kind::BITOR;
     case ArithmeticOrLogicalOperator::BITWISE_XOR:
-      return RustLangItem::ItemType::BITXOR;
+      return LangItem::Kind::BITXOR;
     case ArithmeticOrLogicalOperator::LEFT_SHIFT:
-      return RustLangItem::ItemType::SHL;
+      return LangItem::Kind::SHL;
     case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
-      return RustLangItem::ItemType::SHR;
+      return LangItem::Kind::SHR;
     }
 
   rust_unreachable ();
 }
 
-RustLangItem::ItemType
-RustLangItem::CompoundAssignmentOperatorToLangItem (
-  ArithmeticOrLogicalOperator op)
+LangItem::Kind
+LangItem::CompoundAssignmentOperatorToLangItem (ArithmeticOrLogicalOperator op)
 {
   switch (op)
     {
     case ArithmeticOrLogicalOperator::ADD:
-      return RustLangItem::ItemType::ADD_ASSIGN;
+      return LangItem::Kind::ADD_ASSIGN;
     case ArithmeticOrLogicalOperator::SUBTRACT:
-      return RustLangItem::ItemType::SUB_ASSIGN;
+      return LangItem::Kind::SUB_ASSIGN;
     case ArithmeticOrLogicalOperator::MULTIPLY:
-      return RustLangItem::ItemType::MUL_ASSIGN;
+      return LangItem::Kind::MUL_ASSIGN;
     case ArithmeticOrLogicalOperator::DIVIDE:
-      return RustLangItem::ItemType::DIV_ASSIGN;
+      return LangItem::Kind::DIV_ASSIGN;
     case ArithmeticOrLogicalOperator::MODULUS:
-      return RustLangItem::ItemType::REM_ASSIGN;
+      return LangItem::Kind::REM_ASSIGN;
     case ArithmeticOrLogicalOperator::BITWISE_AND:
-      return RustLangItem::ItemType::BITAND_ASSIGN;
+      return LangItem::Kind::BITAND_ASSIGN;
     case ArithmeticOrLogicalOperator::BITWISE_OR:
-      return RustLangItem::ItemType::BITOR_ASSIGN;
+      return LangItem::Kind::BITOR_ASSIGN;
     case ArithmeticOrLogicalOperator::BITWISE_XOR:
-      return RustLangItem::ItemType::BITXOR_ASSIGN;
+      return LangItem::Kind::BITXOR_ASSIGN;
     case ArithmeticOrLogicalOperator::LEFT_SHIFT:
-      return RustLangItem::ItemType::SHL_ASSIGN;
+      return LangItem::Kind::SHL_ASSIGN;
     case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
-      return RustLangItem::ItemType::SHR_ASSIGN;
+      return LangItem::Kind::SHR_ASSIGN;
     }
 
   rust_unreachable ();
 }
 
-RustLangItem::ItemType
-RustLangItem::NegationOperatorToLangItem (NegationOperator op)
+LangItem::Kind
+LangItem::NegationOperatorToLangItem (NegationOperator op)
 {
   switch (op)
     {
     case NegationOperator::NEGATE:
-      return RustLangItem::ItemType::NEGATION;
+      return LangItem::Kind::NEGATION;
     case NegationOperator::NOT:
-      return RustLangItem::ItemType::NOT;
+      return LangItem::Kind::NOT;
     }
 
   rust_unreachable ();
 }
 
-} // namespace Analysis
 } // namespace Rust
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index 3447e3680c8..414436f0c96 100644
--- a/gcc/rust/util/rust-lang-item.h
+++ b/gcc/rust/util/rust-lang-item.h
@@ -22,13 +22,12 @@
 #include "bi-map.h"
 
 namespace Rust {
-namespace Analysis {
 
 // https://github.com/rust-lang/rust/blob/master/library/core/src/ops/arith.rs
-class RustLangItem
+class LangItem
 {
 public:
-  enum ItemType
+  enum class Kind
   {
     ADD,
     SUBTRACT,
@@ -119,15 +118,27 @@ public:
     F64_RUNTIME,
   };
 
-  static const BiMap<std::string, ItemType> lang_items;
+  static const BiMap<std::string, Kind> lang_items;
 
-  static tl::optional<ItemType> Parse (const std::string &item);
-  static std::string ToString (ItemType type);
-  static ItemType OperatorToLangItem (ArithmeticOrLogicalOperator op);
-  static ItemType
+  static tl::optional<Kind> Parse (const std::string &item);
+  static std::string ToString (Kind type);
+  static Kind OperatorToLangItem (ArithmeticOrLogicalOperator op);
+  static Kind
   CompoundAssignmentOperatorToLangItem (ArithmeticOrLogicalOperator op);
-  static ItemType NegationOperatorToLangItem (NegationOperator op);
+  static Kind NegationOperatorToLangItem (NegationOperator op);
 };
 
-} // namespace Analysis
 } // namespace Rust
+
+// GCC 4.8 needs us to manually implement hashing for enum classes
+namespace std {
+template <> struct hash<Rust::LangItem::Kind>
+{
+  size_t operator() (const Rust::LangItem::Kind &lang_item) const noexcept
+  {
+    return hash<std::underlying_type<Rust::LangItem::Kind>::type> () (
+      static_cast<std::underlying_type<Rust::LangItem::Kind>::type> (
+	lang_item));
+  }
+};
+} // namespace std
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 024/125] gccrs: extern-types: Declare external types in name resolver.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (21 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 023/125] gccrs: lang-items: Make lang items enum stronger, rename class, cleanup ns Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 025/125] gccrs: hir: Add ExternalTypeItem node Arthur Cohen
                   ` (100 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-implitem.h: Declare external types as new
	types.
---
 gcc/rust/resolve/rust-ast-resolve-implitem.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gcc/rust/resolve/rust-ast-resolve-implitem.h b/gcc/rust/resolve/rust-ast-resolve-implitem.h
index fabc25817f5..4f4d2893f83 100644
--- a/gcc/rust/resolve/rust-ast-resolve-implitem.h
+++ b/gcc/rust/resolve/rust-ast-resolve-implitem.h
@@ -228,6 +228,25 @@ public:
     mappings->insert_module_child_item (current_module, decl);
   }
 
+  void visit (AST::ExternalTypeItem &type) override
+  {
+    auto decl = CanonicalPath::new_seg (type.get_node_id (),
+					type.get_identifier ().as_string ());
+    auto path = prefix.append (decl);
+
+    resolver->get_type_scope ().insert (
+      path, type.get_node_id (), type.get_locus (), false, Rib::ItemType::Type,
+      [&] (const CanonicalPath &, NodeId, location_t locus) -> void {
+	rich_location r (line_table, type.get_locus ());
+	r.add_range (locus);
+
+	rust_error_at (r, "redefined multiple times");
+      });
+
+    NodeId current_module = resolver->peek_current_module_scope ();
+    mappings->insert_module_child_item (current_module, decl);
+  }
+
 private:
   ResolveToplevelExternItem (const CanonicalPath &prefix)
     : ResolverBase (), prefix (prefix)
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 025/125] gccrs: hir: Add ExternalTypeItem node
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (22 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 024/125] gccrs: extern-types: Declare external types in name resolver Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 026/125] gccrs: extern-types: Lower to HIR::ExternalTypeItem properly Arthur Cohen
                   ` (99 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* hir/tree/rust-hir-item.h (class ExternalTypeItem): New class.
	* hir/tree/rust-hir.cc (ExternalTypeItem::as_string): Likewise.
	* backend/rust-compile-extern.h: Add base for handling HIR::ExternalTypeItem
	node.
	* checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
	* checks/errors/borrowck/rust-function-collector.h: Likewise.
	* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
	* checks/errors/rust-const-checker.h: Likewise.
	* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise.
	* checks/errors/rust-unsafe-checker.h: Likewise.
	* hir/rust-ast-lower-extern.h: Likewise.
	* hir/rust-hir-dump.cc (Dump::visit): Likewise.
	* hir/rust-hir-dump.h: Likewise.
	* hir/tree/rust-hir-full-decls.h (class ExternalTypeItem): Likewise.
	* hir/tree/rust-hir-visitor.h: Likewise.
	(ExternalTypeItem::accept_vis): Likewise.
	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise.
	* typecheck/rust-hir-type-check-implitem.h: Likewise.
---
 gcc/rust/backend/rust-compile-extern.h        |   7 +
 .../errors/borrowck/rust-bir-builder-struct.h |   1 +
 .../errors/borrowck/rust-function-collector.h |   1 +
 gcc/rust/checks/errors/rust-const-checker.cc  |   4 +
 gcc/rust/checks/errors/rust-const-checker.h   |   1 +
 gcc/rust/checks/errors/rust-unsafe-checker.cc |   4 +
 gcc/rust/checks/errors/rust-unsafe-checker.h  |   1 +
 gcc/rust/hir/rust-ast-lower-extern.h          |   5 +
 gcc/rust/hir/rust-hir-dump.cc                 |  10 ++
 gcc/rust/hir/rust-hir-dump.h                  |   1 +
 gcc/rust/hir/tree/rust-hir-full-decls.h       |   1 +
 gcc/rust/hir/tree/rust-hir-item.h             |  39 +++++-
 gcc/rust/hir/tree/rust-hir-visitor.h          |   3 +
 gcc/rust/hir/tree/rust-hir.cc                 |  25 ++++
 .../typecheck/rust-hir-type-check-implitem.cc | 129 ++++++++++++++++++
 .../typecheck/rust-hir-type-check-implitem.h  |   1 +
 16 files changed, 230 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/backend/rust-compile-extern.h b/gcc/rust/backend/rust-compile-extern.h
index 778553e5b37..b17ac954167 100644
--- a/gcc/rust/backend/rust-compile-extern.h
+++ b/gcc/rust/backend/rust-compile-extern.h
@@ -22,6 +22,8 @@
 #include "rust-compile-base.h"
 #include "rust-compile-intrinsic.h"
 #include "rust-compile-type.h"
+#include "rust-diagnostics.h"
+#include "rust-hir-full-decls.h"
 
 namespace Rust {
 namespace Compile {
@@ -152,6 +154,11 @@ public:
     reference = address_expression (fndecl, ref_locus);
   }
 
+  void visit (HIR::ExternalTypeItem &type) override
+  {
+    rust_sorry_at (type.get_locus (), "extern types are not supported yet");
+  }
+
 private:
   CompileExternItem (Context *ctx, TyTy::BaseType *concrete,
 		     location_t ref_locus)
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-struct.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-struct.h
index d6390392d7f..6a990e25c43 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-struct.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-struct.h
@@ -189,6 +189,7 @@ protected:
   void visit (HIR::ImplBlock &impl) override { rust_unreachable (); }
   void visit (HIR::ExternalStaticItem &item) override { rust_unreachable (); }
   void visit (HIR::ExternalFunctionItem &item) override { rust_unreachable (); }
+  void visit (HIR::ExternalTypeItem &item) override { rust_unreachable (); }
   void visit (HIR::ExternBlock &block) override { rust_unreachable (); }
   void visit (HIR::LiteralPattern &pattern) override { rust_unreachable (); }
   void visit (HIR::IdentifierPattern &pattern) override { rust_unreachable (); }
diff --git a/gcc/rust/checks/errors/borrowck/rust-function-collector.h b/gcc/rust/checks/errors/borrowck/rust-function-collector.h
index b19bfdf855e..18f2f5e11d1 100644
--- a/gcc/rust/checks/errors/borrowck/rust-function-collector.h
+++ b/gcc/rust/checks/errors/borrowck/rust-function-collector.h
@@ -155,6 +155,7 @@ public:
   void visit (HIR::ImplBlock &impl) override {}
   void visit (HIR::ExternalStaticItem &item) override {}
   void visit (HIR::ExternalFunctionItem &item) override {}
+  void visit (HIR::ExternalTypeItem &item) override {}
   void visit (HIR::ExternBlock &block) override {}
   void visit (HIR::LiteralPattern &pattern) override {}
   void visit (HIR::IdentifierPattern &pattern) override {}
diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc
index aaf8fc0c3f6..886ae18d314 100644
--- a/gcc/rust/checks/errors/rust-const-checker.cc
+++ b/gcc/rust/checks/errors/rust-const-checker.cc
@@ -714,6 +714,10 @@ void
 ConstChecker::visit (ExternalFunctionItem &)
 {}
 
+void
+ConstChecker::visit (ExternalTypeItem &)
+{}
+
 void
 ConstChecker::visit (ExternBlock &block)
 {
diff --git a/gcc/rust/checks/errors/rust-const-checker.h b/gcc/rust/checks/errors/rust-const-checker.h
index a645da8b7c0..a9bf087a993 100644
--- a/gcc/rust/checks/errors/rust-const-checker.h
+++ b/gcc/rust/checks/errors/rust-const-checker.h
@@ -162,6 +162,7 @@ private:
   virtual void visit (ImplBlock &impl) override;
   virtual void visit (ExternalStaticItem &item) override;
   virtual void visit (ExternalFunctionItem &item) override;
+  virtual void visit (ExternalTypeItem &item) override;
   virtual void visit (ExternBlock &block) override;
   virtual void visit (LiteralPattern &pattern) override;
   virtual void visit (IdentifierPattern &pattern) override;
diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc
index 4bad20b58d3..b8c25f9a592 100644
--- a/gcc/rust/checks/errors/rust-unsafe-checker.cc
+++ b/gcc/rust/checks/errors/rust-unsafe-checker.cc
@@ -783,6 +783,10 @@ void
 UnsafeChecker::visit (ExternalFunctionItem &)
 {}
 
+void
+UnsafeChecker::visit (ExternalTypeItem &)
+{}
+
 void
 UnsafeChecker::visit (ExternBlock &block)
 {
diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.h b/gcc/rust/checks/errors/rust-unsafe-checker.h
index fee4d62fe43..27659f5141a 100644
--- a/gcc/rust/checks/errors/rust-unsafe-checker.h
+++ b/gcc/rust/checks/errors/rust-unsafe-checker.h
@@ -144,6 +144,7 @@ private:
   virtual void visit (ImplBlock &impl) override;
   virtual void visit (ExternalStaticItem &item) override;
   virtual void visit (ExternalFunctionItem &item) override;
+  virtual void visit (ExternalTypeItem &item) override;
   virtual void visit (ExternBlock &block) override;
   virtual void visit (LiteralPattern &pattern) override;
   virtual void visit (IdentifierPattern &pattern) override;
diff --git a/gcc/rust/hir/rust-ast-lower-extern.h b/gcc/rust/hir/rust-ast-lower-extern.h
index cee480bb9ed..e495b16632d 100644
--- a/gcc/rust/hir/rust-ast-lower-extern.h
+++ b/gcc/rust/hir/rust-ast-lower-extern.h
@@ -114,6 +114,11 @@ public:
       function.get_outer_attrs (), function.get_locus ());
   }
 
+  void visit (AST::ExternalTypeItem &type) override
+  {
+    rust_sorry_at (type.get_locus (), "extern types are not implemented yet");
+  }
+
 private:
   ASTLoweringExternItem () : translated (nullptr) {}
 
diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir/rust-hir-dump.cc
index 2fdf769c0de..38c2db1d6cd 100644
--- a/gcc/rust/hir/rust-hir-dump.cc
+++ b/gcc/rust/hir/rust-hir-dump.cc
@@ -1999,6 +1999,16 @@ Dump::visit (ExternalFunctionItem &e)
   end ("ExternalFunctionItem");
 }
 
+void
+Dump::visit (ExternalTypeItem &e)
+{
+  begin ("ExternalTypeItem");
+
+  do_externalitem (e);
+
+  end ("ExternalTypeItem");
+}
+
 void
 Dump::visit (ExternBlock &e)
 {
diff --git a/gcc/rust/hir/rust-hir-dump.h b/gcc/rust/hir/rust-hir-dump.h
index a48394a4bca..6363eb4c604 100644
--- a/gcc/rust/hir/rust-hir-dump.h
+++ b/gcc/rust/hir/rust-hir-dump.h
@@ -201,6 +201,7 @@ private:
 
   virtual void visit (ExternalStaticItem &) override;
   virtual void visit (ExternalFunctionItem &) override;
+  virtual void visit (ExternalTypeItem &) override;
   virtual void visit (ExternBlock &) override;
 
   virtual void visit (LiteralPattern &) override;
diff --git a/gcc/rust/hir/tree/rust-hir-full-decls.h b/gcc/rust/hir/tree/rust-hir-full-decls.h
index 96293ce8314..d01535e75d3 100644
--- a/gcc/rust/hir/tree/rust-hir-full-decls.h
+++ b/gcc/rust/hir/tree/rust-hir-full-decls.h
@@ -177,6 +177,7 @@ class ExternalItem;
 class ExternalStaticItem;
 struct NamedFunctionParam;
 class ExternalFunctionItem;
+class ExternalTypeItem;
 class ExternBlock;
 
 // rust-pattern.h
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 1d067fca5be..40093a2ad93 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -2859,6 +2859,7 @@ public:
   {
     Static,
     Function,
+    Type,
   };
 
   virtual ~ExternalItem () {}
@@ -3084,11 +3085,13 @@ public:
 
   // Copy constructor with clone
   ExternalFunctionItem (ExternalFunctionItem const &other)
-    : ExternalItem (other), return_type (other.return_type->clone_type ()),
-      where_clause (other.where_clause),
+    : ExternalItem (other), where_clause (other.where_clause),
       function_params (other.function_params),
       has_variadics (other.has_variadics)
   {
+    if (other.return_type)
+      return_type = other.return_type->clone_type ();
+
     generic_params.reserve (other.generic_params.size ());
     for (const auto &e : other.generic_params)
       generic_params.push_back (e->clone_generic_param ());
@@ -3098,11 +3101,14 @@ public:
   ExternalFunctionItem &operator= (ExternalFunctionItem const &other)
   {
     ExternalItem::operator= (other);
-    return_type = other.return_type->clone_type ();
+
     where_clause = other.where_clause;
     function_params = other.function_params;
     has_variadics = other.has_variadics;
 
+    if (other.return_type)
+      return_type = other.return_type->clone_type ();
+
     generic_params.reserve (other.generic_params.size ());
     for (const auto &e : other.generic_params)
       generic_params.push_back (e->clone_generic_param ());
@@ -3144,6 +3150,33 @@ protected:
   }
 };
 
+class ExternalTypeItem : public ExternalItem
+{
+  ExternalTypeItem (Analysis::NodeMapping mappings, Identifier item_name,
+		    Visibility vis, AST::AttrVec outer_attrs, location_t locus)
+    : ExternalItem (std::move (mappings), std::move (item_name),
+		    std::move (vis), std::move (outer_attrs), locus)
+  {}
+
+  ExternalTypeItem (ExternalTypeItem const &other) : ExternalItem (other) {}
+
+  ExternalTypeItem (ExternalTypeItem &&other) = default;
+  ExternalTypeItem &operator= (ExternalTypeItem &&other) = default;
+
+  std::string as_string () const override;
+
+  void accept_vis (HIRFullVisitor &vis) override;
+  void accept_vis (HIRExternalItemVisitor &vis) override;
+
+  ExternKind get_extern_kind () override { return ExternKind::Type; }
+
+protected:
+  ExternalTypeItem *clone_external_item_impl () const override
+  {
+    return new ExternalTypeItem (*this);
+  }
+};
+
 // An extern block HIR node
 class ExternBlock : public VisItem, public WithInnerAttrs
 {
diff --git a/gcc/rust/hir/tree/rust-hir-visitor.h b/gcc/rust/hir/tree/rust-hir-visitor.h
index 4e7a97bd972..ae9d23f2e00 100644
--- a/gcc/rust/hir/tree/rust-hir-visitor.h
+++ b/gcc/rust/hir/tree/rust-hir-visitor.h
@@ -114,6 +114,7 @@ public:
   virtual void visit (ImplBlock &impl) = 0;
   virtual void visit (ExternalStaticItem &item) = 0;
   virtual void visit (ExternalFunctionItem &item) = 0;
+  virtual void visit (ExternalTypeItem &item) = 0;
   virtual void visit (ExternBlock &block) = 0;
   virtual void visit (LiteralPattern &pattern) = 0;
   virtual void visit (IdentifierPattern &pattern) = 0;
@@ -255,6 +256,7 @@ public:
 
   virtual void visit (ExternalStaticItem &) override {}
   virtual void visit (ExternalFunctionItem &) override {}
+  virtual void visit (ExternalTypeItem &) override {}
   virtual void visit (ExternBlock &) override {}
 
   virtual void visit (LiteralPattern &) override {}
@@ -306,6 +308,7 @@ class HIRExternalItemVisitor
 public:
   virtual void visit (ExternalStaticItem &item) = 0;
   virtual void visit (ExternalFunctionItem &item) = 0;
+  virtual void visit (ExternalTypeItem &item) = 0;
 };
 
 class HIRTraitItemVisitor
diff --git a/gcc/rust/hir/tree/rust-hir.cc b/gcc/rust/hir/tree/rust-hir.cc
index fb0a9c388ae..3eb8838eb9d 100644
--- a/gcc/rust/hir/tree/rust-hir.cc
+++ b/gcc/rust/hir/tree/rust-hir.cc
@@ -3256,6 +3256,19 @@ ExternalFunctionItem::as_string () const
   return str;
 }
 
+std::string
+ExternalTypeItem::as_string () const
+{
+  std::string str = ExternalItem::as_string ();
+
+  str += "type ";
+
+  // add name
+  str += get_item_name ().as_string ();
+
+  return str;
+}
+
 std::string
 NamedFunctionParam::as_string () const
 {
@@ -4272,6 +4285,12 @@ ExternalFunctionItem::accept_vis (HIRFullVisitor &vis)
   vis.visit (*this);
 }
 
+void
+ExternalTypeItem::accept_vis (HIRFullVisitor &vis)
+{
+  vis.visit (*this);
+}
+
 void
 ExternBlock::accept_vis (HIRFullVisitor &vis)
 {
@@ -4542,6 +4561,12 @@ ExternalFunctionItem::accept_vis (HIRExternalItemVisitor &vis)
   vis.visit (*this);
 }
 
+void
+ExternalTypeItem::accept_vis (HIRExternalItemVisitor &vis)
+{
+  vis.visit (*this);
+}
+
 void
 ExternalStaticItem::accept_vis (HIRExternalItemVisitor &vis)
 {
diff --git a/gcc/rust/typecheck/rust-hir-type-check-implitem.cc b/gcc/rust/typecheck/rust-hir-type-check-implitem.cc
index 6b4141a4270..8a9a3f35a32 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-implitem.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-implitem.cc
@@ -17,6 +17,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-hir-type-check-implitem.h"
+#include "rust-diagnostics.h"
 #include "rust-hir-type-check-base.h"
 #include "rust-hir-type-check-type.h"
 #include "rust-hir-type-check-expr.h"
@@ -183,6 +184,134 @@ TypeCheckTopLevelExternItem::visit (HIR::ExternalFunctionItem &function)
   resolved = fnType;
 }
 
+void
+TypeCheckTopLevelExternItem::visit (HIR::ExternalTypeItem &type)
+{
+  rust_sorry_at (type.get_locus (), "extern types are not supported yet");
+  //  auto binder_pin = context->push_clean_lifetime_resolver ();
+
+  //  std::vector<TyTy::SubstitutionParamMapping> substitutions;
+  //  if (function.has_generics ())
+  //    {
+  //      for (auto &generic_param : function.get_generic_params ())
+  // {
+  //   switch (generic_param.get ()->get_kind ())
+  //     {
+  //     case HIR::GenericParam::GenericKind::LIFETIME:
+  //       context->intern_and_insert_lifetime (
+  // 	static_cast<HIR::LifetimeParam &> (*generic_param)
+  // 	  .get_lifetime ());
+  //       // TODO: handle bounds
+  //       break;
+  //     case HIR::GenericParam::GenericKind::CONST:
+  //       // FIXME: Skipping Lifetime and Const completely until better
+  //       // handling.
+  //       break;
+
+  //       case HIR::GenericParam::GenericKind::TYPE: {
+  // 	auto param_type
+  // 	  = TypeResolveGenericParam::Resolve (generic_param.get ());
+  // 	context->insert_type (generic_param->get_mappings (),
+  // 			      param_type);
+
+  // 	substitutions.push_back (TyTy::SubstitutionParamMapping (
+  // 	  static_cast<HIR::TypeParam &> (*generic_param), param_type));
+  //       }
+  //       break;
+  //     }
+  // }
+  //    }
+
+  //  TyTy::RegionConstraints region_constraints;
+  //  if (function.has_where_clause ())
+  //    {
+  //      for (auto &where_clause_item : function.get_where_clause ().get_items
+  //      ())
+  // {
+  //   ResolveWhereClauseItem::Resolve (*where_clause_item.get (),
+  // 				   region_constraints);
+  // }
+  //    }
+
+  //  TyTy::BaseType *ret_type = nullptr;
+  //  if (!function.has_return_type ())
+  //    ret_type
+  //      = TyTy::TupleType::get_unit_type (function.get_mappings ().get_hirid
+  //      ());
+  //  else
+  //    {
+  //      auto resolved
+  // = TypeCheckType::Resolve (function.get_return_type ().get ());
+  //      if (resolved == nullptr)
+  // {
+  //   rust_error_at (function.get_locus (),
+  // 		 "failed to resolve return type");
+  //   return;
+  // }
+
+  //      ret_type = resolved->clone ();
+  //      ret_type->set_ref (
+  // function.get_return_type ()->get_mappings ().get_hirid ());
+  //    }
+
+  //  std::vector<std::pair<HIR::Pattern *, TyTy::BaseType *> > params;
+  //  for (auto &param : function.get_function_params ())
+  //    {
+  //      // get the name as well required for later on
+  //      auto param_tyty = TypeCheckType::Resolve (param.get_type ().get ());
+
+  //      // these are implicit mappings and not used
+  //      auto crate_num = mappings->get_current_crate ();
+  //      Analysis::NodeMapping mapping (crate_num, mappings->get_next_node_id
+  //      (),
+  // 			     mappings->get_next_hir_id (crate_num),
+  // 			     UNKNOWN_LOCAL_DEFID);
+
+  //      HIR::IdentifierPattern *param_pattern
+  // = new HIR::IdentifierPattern (mapping, param.get_param_name (),
+  // 			      UNDEF_LOCATION, false, Mutability::Imm,
+  // 			      std::unique_ptr<HIR::Pattern> (nullptr));
+
+  //      params.push_back (
+  // std::pair<HIR::Pattern *, TyTy::BaseType *> (param_pattern,
+  // 					     param_tyty));
+
+  //      context->insert_type (param.get_mappings (), param_tyty);
+
+  //      // FIXME do we need error checking for patterns here?
+  //      // see https://github.com/Rust-GCC/gccrs/issues/995
+  //    }
+
+  //  uint8_t flags = TyTy::FnType::FNTYPE_IS_EXTERN_FLAG;
+  //  if (function.is_variadic ())
+  //    {
+  //      flags |= TyTy::FnType::FNTYPE_IS_VARADIC_FLAG;
+  //      if (parent.get_abi () != Rust::ABI::C)
+  // {
+  //   rust_error_at (
+  //     function.get_locus (), ErrorCode::E0045,
+  //     "C-variadic function must have C or cdecl calling convention");
+  // }
+  //    }
+
+  //  RustIdent ident{
+  //    CanonicalPath::new_seg (function.get_mappings ().get_nodeid (),
+  // 		    function.get_item_name ().as_string ()),
+  //    function.get_locus ()};
+
+  //  auto fnType = new TyTy::FnType (
+  //    function.get_mappings ().get_hirid (),
+  //    function.get_mappings ().get_defid (),
+  //    function.get_item_name ().as_string (), ident, flags, parent.get_abi (),
+  //    std::move (params), ret_type, std::move (substitutions),
+  //    TyTy::SubstitutionArgumentMappings::empty (
+  //      context->get_lifetime_resolver ().get_num_bound_regions ()),
+  //    region_constraints);
+
+  //  context->insert_type (function.get_mappings (), fnType);
+  //  resolved = fnType;
+}
+
 TypeCheckImplItem::TypeCheckImplItem (
   HIR::ImplBlock *parent, TyTy::BaseType *self,
   std::vector<TyTy::SubstitutionParamMapping> substitutions)
diff --git a/gcc/rust/typecheck/rust-hir-type-check-implitem.h b/gcc/rust/typecheck/rust-hir-type-check-implitem.h
index 541b7280c1b..64eb208d15d 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-implitem.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-implitem.h
@@ -34,6 +34,7 @@ public:
 
   void visit (HIR::ExternalStaticItem &item) override;
   void visit (HIR::ExternalFunctionItem &function) override;
+  void visit (HIR::ExternalTypeItem &type) override;
 
 private:
   TypeCheckTopLevelExternItem (const HIR::ExternBlock &parent);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 026/125] gccrs: extern-types: Lower to HIR::ExternalTypeItem properly
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (23 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 025/125] gccrs: hir: Add ExternalTypeItem node Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 027/125] gccrs: Make DefaultResolver visit more of the AST Arthur Cohen
                   ` (98 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-extern.h: Lower to HIR::ExternalTypeItem nodes.
	* hir/tree/rust-hir-item.h (class ExternalTypeItem): Create private
	visibility by default as extern types have no visibility - add a comment
	about the correctness of this.
---
 gcc/rust/hir/rust-ast-lower-extern.h |  9 ++++++++-
 gcc/rust/hir/tree/rust-hir-item.h    | 10 ++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/hir/rust-ast-lower-extern.h b/gcc/rust/hir/rust-ast-lower-extern.h
index e495b16632d..f9e067c8e95 100644
--- a/gcc/rust/hir/rust-ast-lower-extern.h
+++ b/gcc/rust/hir/rust-ast-lower-extern.h
@@ -22,6 +22,7 @@
 #include "rust-ast-lower-base.h"
 #include "rust-ast-lower-type.h"
 #include "rust-ast-lower.h"
+#include "rust-hir-full-decls.h"
 
 namespace Rust {
 namespace HIR {
@@ -116,7 +117,13 @@ public:
 
   void visit (AST::ExternalTypeItem &type) override
   {
-    rust_sorry_at (type.get_locus (), "extern types are not implemented yet");
+    auto crate_num = mappings->get_current_crate ();
+    Analysis::NodeMapping mapping (crate_num, type.get_node_id (),
+				   mappings->get_next_hir_id (crate_num),
+				   mappings->get_next_localdef_id (crate_num));
+
+    translated = new HIR::ExternalTypeItem (mapping, type.get_identifier (),
+					    type.get_locus ());
   }
 
 private:
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 40093a2ad93..3bd0102d4dc 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -3152,16 +3152,20 @@ protected:
 
 class ExternalTypeItem : public ExternalItem
 {
+public:
   ExternalTypeItem (Analysis::NodeMapping mappings, Identifier item_name,
-		    Visibility vis, AST::AttrVec outer_attrs, location_t locus)
+		    location_t locus)
     : ExternalItem (std::move (mappings), std::move (item_name),
-		    std::move (vis), std::move (outer_attrs), locus)
+		    Visibility (Visibility::PRIVATE),
+		    /* FIXME: Is that correct? */
+		    {}, locus)
   {}
 
   ExternalTypeItem (ExternalTypeItem const &other) : ExternalItem (other) {}
 
   ExternalTypeItem (ExternalTypeItem &&other) = default;
   ExternalTypeItem &operator= (ExternalTypeItem &&other) = default;
+  ExternalTypeItem &operator= (ExternalTypeItem const &other) = default;
 
   std::string as_string () const override;
 
@@ -3171,6 +3175,8 @@ class ExternalTypeItem : public ExternalItem
   ExternKind get_extern_kind () override { return ExternKind::Type; }
 
 protected:
+  /* Use covariance to implement clone function as returning this object
+   * rather than base */
   ExternalTypeItem *clone_external_item_impl () const override
   {
     return new ExternalTypeItem (*this);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 027/125] gccrs: Make DefaultResolver visit more of the AST
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (24 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 026/125] gccrs: extern-types: Lower to HIR::ExternalTypeItem properly Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 028/125] gccrs: ast: Add base nodes for FormatArgs Arthur Cohen
                   ` (97 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc
	(DefaultResolver::visit): Visit inner AST nodes of ClosureExprInner,
	ClosureExprInnerTyped, IfExpr, IfExprConseqElse, MatchExpr,
	PathInExpression, EnumItemTuple, EnumItemStruct, and
	EnumItemDiscriminant.
	* ast/rust-item.h
	(EnumItemDiscriminant::has_expr): New function.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/ast/rust-item.h                  |   2 +
 gcc/rust/resolve/rust-default-resolver.cc | 105 ++++++++++++++++++----
 2 files changed, 91 insertions(+), 16 deletions(-)

diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index 0911719b716..44963ba386e 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -2081,6 +2081,8 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
+  bool has_expr () { return expression != nullptr; }
+
   // TODO: is this better? Or is a "vis_block" better?
   std::unique_ptr<Expr> &get_expr ()
   {
diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 9f7fda4adaa..28f04a10839 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -177,12 +177,43 @@ DefaultResolver::visit (AST::StructExprFieldIndexValue &)
 {}
 
 void
-DefaultResolver::visit (AST::ClosureExprInner &)
-{}
+DefaultResolver::visit (AST::ClosureExprInner &expr)
+{
+  if (expr.is_marked_for_strip ())
+    return;
+
+  for (auto &param : expr.get_params ())
+    {
+      if (param.is_error ())
+	continue;
+
+      param.get_pattern ()->accept_vis (*this);
+      if (param.has_type_given ())
+	param.get_type ()->accept_vis (*this);
+    }
+
+  expr.get_definition_expr ()->accept_vis (*this);
+}
 
 void
-DefaultResolver::visit (AST::ClosureExprInnerTyped &)
-{}
+DefaultResolver::visit (AST::ClosureExprInnerTyped &expr)
+{
+  if (expr.is_marked_for_strip ())
+    return;
+
+  for (auto &param : expr.get_params ())
+    {
+      if (param.is_error ())
+	continue;
+
+      param.get_pattern ()->accept_vis (*this);
+      if (param.has_type_given ())
+	param.get_type ()->accept_vis (*this);
+    }
+
+  expr.get_definition_block ()->accept_vis (*this);
+  expr.get_return_type ()->accept_vis (*this);
+}
 
 void
 DefaultResolver::visit (AST::ContinueExpr &expr)
@@ -230,11 +261,18 @@ DefaultResolver::visit (AST::WhileLetLoopExpr &expr)
 
 void
 DefaultResolver::visit (AST::IfExpr &expr)
-{}
+{
+  expr.get_condition_expr ()->accept_vis (*this);
+  expr.get_if_block ()->accept_vis (*this);
+}
 
 void
-DefaultResolver::visit (AST::IfExprConseqElse &)
-{}
+DefaultResolver::visit (AST::IfExprConseqElse &expr)
+{
+  expr.get_condition_expr ()->accept_vis (*this);
+  expr.get_if_block ()->accept_vis (*this);
+  expr.get_else_block ()->accept_vis (*this);
+}
 
 void
 DefaultResolver::visit (AST::IfLetExpr &expr)
@@ -246,7 +284,20 @@ DefaultResolver::visit (AST::IfLetExprConseqElse &)
 
 void
 DefaultResolver::visit (AST::MatchExpr &expr)
-{}
+{
+  if (expr.is_marked_for_strip ())
+    return;
+
+  expr.get_scrutinee_expr ()->accept_vis (*this);
+  for (auto &arm : expr.get_match_cases ())
+    {
+      arm.get_expr ()->accept_vis (*this);
+      for (auto &pat : arm.get_arm ().get_patterns ())
+	pat->accept_vis (*this);
+      if (arm.get_arm ().has_match_arm_guard ())
+	arm.get_arm ().get_guard_expr ()->accept_vis (*this);
+    }
+}
 
 void
 DefaultResolver::visit (AST::AwaitExpr &expr)
@@ -277,8 +328,21 @@ DefaultResolver::visit (AST::ConstGenericParam &)
 {}
 
 void
-DefaultResolver::visit (AST::PathInExpression &)
-{}
+DefaultResolver::visit (AST::PathInExpression &expr)
+{
+  for (auto &seg : expr.get_segments ())
+    if (seg.has_generic_args ())
+      {
+	auto &args = seg.get_generic_args ();
+	for (auto &arg : args.get_generic_args ())
+	  arg.accept_vis (*this);
+	for (auto &arg : args.get_binding_args ())
+	  if (!arg.is_error ())
+	    arg.get_type ()->accept_vis (*this);
+	for (auto &arg : args.get_lifetime_args ())
+	  arg.accept_vis (*this);
+      }
+}
 
 void
 DefaultResolver::visit (AST::TypePathSegmentGeneric &)
@@ -373,16 +437,25 @@ DefaultResolver::visit (AST::EnumItem &)
 {}
 
 void
-DefaultResolver::visit (AST::EnumItemTuple &)
-{}
+DefaultResolver::visit (AST::EnumItemTuple &item)
+{
+  for (auto &field : item.get_tuple_fields ())
+    field.get_field_type ()->accept_vis (*this);
+}
 
 void
-DefaultResolver::visit (AST::EnumItemStruct &)
-{}
+DefaultResolver::visit (AST::EnumItemStruct &item)
+{
+  for (auto &field : item.get_struct_fields ())
+    field.get_field_type ()->accept_vis (*this);
+}
 
 void
-DefaultResolver::visit (AST::EnumItemDiscriminant &)
-{}
+DefaultResolver::visit (AST::EnumItemDiscriminant &item)
+{
+  if (item.has_expr ())
+    item.get_expr ()->accept_vis (*this);
+}
 
 void
 DefaultResolver::visit (AST::ConstantItem &item)
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 028/125] gccrs: ast: Add base nodes for FormatArgs
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (25 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 027/125] gccrs: Make DefaultResolver visit more of the AST Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 029/125] gccrs: macro-builtins: Add newline generic format_args!() handler Arthur Cohen
                   ` (96 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

This commit adds a base for creating AST FormatArgs nodes after expanding
invocations of `format_args!()`. These nodes will then be expanded to
the proper runtime function calls (to core::fmt::rt) during the AST
lowering.

gcc/rust/ChangeLog:

	* ast/rust-builtin-ast-nodes.h: New file.
	* ast/rust-ast-full-decls.h (class FormatArgs): Declare new class.
	* ast/rust-ast-collector.cc: Handle FormatArgs nodes properly.
	* ast/rust-ast-collector.h: Likewise.
	* ast/rust-ast-full.h: Likewise.
	* ast/rust-ast-visitor.cc: Likewise.
	* ast/rust-ast-visitor.h: Likewise.
	* ast/rust-ast.cc: Likewise.
	* ast/rust-ast.h: Likewise.
	* expand/rust-derive.h: Likewise.
	* hir/rust-ast-lower-base.cc: Likewise.
	* hir/rust-ast-lower-base.h: Likewise.
	* hir/rust-ast-lower-expr.cc: Likewise.
	* hir/rust-ast-lower-expr.h: Likewise.
	* resolve/rust-ast-resolve-base.cc: Likewise.
	* resolve/rust-ast-resolve-base.h: Likewise.
---
 gcc/rust/ast/rust-ast-collector.cc        |   8 ++
 gcc/rust/ast/rust-ast-collector.h         |   2 +
 gcc/rust/ast/rust-ast-full-decls.h        |   3 +
 gcc/rust/ast/rust-ast-full.h              |   1 +
 gcc/rust/ast/rust-ast-visitor.cc          |   6 +
 gcc/rust/ast/rust-ast-visitor.h           |   5 +
 gcc/rust/ast/rust-ast.cc                  |   6 +
 gcc/rust/ast/rust-ast.h                   |   1 +
 gcc/rust/ast/rust-builtin-ast-nodes.h     | 129 ++++++++++++++++++++++
 gcc/rust/expand/rust-derive.h             |   1 +
 gcc/rust/hir/rust-ast-lower-base.cc       |   5 +
 gcc/rust/hir/rust-ast-lower-base.h        |   3 +
 gcc/rust/hir/rust-ast-lower-expr.cc       |   8 ++
 gcc/rust/hir/rust-ast-lower-expr.h        |   4 +
 gcc/rust/resolve/rust-ast-resolve-base.cc |   6 +
 gcc/rust/resolve/rust-ast-resolve-base.h  |   3 +
 16 files changed, 191 insertions(+)
 create mode 100644 gcc/rust/ast/rust-builtin-ast-nodes.h

diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index 181f1b100be..b8ec62367bc 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -16,6 +16,8 @@
 // along with GCC; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 #include "rust-ast-collector.h"
+#include "rust-ast.h"
+#include "rust-diagnostics.h"
 #include "rust-item.h"
 #include "rust-keyword-values.h"
 
@@ -2805,5 +2807,11 @@ TokenCollector::visit (BareFunctionType &type)
     }
 }
 
+void
+TokenCollector::visit (AST::FormatArgs &fmt)
+{
+  rust_sorry_at (0, "unimplemented format_args!() visitor");
+}
+
 } // namespace AST
 } // namespace Rust
diff --git a/gcc/rust/ast/rust-ast-collector.h b/gcc/rust/ast/rust-ast-collector.h
index cf97c185a26..ec695ef5b31 100644
--- a/gcc/rust/ast/rust-ast-collector.h
+++ b/gcc/rust/ast/rust-ast-collector.h
@@ -398,6 +398,8 @@ public:
   void visit (SliceType &type);
   void visit (InferredType &type);
   void visit (BareFunctionType &type);
+
+  void visit (FormatArgs &fmt);
 };
 } // namespace AST
 
diff --git a/gcc/rust/ast/rust-ast-full-decls.h b/gcc/rust/ast/rust-ast-full-decls.h
index c96bbfb07d9..8d5c8dbc821 100644
--- a/gcc/rust/ast/rust-ast-full-decls.h
+++ b/gcc/rust/ast/rust-ast-full-decls.h
@@ -267,6 +267,9 @@ class SliceType;
 class InferredType;
 struct MaybeNamedParam;
 class BareFunctionType;
+
+// rust-builtin-ast-nodes.h
+class FormatArgs;
 } // namespace AST
 } // namespace Rust
 
diff --git a/gcc/rust/ast/rust-ast-full.h b/gcc/rust/ast/rust-ast-full.h
index f2152193a13..ebd38f2520c 100644
--- a/gcc/rust/ast/rust-ast-full.h
+++ b/gcc/rust/ast/rust-ast-full.h
@@ -28,5 +28,6 @@
 #include "rust-stmt.h"
 #include "rust-type.h"
 #include "rust-macro.h"
+#include "rust-builtin-ast-nodes.h"
 
 #endif
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc
index 27b9aa47d99..c72e2d72f6d 100644
--- a/gcc/rust/ast/rust-ast-visitor.cc
+++ b/gcc/rust/ast/rust-ast-visitor.cc
@@ -1395,6 +1395,12 @@ DefaultASTVisitor::visit (AST::BareFunctionType &type)
     visit (type.get_return_type ());
 }
 
+void
+DefaultASTVisitor::visit (AST::FormatArgs &)
+{
+  // FIXME: Do we have anything to do? any subnodes to visit? Probably, right?
+}
+
 void
 DefaultASTVisitor::visit (AST::VariadicParam &param)
 {
diff --git a/gcc/rust/ast/rust-ast-visitor.h b/gcc/rust/ast/rust-ast-visitor.h
index 6c9715eb077..c5c9a025ba6 100644
--- a/gcc/rust/ast/rust-ast-visitor.h
+++ b/gcc/rust/ast/rust-ast-visitor.h
@@ -229,6 +229,9 @@ public:
   virtual void visit (InferredType &type) = 0;
   virtual void visit (BareFunctionType &type) = 0;
 
+  // special AST nodes for certain builtin macros such as `asm!()`
+  virtual void visit (FormatArgs &fmt) = 0;
+
   // TODO: rust-cond-compilation.h visiting? not currently used
 };
 
@@ -390,6 +393,7 @@ protected:
   virtual void visit (AST::SelfParam &self) override;
   virtual void visit (AST::FunctionParam &param) override;
   virtual void visit (AST::VariadicParam &param) override;
+  virtual void visit (AST::FormatArgs &fmt) override;
 
   template <typename T> void visit (T &node) { node.accept_vis (*this); }
 
@@ -422,6 +426,7 @@ protected:
   virtual void visit (AST::MacroTranscriber &transcriber);
   virtual void visit (AST::StructPatternElements &spe);
   virtual void visit (AST::MaybeNamedParam &param);
+
   void visit (AST::Attribute &attribute) {}
 
   template <typename T> void visit_outer_attrs (T &node)
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index 90fe9269404..5d571b46622 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -5048,6 +5048,12 @@ MetaWord::accept_vis (ASTVisitor &vis)
   vis.visit (*this);
 }
 
+void
+FormatArgs::accept_vis (ASTVisitor &vis)
+{
+  vis.visit (*this);
+}
+
 } // namespace AST
 
 std::ostream &
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 1422d77eade..c4d5858dd63 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -2029,6 +2029,7 @@ public:
 class PathExpr : public ExprWithoutBlock
 {
 };
+
 } // namespace AST
 } // namespace Rust
 
diff --git a/gcc/rust/ast/rust-builtin-ast-nodes.h b/gcc/rust/ast/rust-builtin-ast-nodes.h
new file mode 100644
index 00000000000..3998fbfb4a7
--- /dev/null
+++ b/gcc/rust/ast/rust-builtin-ast-nodes.h
@@ -0,0 +1,129 @@
+// Copyright (C) 2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_AST_BUILTIN_NODES_H
+#define RUST_AST_BUILTIN_NODES_H
+
+#include "rust-system.h"
+#include "line-map.h"
+#include "optional.h"
+#include "rust-ast.h"
+#include "rust-fmt.h"
+
+namespace Rust {
+namespace AST {
+
+// Definitions, from rustc's `FormatArgs` AST struct
+// https://github.com/rust-lang/rust/blob/1be468815c/compiler/rustc_ast/src/format.rs
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+// └──────────────────────────────────────────────┘
+//                     FormatArgs
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+//                                     └─────────┘
+//                                      argument
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+//              └───────────────────┘
+//                     template
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+//               └────┘└─────────┘└┘
+//                      pieces
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+//               └────┘           └┘
+//                   literal pieces
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+//                     └─────────┘
+//                     placeholder
+//
+// format_args!("hello {abc:.xyz$}!!", abc="world");
+//                      └─┘  └─┘
+//                      positions (could be names, numbers, empty, or `*`)
+
+class FormatArgumentKind
+{
+public:
+  Identifier &get_ident ()
+  {
+    rust_assert (kind == Kind::Captured || kind == Kind::Named);
+
+    return ident.value ();
+  }
+
+private:
+  enum class Kind
+  {
+    Normal,
+    Named,
+    Captured,
+  } kind;
+
+  tl::optional<Identifier> ident;
+};
+
+class FormatArgument
+{
+  FormatArgumentKind kind;
+  std::unique_ptr<Expr> expr;
+};
+
+class FormatArguments
+{
+  std::vector<FormatArgument> args;
+};
+
+// TODO: Format documentation better
+// Having a separate AST node for `format_args!()` expansion allows some
+// important optimizations which help reduce generated code a lot. For example,
+// turning `format_args!("a {} {} {}", 15, "hey", 'a')` directly into
+// `format_args!("a 15 hey a")`, since all arguments are literals. Or,
+// flattening imbricated `format_args!()` calls: `format_args!("heyo {}",
+// format_args!("result: {}", some_result))` -> `format_args!("heyo result: {}",
+// some_result)`
+// FIXME: Move to rust-macro.h
+class FormatArgs : public Visitable
+{
+public:
+  enum class Newline
+  {
+    Yes,
+    No
+  };
+
+  FormatArgs (location_t loc, Fmt::PieceSlice template_str,
+	      FormatArguments arguments)
+    : loc (loc), template_str (std::move (template_str)),
+      arguments (std::move (arguments))
+  {}
+
+  void accept_vis (AST::ASTVisitor &vis);
+
+private:
+  location_t loc;
+  Fmt::PieceSlice template_str;
+  FormatArguments arguments;
+};
+
+} // namespace AST
+} // namespace Rust
+
+#endif // ! RUST_AST_BUILTIN_NODES_H
diff --git a/gcc/rust/expand/rust-derive.h b/gcc/rust/expand/rust-derive.h
index 8fe29c0db75..f953c3decbf 100644
--- a/gcc/rust/expand/rust-derive.h
+++ b/gcc/rust/expand/rust-derive.h
@@ -221,6 +221,7 @@ private:
   virtual void visit (SelfParam &param) override final{};
   virtual void visit (FunctionParam &param) override final{};
   virtual void visit (VariadicParam &param) override final{};
+  virtual void visit (FormatArgs &param) override final{};
 };
 
 } // namespace AST
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index bcc4797df77..fa37d62d026 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -20,6 +20,7 @@
 #include "rust-ast-lower-type.h"
 #include "rust-ast-lower-pattern.h"
 #include "rust-ast-lower-extern.h"
+#include "rust-ast.h"
 #include "rust-attribute-values.h"
 #include "rust-item.h"
 #include "rust-system.h"
@@ -523,6 +524,10 @@ void
 ASTLoweringBase::visit (AST::SelfParam &param)
 {}
 
+void
+ASTLoweringBase::visit (AST::FormatArgs &fmt)
+{}
+
 HIR::Lifetime
 ASTLoweringBase::lower_lifetime (AST::Lifetime &lifetime,
 				 bool default_to_static_lifetime)
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index d7b94ac8a70..7b0ce375f83 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -19,6 +19,7 @@
 #ifndef RUST_AST_LOWER_BASE
 #define RUST_AST_LOWER_BASE
 
+#include "rust-ast.h"
 #include "rust-system.h"
 #include "rust-ast-full.h"
 #include "rust-ast-visitor.h"
@@ -253,6 +254,8 @@ public:
   virtual void visit (AST::VariadicParam &param);
   virtual void visit (AST::SelfParam &param);
 
+  virtual void visit (AST::FormatArgs &fmt);
+
 protected:
   ASTLoweringBase ()
     : mappings (Analysis::Mappings::get ()),
diff --git a/gcc/rust/hir/rust-ast-lower-expr.cc b/gcc/rust/hir/rust-ast-lower-expr.cc
index 35deb57abe6..8e07b19df4c 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.cc
+++ b/gcc/rust/hir/rust-ast-lower-expr.cc
@@ -22,6 +22,8 @@
 #include "rust-ast-lower-struct-field-expr.h"
 #include "rust-ast-lower-pattern.h"
 #include "rust-ast-lower-type.h"
+#include "rust-ast.h"
+#include "rust-diagnostics.h"
 
 namespace Rust {
 namespace HIR {
@@ -828,5 +830,11 @@ ASTLoweringExpr::visit (AST::ClosureExprInnerTyped &expr)
 			    expr.get_locus ());
 }
 
+void
+ASTLoweringExpr::visit (AST::FormatArgs &fmt)
+{
+  rust_sorry_at (0, "unimplemented format_args!() visitor");
+}
+
 } // namespace HIR
 } // namespace Rust
diff --git a/gcc/rust/hir/rust-ast-lower-expr.h b/gcc/rust/hir/rust-ast-lower-expr.h
index 56da9d1ab88..168dd014002 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.h
+++ b/gcc/rust/hir/rust-ast-lower-expr.h
@@ -20,6 +20,7 @@
 #define RUST_AST_LOWER_EXPR
 
 #include "rust-ast-lower-base.h"
+#include "rust-ast.h"
 
 namespace Rust {
 namespace HIR {
@@ -121,6 +122,9 @@ public:
   void visit (AST::ClosureExprInner &expr) override;
   void visit (AST::ClosureExprInnerTyped &expr) override;
 
+  // Extra visitor for FormatArgs nodes
+  void visit (AST::FormatArgs &fmt) override;
+
 private:
   ASTLoweringExpr ();
 
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc
index c88bd58860a..04a0bb65ec2 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-base.cc
@@ -650,5 +650,11 @@ void
 ResolverBase::visit (AST::FunctionParam &)
 {}
 
+void
+ResolverBase::visit (AST::FormatArgs &fmt)
+{
+  rust_sorry_at (0, "unimplemented format_args!() visitor");
+}
+
 } // namespace Resolver
 } // namespace Rust
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.h b/gcc/rust/resolve/rust-ast-resolve-base.h
index 9bc64331f5a..3b4d28618e4 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.h
+++ b/gcc/rust/resolve/rust-ast-resolve-base.h
@@ -20,6 +20,7 @@
 #define RUST_AST_RESOLVE_BASE_H
 
 #include "rust-ast-visitor.h"
+#include "rust-ast.h"
 #include "rust-name-resolver.h"
 #include "rust-diagnostics.h"
 #include "rust-location.h"
@@ -198,6 +199,8 @@ public:
   void visit (AST::VariadicParam &param);
   void visit (AST::SelfParam &param);
 
+  void visit (AST::FormatArgs &fmt);
+
 protected:
   ResolverBase ()
     : resolver (Resolver::get ()), mappings (Analysis::Mappings::get ()),
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 029/125] gccrs: macro-builtins: Add newline generic format_args!() handler
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (26 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 028/125] gccrs: ast: Add base nodes for FormatArgs Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 030/125] gccrs: parser: Add peek(n) method to parser Arthur Cohen
                   ` (95 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (format_args_maker): New function.
	(try_expand_many_expr): Add comment about reworking function.
	(MacroBuiltin::format_args_handler): Add newline parameter.
	* expand/rust-macro-builtins.h: Likewise.
---
 gcc/rust/expand/rust-macro-builtins.cc | 69 +++++++++++++++++++++++---
 gcc/rust/expand/rust-macro-builtins.h  |  4 +-
 2 files changed, 65 insertions(+), 8 deletions(-)

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index f103759acdd..9e6716c5975 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -17,6 +17,8 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "libproc_macro_internal/tokenstream.h"
+#include "rust-ast-full-decls.h"
+#include "rust-builtin-ast-nodes.h"
 #include "rust-token-converter.h"
 #include "rust-system.h"
 #include "rust-macro-builtins.h"
@@ -78,6 +80,14 @@ const BiMap<std::string, BuiltinMacro> MacroBuiltin::builtins = {{
 
 }};
 
+AST::MacroTranscriberFunc
+format_args_maker (AST::FormatArgs::Newline nl)
+{
+  return [nl] (location_t loc, AST::MacroInvocData &invoc) {
+    return MacroBuiltin::format_args_handler (loc, invoc, nl);
+  };
+}
+
 std::unordered_map<std::string, AST::MacroTranscriberFunc>
   MacroBuiltin::builtin_transcribers = {
     {"assert", MacroBuiltin::assert_handler},
@@ -92,10 +102,10 @@ std::unordered_map<std::string, AST::MacroTranscriberFunc>
     {"env", MacroBuiltin::env_handler},
     {"cfg", MacroBuiltin::cfg_handler},
     {"include", MacroBuiltin::include_handler},
-    {"format_args", MacroBuiltin::format_args_handler},
+    {"format_args", format_args_maker (AST::FormatArgs::Newline::No)},
+    {"format_args_nl", format_args_maker (AST::FormatArgs::Newline::Yes)},
     /* Unimplemented macro builtins */
     {"option_env", MacroBuiltin::sorry},
-    {"format_args_nl", MacroBuiltin::sorry},
     {"concat_idents", MacroBuiltin::sorry},
     {"module_path", MacroBuiltin::sorry},
     {"asm", MacroBuiltin::sorry},
@@ -286,6 +296,8 @@ try_expand_many_expr (Parser<MacroInvocLexer> &parser,
    and return the LiteralExpr for it. Allow for an optional trailing comma,
    but otherwise enforce that these are the only tokens.  */
 
+// FIXME(Arthur): This function needs a rework - it should not emit errors, it
+// should probably be smaller
 std::unique_ptr<AST::Expr>
 parse_single_string_literal (BuiltinMacro kind,
 			     AST::DelimTokenTree &invoc_token_tree,
@@ -946,17 +958,31 @@ MacroBuiltin::stringify_handler (location_t invoc_locus,
 
 tl::optional<AST::Fragment>
 MacroBuiltin::format_args_handler (location_t invoc_locus,
-				   AST::MacroInvocData &invoc)
+				   AST::MacroInvocData &invoc,
+				   AST::FormatArgs::Newline nl)
 {
+  // Remove the delimiters from the macro invocation:
+  // the invoc data for `format_args!(fmt, arg1, arg2)` is `(fmt, arg1, arg2)`,
+  // so we pop the front and back to remove the parentheses (or curly brackets,
+  // or brackets)
   auto tokens = invoc.get_delim_tok_tree ().to_token_stream ();
   tokens.erase (tokens.begin ());
   tokens.pop_back ();
 
-  std::stringstream stream;
-  for (const auto &tok : tokens)
-    stream << tok->as_string () << ' ';
+  auto append_newline = nl == AST::FormatArgs::Newline::Yes ? true : false;
+  auto fmt_arg
+    = parse_single_string_literal (append_newline ? BuiltinMacro::FormatArgsNl
+						  : BuiltinMacro::FormatArgs,
+				   invoc.get_delim_tok_tree (), invoc_locus,
+				   invoc.get_expander ());
 
-  rust_debug ("[ARTHU]: `%s`", stream.str ().c_str ());
+  if (!fmt_arg->is_literal ())
+    {
+      rust_sorry_at (
+	invoc_locus,
+	"cannot yet use eager macro invocations as format strings");
+      return AST::Fragment::create_empty ();
+    }
 
   // FIXME: We need to handle this
   // // if it is not a literal, it's an eager macro invocation - return it
@@ -967,8 +993,37 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
   // 	    token_tree.to_token_stream ());
   //   }
 
+  auto fmt_str = static_cast<AST::LiteralExpr &> (*fmt_arg.get ());
+
+  // Switch on the format string to know if the string is raw or cooked
+  switch (fmt_str.get_lit_type ())
+    {
+    // case AST::Literal::RAW_STRING:
+    case AST::Literal::STRING:
+      break;
+    case AST::Literal::CHAR:
+    case AST::Literal::BYTE:
+    case AST::Literal::BYTE_STRING:
+    case AST::Literal::INT:
+    case AST::Literal::FLOAT:
+    case AST::Literal::BOOL:
+    case AST::Literal::ERROR:
+      rust_unreachable ();
+    }
+
+  std::stringstream stream;
+  for (const auto &tok : tokens)
+    stream << tok->as_string () << ' ';
+
+  rust_debug ("[ARTHUR]: `%s`", stream.str ().c_str ());
+
   auto pieces = Fmt::Pieces::collect (stream.str ());
 
+  // TODO:
+  // do the transformation into an AST::FormatArgs node
+  // return that
+  // expand it during lowering
+
   return AST::Fragment::create_empty ();
 }
 
diff --git a/gcc/rust/expand/rust-macro-builtins.h b/gcc/rust/expand/rust-macro-builtins.h
index 1d6b30b5933..62961561716 100644
--- a/gcc/rust/expand/rust-macro-builtins.h
+++ b/gcc/rust/expand/rust-macro-builtins.h
@@ -20,6 +20,7 @@
 #define RUST_MACRO_BUILTINS_H
 
 #include "rust-ast.h"
+#include "rust-builtin-ast-nodes.h"
 #include "rust-ast-fragment.h"
 #include "rust-location.h"
 #include "bi-map.h"
@@ -158,7 +159,8 @@ public:
 						   AST::MacroInvocData &invoc);
 
   static tl::optional<AST::Fragment>
-  format_args_handler (location_t invoc_locus, AST::MacroInvocData &invoc);
+  format_args_handler (location_t invoc_locus, AST::MacroInvocData &invoc,
+		       AST::FormatArgs::Newline nl);
 
   static tl::optional<AST::Fragment> sorry (location_t invoc_locus,
 					    AST::MacroInvocData &invoc);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 030/125] gccrs: parser: Add peek(n) method to parser
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (27 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 029/125] gccrs: macro-builtins: Add newline generic format_args!() handler Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 031/125] gccrs: format-args: Fix Rust interface and add input parsing Arthur Cohen
                   ` (94 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* parse/rust-parse.h: New method.
---
 gcc/rust/parse/rust-parse.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 1614d19e4a5..8c8bf96eb8d 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -725,6 +725,7 @@ public:
   const ManagedTokenSource &get_token_source () const { return lexer; }
 
   const_TokenPtr peek_current_token () { return lexer.peek_token (0); }
+  const_TokenPtr peek (int n) { return lexer.peek_token (n); }
 
 private:
   // The token source (usually lexer) associated with the parser.
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 031/125] gccrs: format-args: Fix Rust interface and add input parsing.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (28 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 030/125] gccrs: parser: Add peek(n) method to parser Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 032/125] gccrs: lower: Add base for lowering FormatArgs nodes Arthur Cohen
                   ` (93 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-ast.cc: Make FormatArgs inherit from AST::Expr
	* ast/rust-builtin-ast-nodes.h: Improve FormatArg* nodes and helpers.
	* ast/rust-fmt.cc (Pieces::collect): Fix interface to match FFI function.
	* ast/rust-fmt.h (collect_pieces): Likewise.
	(struct Pieces): Add append_newline parameter.
	* expand/rust-macro-builtins.cc: Add proper parsing of format_args
	input.
	* hir/rust-ast-lower-base.cc: Include diagnostics header.

libgrust/ChangeLog:

	* libformat_parser/src/lib.rs: Switch interface to use more parser
	parameters.
	* libformat_parser/src/bin.rs: Use new interface.
---
 gcc/rust/ast/rust-ast.cc               |  51 +++++++
 gcc/rust/ast/rust-builtin-ast-nodes.h  | 133 ++++++++++++++++--
 gcc/rust/ast/rust-fmt.cc               |  38 +++++-
 gcc/rust/ast/rust-fmt.h                |  21 ++-
 gcc/rust/expand/rust-macro-builtins.cc | 182 +++++++++++++++++++------
 gcc/rust/hir/rust-ast-lower-base.cc    |   1 +
 libgrust/libformat_parser/src/bin.rs   |   5 +-
 libgrust/libformat_parser/src/lib.rs   |  63 ++++++---
 8 files changed, 416 insertions(+), 78 deletions(-)

diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index 5d571b46622..f3dabc6cd0f 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "rust-ast.h"
 #include "optional.h"
+#include "rust-builtin-ast-nodes.h"
 #include "rust-system.h"
 #include "rust-ast-full.h"
 #include "rust-diagnostics.h"
@@ -5054,6 +5055,56 @@ FormatArgs::accept_vis (ASTVisitor &vis)
   vis.visit (*this);
 }
 
+std::string
+FormatArgs::as_string () const
+{
+  // FIXME(Arthur): Improve
+  return "FormatArgs";
+}
+
+location_t
+FormatArgs::get_locus () const
+{
+  rust_unreachable ();
+}
+
+bool
+FormatArgs::is_expr_without_block () const
+{
+  return false;
+}
+
+void
+FormatArgs::mark_for_strip ()
+{
+  marked_for_strip = true;
+}
+
+bool
+FormatArgs::is_marked_for_strip () const
+{
+  return marked_for_strip;
+}
+
+std::vector<Attribute> &
+FormatArgs::get_outer_attrs ()
+{
+  rust_unreachable ();
+}
+
+void FormatArgs::set_outer_attrs (std::vector<Attribute>)
+{
+  rust_unreachable ();
+}
+
+Expr *
+FormatArgs::clone_expr_impl () const
+{
+  std::cerr << "[ARTHUR] cloning FormatArgs! " << std::endl;
+
+  return new FormatArgs (*this);
+}
+
 } // namespace AST
 
 std::ostream &
diff --git a/gcc/rust/ast/rust-builtin-ast-nodes.h b/gcc/rust/ast/rust-builtin-ast-nodes.h
index 3998fbfb4a7..6e267173a55 100644
--- a/gcc/rust/ast/rust-builtin-ast-nodes.h
+++ b/gcc/rust/ast/rust-builtin-ast-nodes.h
@@ -59,9 +59,17 @@ namespace AST {
 //                      └─┘  └─┘
 //                      positions (could be names, numbers, empty, or `*`)
 
+// FIXME: Merge with the class below this one?
 class FormatArgumentKind
 {
 public:
+  enum class Kind
+  {
+    Normal,
+    Named,
+    Captured,
+  } kind;
+
   Identifier &get_ident ()
   {
     rust_assert (kind == Kind::Captured || kind == Kind::Named);
@@ -69,25 +77,90 @@ public:
     return ident.value ();
   }
 
-private:
-  enum class Kind
+  FormatArgumentKind (Kind kind, tl::optional<Identifier> ident)
+    : kind (kind), ident (ident)
+  {}
+
+  FormatArgumentKind (const FormatArgumentKind &other)
   {
-    Normal,
-    Named,
-    Captured,
-  } kind;
+    kind = other.kind;
+    ident = other.ident;
+  }
+
+  FormatArgumentKind operator= (const FormatArgumentKind &other)
+  {
+    kind = other.kind;
+    ident = other.ident;
 
+    return *this;
+  }
+
+private:
   tl::optional<Identifier> ident;
 };
 
 class FormatArgument
 {
+public:
+  static FormatArgument normal (std::unique_ptr<Expr> expr)
+  {
+    return FormatArgument (FormatArgumentKind::Kind::Normal, tl::nullopt,
+			   std::move (expr));
+  }
+
+  static FormatArgument named (Identifier ident, std::unique_ptr<Expr> expr)
+  {
+    return FormatArgument (FormatArgumentKind::Kind::Named, ident,
+			   std::move (expr));
+  }
+
+  static FormatArgument captured (Identifier ident, std::unique_ptr<Expr> expr)
+  {
+    return FormatArgument (FormatArgumentKind::Kind::Captured, ident,
+			   std::move (expr));
+  }
+
+  FormatArgument (const FormatArgument &other)
+    : kind (other.kind), expr (other.expr->clone_expr ())
+  {}
+
+  FormatArgument operator= (const FormatArgument &other)
+  {
+    kind = other.kind;
+    expr = other.expr->clone_expr ();
+
+    return *this;
+  }
+
+private:
+  FormatArgument (FormatArgumentKind::Kind kind, tl::optional<Identifier> ident,
+		  std::unique_ptr<Expr> expr)
+    : kind (FormatArgumentKind (kind, ident)), expr (std::move (expr))
+  {}
+
   FormatArgumentKind kind;
   std::unique_ptr<Expr> expr;
 };
 
 class FormatArguments
 {
+public:
+  FormatArguments () {}
+  FormatArguments (FormatArguments &&) = default;
+  FormatArguments (const FormatArguments &other)
+  {
+    args = std::vector<FormatArgument> ();
+    args.reserve (other.args.size ());
+
+    for (const auto &arg : other.args)
+      args.emplace_back (arg);
+  };
+
+  FormatArguments &operator= (const FormatArguments &other) = default;
+
+  void push (FormatArgument &&elt) { args.emplace_back (std::move (elt)); }
+
+private:
   std::vector<FormatArgument> args;
 };
 
@@ -100,7 +173,7 @@ class FormatArguments
 // format_args!("result: {}", some_result))` -> `format_args!("heyo result: {}",
 // some_result)`
 // FIXME: Move to rust-macro.h
-class FormatArgs : public Visitable
+class FormatArgs : public Expr
 {
 public:
   enum class Newline
@@ -109,18 +182,56 @@ public:
     No
   };
 
-  FormatArgs (location_t loc, Fmt::PieceSlice template_str,
-	      FormatArguments arguments)
+  FormatArgs (location_t loc, Fmt::Pieces &&template_str,
+	      FormatArguments &&arguments)
     : loc (loc), template_str (std::move (template_str)),
       arguments (std::move (arguments))
   {}
 
-  void accept_vis (AST::ASTVisitor &vis);
+  FormatArgs (FormatArgs &&other)
+    : loc (std::move (other.loc)),
+      template_str (std::move (other.template_str)),
+      arguments (std::move (other.arguments))
+  {
+    std::cerr << "[ARTHUR] moving FormatArgs" << std::endl;
+  }
+
+  // FIXME: This might be invalid - we are reusing the same memory allocated
+  // on the Rust side for `other`. This is probably valid as long as we only
+  // ever read that memory and never write to it.
+  FormatArgs (const FormatArgs &other)
+    : loc (other.loc), template_str (other.template_str),
+      arguments (other.arguments)
+  {
+    std::cerr << "[ARTHUR] copying FormatArgs" << std::endl;
+  }
+
+  // FormatArgs &operator= (const FormatArgs &other) = default;
+  //   : template_str (other.template_str), arguments (other.arguments)
+  // {}
+
+  void accept_vis (AST::ASTVisitor &vis) override;
 
 private:
   location_t loc;
-  Fmt::PieceSlice template_str;
+  // FIXME: This probably needs to be a separate type - it is one in rustc's
+  // expansion of format_args!(). There is extra handling associated with it.
+  // we can maybe do that in rust-fmt.cc? in collect_pieces()? like do the
+  // transformation into something we can handle better
+  Fmt::Pieces template_str;
   FormatArguments arguments;
+
+  bool marked_for_strip = false;
+
+protected:
+  virtual std::string as_string () const override;
+  virtual location_t get_locus () const override;
+  virtual bool is_expr_without_block () const override;
+  virtual void mark_for_strip () override;
+  virtual bool is_marked_for_strip () const override;
+  virtual std::vector<Attribute> &get_outer_attrs () override;
+  virtual void set_outer_attrs (std::vector<Attribute>) override;
+  virtual Expr *clone_expr_impl () const override;
 };
 
 } // namespace AST
diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index 511e94740c5..c367e30d546 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -23,9 +23,9 @@ namespace Rust {
 namespace Fmt {
 
 Pieces
-Pieces::collect (std::string &&to_parse)
+Pieces::collect (std::string &&to_parse, bool append_newline)
 {
-  auto piece_slice = collect_pieces (to_parse.c_str ());
+  auto piece_slice = collect_pieces (to_parse.c_str (), append_newline);
 
   rust_debug ("[ARTHUR] %p, %lu", (const void *) piece_slice.base_ptr,
 	      piece_slice.len);
@@ -37,7 +37,39 @@ Pieces::collect (std::string &&to_parse)
   return Pieces (piece_slice, std::move (to_parse));
 }
 
-Pieces::~Pieces () { destroy_pieces (slice); }
+Pieces::~Pieces ()
+{
+  std::cerr << "Arthur: destoying pieces. this: " << (void *) this
+	    << " slice: " << slice.base_ptr << std::endl;
+  destroy_pieces (slice);
+}
+
+Pieces::Pieces (const Pieces &other) : to_parse (other.to_parse)
+{
+  slice = clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap);
+  std::cerr << "Arthur: copying pieces: other.to_parse: "
+	    << (void *) other.to_parse.c_str ()
+	    << " ours to_parse: " << (void *) to_parse.c_str () << std::endl;
+  // auto pieces = std::vector (slice.base_ptr, slice.base_ptr + slice.len);
+}
+
+Pieces &
+Pieces::operator= (const Pieces &other)
+{
+  slice = clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap);
+  to_parse = other.to_parse;
+
+  return *this;
+}
+
+Pieces::Pieces (Pieces &&other)
+  : slice (
+    clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap)),
+    to_parse (std::move (other.to_parse))
+{
+  std::cerr << "Arthur: moving pieces. to_parse: " << (void *) to_parse.c_str ()
+	    << " base_ptr/slice: " << (void *) slice.base_ptr << std::endl;
+}
 
 } // namespace Fmt
 } // namespace Rust
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 0bf9695bb6d..22447c4eba0 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -222,7 +222,7 @@ struct Piece
 
   struct NextArgument_Body
   {
-    const Argument *_0;
+    Argument _0;
   };
 
   Tag tag;
@@ -243,7 +243,10 @@ struct PieceSlice
 extern "C" {
 
 PieceSlice
-collect_pieces (const char *input);
+collect_pieces (const char *input, bool append_newline);
+
+PieceSlice
+clone_pieces (const Piece *base_ptr, size_t len, size_t cap);
 
 void destroy_pieces (PieceSlice);
 
@@ -251,9 +254,21 @@ void destroy_pieces (PieceSlice);
 
 struct Pieces
 {
-  static Pieces collect (std::string &&to_parse);
+  static Pieces collect (std::string &&to_parse, bool append_newline);
   ~Pieces ();
 
+  Pieces (const Pieces &other);
+  Pieces &operator= (const Pieces &other);
+
+  Pieces (Pieces &&other);
+
+  // {
+  //   slice = clone_pieces (&other.slice);
+  //   to_parse = other.to_parse;
+
+  //   return *this;
+  // }
+
 private:
   Pieces (PieceSlice slice, std::string &&to_parse)
     : slice (slice), to_parse (std::move (to_parse))
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 9e6716c5975..b42d1ec9367 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -16,6 +16,7 @@
 // along with GCC; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include "expected.h"
 #include "libproc_macro_internal/tokenstream.h"
 #include "rust-ast-full-decls.h"
 #include "rust-builtin-ast-nodes.h"
@@ -35,6 +36,7 @@
 #include "rust-session-manager.h"
 #include "rust-attribute-values.h"
 #include "rust-fmt.h"
+#include "rust-token.h"
 
 namespace Rust {
 
@@ -956,34 +958,116 @@ MacroBuiltin::stringify_handler (location_t invoc_locus,
   return AST::Fragment ({node}, std::move (token));
 }
 
-tl::optional<AST::Fragment>
-MacroBuiltin::format_args_handler (location_t invoc_locus,
-				   AST::MacroInvocData &invoc,
-				   AST::FormatArgs::Newline nl)
+struct FormatArgsInput
 {
-  // Remove the delimiters from the macro invocation:
-  // the invoc data for `format_args!(fmt, arg1, arg2)` is `(fmt, arg1, arg2)`,
-  // so we pop the front and back to remove the parentheses (or curly brackets,
-  // or brackets)
-  auto tokens = invoc.get_delim_tok_tree ().to_token_stream ();
-  tokens.erase (tokens.begin ());
-  tokens.pop_back ();
+  std::unique_ptr<AST::Expr> format_str;
+  AST::FormatArguments args;
+  // bool is_literal?
+};
 
-  auto append_newline = nl == AST::FormatArgs::Newline::Yes ? true : false;
-  auto fmt_arg
-    = parse_single_string_literal (append_newline ? BuiltinMacro::FormatArgsNl
-						  : BuiltinMacro::FormatArgs,
-				   invoc.get_delim_tok_tree (), invoc_locus,
-				   invoc.get_expander ());
+struct FormatArgsParseError
+{
+  enum class Kind
+  {
+    MissingArguments
+  } kind;
+};
+
+static tl::expected<FormatArgsInput, FormatArgsParseError>
+format_args_parse_arguments (AST::MacroInvocData &invoc)
+{
+  MacroInvocLexer lex (invoc.get_delim_tok_tree ().to_token_stream ());
+  Parser<MacroInvocLexer> parser (lex);
+
+  // TODO: check if EOF - return that format_args!() requires at least one
+  // argument
 
-  if (!fmt_arg->is_literal ())
+  auto args = AST::FormatArguments ();
+  auto last_token_id = macro_end_token (invoc.get_delim_tok_tree (), parser);
+  std::unique_ptr<AST::Expr> format_str = nullptr;
+
+  // TODO: Handle the case where we're not parsing a string literal (macro
+  // invocation for e.g.)
+  if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
+    format_str = parser.parse_literal_expr ();
+
+  // TODO: Allow implicit captures ONLY if the the first arg is a string literal
+  // and not a macro invocation
+
+  // TODO: How to consume all of the arguments until the delimiter?
+
+  // TODO: What we then want to do is as follows:
+  // for each token, check if it is an identifier
+  //     yes? is the next token an equal sign (=)
+  //          yes?
+  //              -> if that identifier is already present in our map, error
+  //              out
+  //              -> parse an expression, return a FormatArgument::Named
+  //     no?
+  //         -> if there have been named arguments before, error out
+  //         (positional after named error)
+  //         -> parse an expression, return a FormatArgument::Normal
+  while (parser.peek_current_token ()->get_id () != last_token_id)
     {
-      rust_sorry_at (
-	invoc_locus,
-	"cannot yet use eager macro invocations as format strings");
-      return AST::Fragment::create_empty ();
+      parser.skip_token (COMMA);
+
+      if (parser.peek_current_token ()->get_id () == IDENTIFIER
+	  && parser.peek (1)->get_id () == EQUAL)
+	{
+	  // FIXME: This is ugly - just add a parser.parse_identifier()?
+	  auto ident_tok = parser.peek_current_token ();
+	  auto ident = Identifier (ident_tok);
+
+	  parser.skip_token (IDENTIFIER);
+	  parser.skip_token (EQUAL);
+
+	  auto expr = parser.parse_expr ();
+
+	  // TODO: Handle graciously
+	  if (!expr)
+	    rust_unreachable ();
+
+	  args.push (AST::FormatArgument::named (ident, std::move (expr)));
+	}
+      else
+	{
+	  auto expr = parser.parse_expr ();
+
+	  // TODO: Handle graciously
+	  if (!expr)
+	    rust_unreachable ();
+
+	  args.push (AST::FormatArgument::normal (std::move (expr)));
+	}
+      // we need to skip commas, don't we?
     }
 
+  return FormatArgsInput{std::move (format_str), std::move (args)};
+}
+
+tl::optional<AST::Fragment>
+MacroBuiltin::format_args_handler (location_t invoc_locus,
+				   AST::MacroInvocData &invoc,
+				   AST::FormatArgs::Newline nl)
+{
+  auto input = format_args_parse_arguments (invoc);
+
+  // auto fmt_arg
+  //   // FIXME: this eneds to be split up into a smaller function
+  //   = parse_single_string_literal (append_newline ?
+  //   BuiltinMacro::FormatArgsNl
+  // 				  : BuiltinMacro::FormatArgs,
+  // 		   invoc.get_delim_tok_tree (), invoc_locus,
+  // 		   invoc.get_expander ());
+
+  //  if (!fmt_arg->is_literal ())
+  //    {
+  //      rust_sorry_at (
+  // invoc_locus,
+  // "cannot yet use eager macro invocations as format strings");
+  //      return AST::Fragment::create_empty ();
+  //    }
+
   // FIXME: We need to handle this
   // // if it is not a literal, it's an eager macro invocation - return it
   // if (!fmt_expr->is_literal ())
@@ -993,38 +1077,54 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
   // 	    token_tree.to_token_stream ());
   //   }
 
-  auto fmt_str = static_cast<AST::LiteralExpr &> (*fmt_arg.get ());
+  // auto fmt_str = static_cast<AST::LiteralExpr &> (*fmt_arg.get ());
 
   // Switch on the format string to know if the string is raw or cooked
-  switch (fmt_str.get_lit_type ())
-    {
-    // case AST::Literal::RAW_STRING:
-    case AST::Literal::STRING:
-      break;
-    case AST::Literal::CHAR:
-    case AST::Literal::BYTE:
-    case AST::Literal::BYTE_STRING:
-    case AST::Literal::INT:
-    case AST::Literal::FLOAT:
-    case AST::Literal::BOOL:
-    case AST::Literal::ERROR:
-      rust_unreachable ();
-    }
+  // switch (fmt_str.get_lit_type ())
+  //   {
+  //   // case AST::Literal::RAW_STRING:
+  //   case AST::Literal::STRING:
+  //     break;
+  //   case AST::Literal::CHAR:
+  //   case AST::Literal::BYTE:
+  //   case AST::Literal::BYTE_STRING:
+  //   case AST::Literal::INT:
+  //   case AST::Literal::FLOAT:
+  //   case AST::Literal::BOOL:
+  //   case AST::Literal::ERROR:
+  //     rust_unreachable ();
+  //   }
+
+  // Remove the delimiters from the macro invocation:
+  // the invoc data for `format_args!(fmt, arg1, arg2)` is `(fmt, arg1, arg2)`,
+  // so we pop the front and back to remove the parentheses (or curly brackets,
+  // or brackets)
+  auto tokens = invoc.get_delim_tok_tree ().to_token_stream ();
+  tokens.erase (tokens.begin ());
+  tokens.pop_back ();
 
   std::stringstream stream;
   for (const auto &tok : tokens)
     stream << tok->as_string () << ' ';
 
-  rust_debug ("[ARTHUR]: `%s`", stream.str ().c_str ());
-
-  auto pieces = Fmt::Pieces::collect (stream.str ());
+  auto append_newline = nl == AST::FormatArgs::Newline::Yes ? true : false;
+  auto pieces = Fmt::Pieces::collect (stream.str (), append_newline);
 
   // TODO:
   // do the transformation into an AST::FormatArgs node
   // return that
   // expand it during lowering
 
-  return AST::Fragment::create_empty ();
+  // TODO: we now need to take care of creating `unfinished_literal`? this is
+  // for creating the `template`
+
+  auto fmt_args_node = new AST::FormatArgs (invoc_locus, std::move (pieces),
+					    std::move (input->args));
+  auto node = std::unique_ptr<AST::Expr> (fmt_args_node);
+  auto single_node = AST::SingleASTNode (std::move (node));
+
+  return AST::Fragment ({std::move (single_node)},
+			invoc.get_delim_tok_tree ().to_token_stream ());
 }
 
 tl::optional<AST::Fragment>
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index fa37d62d026..54c05208e7b 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -22,6 +22,7 @@
 #include "rust-ast-lower-extern.h"
 #include "rust-ast.h"
 #include "rust-attribute-values.h"
+#include "rust-diagnostics.h"
 #include "rust-item.h"
 #include "rust-system.h"
 
diff --git a/libgrust/libformat_parser/src/bin.rs b/libgrust/libformat_parser/src/bin.rs
index 4b1f903ad5f..5f46497c946 100644
--- a/libgrust/libformat_parser/src/bin.rs
+++ b/libgrust/libformat_parser/src/bin.rs
@@ -2,6 +2,9 @@ use libformat_parser::rust;
 
 fn main() {
     dbg!(rust::collect_pieces(
-        std::env::args().nth(1).unwrap().as_str()
+        std::env::args().nth(1).unwrap().as_str(),
+        None,
+        None,
+        false
     ));
 }
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index c164578a103..6bf78c4f2a8 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -77,20 +77,15 @@ mod ffi {
 
     /// A piece is a portion of the format string which represents the next part
     /// to emit. These are emitted as a stream by the `Parser` class.
-    #[derive(Clone, Debug, PartialEq)]
+    #[derive(Debug, Clone, PartialEq)]
     #[repr(C)]
     pub enum Piece<'a> {
         /// A literal string which should directly be emitted
         String(&'a str),
         /// This describes that formatting should process the next argument (as
         /// specified inside) for emission.
-        NextArgument(*const Argument<'a>),
-    }
-
-    impl<'a> Drop for Piece<'a> {
-        fn drop(&mut self) {
-            println!("dropping Piece: {:?}", self)
-        }
+        // do we need a pointer here? we're doing big cloning anyway
+        NextArgument(Argument<'a>),
     }
 
     /// Representation of an argument specification.
@@ -216,7 +211,7 @@ mod ffi {
                     let ptr = Box::leak(x);
                     let dst = Into::<Argument>::into(*ptr);
 
-                    Piece::NextArgument(&dst as *const Argument)
+                    Piece::NextArgument(dst)
                 }
             }
         }
@@ -321,8 +316,13 @@ mod ffi {
 pub mod rust {
     use generic_format_parser::{ParseMode, Parser, Piece};
 
-    pub fn collect_pieces(input: &str) -> Vec<Piece<'_>> {
-        let parser = Parser::new(input, None, None, true, ParseMode::Format);
+    pub fn collect_pieces(
+        input: &str,
+        style: Option<usize>,
+        snippet: Option<String>,
+        append_newline: bool,
+    ) -> Vec<Piece<'_>> {
+        let parser = Parser::new(input, style, snippet, append_newline, ParseMode::Format);
 
         parser.into_iter().collect()
     }
@@ -337,16 +337,18 @@ pub struct PieceSlice {
 }
 
 #[no_mangle]
-pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
+pub extern "C" fn collect_pieces(input: *const libc::c_char, append_newline: bool) -> PieceSlice {
+    dbg!(input);
+
     // FIXME: Add comment
     let str = unsafe { CStr::from_ptr(input) };
-    dbg!(str);
 
     // FIXME: No unwrap
-    let pieces: Vec<ffi::Piece<'_>> = rust::collect_pieces(str.to_str().unwrap())
-        .into_iter()
-        .map(Into::into)
-        .collect();
+    let pieces: Vec<ffi::Piece<'_>> =
+        rust::collect_pieces(str.to_str().unwrap(), None, None, append_newline)
+            .into_iter()
+            .map(Into::into)
+            .collect();
 
     println!("[ARTHUR]: debug: {:?}, {:?}", pieces.as_ptr(), pieces.len());
 
@@ -358,6 +360,29 @@ pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
 }
 
 #[no_mangle]
-pub extern "C" fn destroy_pieces(PieceSlice { base_ptr, len, cap }: PieceSlice) {
-    let _ = unsafe { Vec::from_raw_parts(base_ptr, len, cap) };
+pub unsafe extern "C" fn destroy_pieces(PieceSlice { base_ptr, len, cap }: PieceSlice) {
+    eprintln!("[ARTHUR] destroying pieces: {base_ptr:?} {len} {cap}");
+    drop(Vec::from_raw_parts(base_ptr, len, cap));
+}
+
+#[no_mangle]
+pub extern "C" fn clone_pieces(
+    base_ptr: *mut ffi::Piece<'static>,
+    len: usize,
+    cap: usize,
+) -> PieceSlice {
+    eprintln!("[ARTHUR] cloning pieces: {base_ptr:?} {len} {cap}");
+
+    let v = unsafe { Vec::from_raw_parts(base_ptr, len, cap) };
+
+    let cloned_v = v.clone();
+
+    // FIXME: Add documentation
+    v.leak();
+
+    PieceSlice {
+        len: cloned_v.len(),
+        cap: cloned_v.capacity(),
+        base_ptr: dbg!(cloned_v.leak().as_mut_ptr()),
+    }
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 032/125] gccrs: lower: Add base for lowering FormatArgs nodes
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (29 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 031/125] gccrs: format-args: Fix Rust interface and add input parsing Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 033/125] gccrs: format-args: Add documentation for future expansion of function Arthur Cohen
                   ` (92 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* Make-lang.in: Compile the new source file.
	* ast/rust-ast-collector.cc (TokenCollector::visit): Error out when
	visiting FormatArgs nodes.
	* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
	* ast/rust-ast.cc (FormatArgs::get_locus): New.
	* ast/rust-builtin-ast-nodes.h: Improve FormatArgs API.
	* ast/rust-fmt.cc (Pieces::~Pieces): Cleanup.
	(Pieces::Pieces): Likewise.
	* ast/rust-fmt.h (struct Pieces): Add pieces_vector member.
	* hir/rust-ast-lower-format-args.cc: New file.
	* hir/rust-ast-lower-format-args.h: New file.
---
 gcc/rust/Make-lang.in                      |  1 +
 gcc/rust/ast/rust-ast-collector.cc         |  3 +-
 gcc/rust/ast/rust-ast.cc                   |  2 +-
 gcc/rust/ast/rust-builtin-ast-nodes.h      | 32 +++++------------
 gcc/rust/ast/rust-fmt.cc                   | 39 ++++++++------------
 gcc/rust/ast/rust-fmt.h                    | 13 +++++--
 gcc/rust/hir/rust-ast-lower-expr.cc        |  7 +++-
 gcc/rust/hir/rust-ast-lower-format-args.cc | 41 ++++++++++++++++++++++
 gcc/rust/hir/rust-ast-lower-format-args.h  | 40 +++++++++++++++++++++
 gcc/rust/resolve/rust-ast-resolve-base.cc  |  3 +-
 10 files changed, 127 insertions(+), 54 deletions(-)
 create mode 100644 gcc/rust/hir/rust-ast-lower-format-args.cc
 create mode 100644 gcc/rust/hir/rust-ast-lower-format-args.h

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index af5d775a3a6..f166b02340d 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -118,6 +118,7 @@ GRS_OBJS = \
     rust/rust-ast-lower-expr.o \
     rust/rust-ast-lower-type.o \
     rust/rust-ast-lower-stmt.o \
+    rust/rust-ast-lower-format-args.o \
     rust/rust-rib.o \
     rust/rust-name-resolution-context.o \
     rust/rust-default-resolver.o \
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index b8ec62367bc..c0e8e774824 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -2810,7 +2810,8 @@ TokenCollector::visit (BareFunctionType &type)
 void
 TokenCollector::visit (AST::FormatArgs &fmt)
 {
-  rust_sorry_at (0, "unimplemented format_args!() visitor");
+  rust_sorry_at (fmt.get_locus (), "%s:%u: unimplemented FormatArgs visitor",
+		 __FILE__, __LINE__);
 }
 
 } // namespace AST
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index f3dabc6cd0f..fbd795f6718 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -5065,7 +5065,7 @@ FormatArgs::as_string () const
 location_t
 FormatArgs::get_locus () const
 {
-  rust_unreachable ();
+  return loc;
 }
 
 bool
diff --git a/gcc/rust/ast/rust-builtin-ast-nodes.h b/gcc/rust/ast/rust-builtin-ast-nodes.h
index 6e267173a55..780d1a9d4e9 100644
--- a/gcc/rust/ast/rust-builtin-ast-nodes.h
+++ b/gcc/rust/ast/rust-builtin-ast-nodes.h
@@ -184,48 +184,32 @@ public:
 
   FormatArgs (location_t loc, Fmt::Pieces &&template_str,
 	      FormatArguments &&arguments)
-    : loc (loc), template_str (std::move (template_str)),
+    : loc (loc), template_pieces (std::move (template_str)),
       arguments (std::move (arguments))
   {}
 
-  FormatArgs (FormatArgs &&other)
-    : loc (std::move (other.loc)),
-      template_str (std::move (other.template_str)),
-      arguments (std::move (other.arguments))
-  {
-    std::cerr << "[ARTHUR] moving FormatArgs" << std::endl;
-  }
-
-  // FIXME: This might be invalid - we are reusing the same memory allocated
-  // on the Rust side for `other`. This is probably valid as long as we only
-  // ever read that memory and never write to it.
-  FormatArgs (const FormatArgs &other)
-    : loc (other.loc), template_str (other.template_str),
-      arguments (other.arguments)
-  {
-    std::cerr << "[ARTHUR] copying FormatArgs" << std::endl;
-  }
-
-  // FormatArgs &operator= (const FormatArgs &other) = default;
-  //   : template_str (other.template_str), arguments (other.arguments)
-  // {}
+  FormatArgs (FormatArgs &&other) = default;
+  FormatArgs (const FormatArgs &other) = default;
+  FormatArgs &operator= (const FormatArgs &other) = default;
 
   void accept_vis (AST::ASTVisitor &vis) override;
 
+  const Fmt::Pieces &get_template () const { return template_pieces; }
+  virtual location_t get_locus () const override;
+
 private:
   location_t loc;
   // FIXME: This probably needs to be a separate type - it is one in rustc's
   // expansion of format_args!(). There is extra handling associated with it.
   // we can maybe do that in rust-fmt.cc? in collect_pieces()? like do the
   // transformation into something we can handle better
-  Fmt::Pieces template_str;
+  Fmt::Pieces template_pieces;
   FormatArguments arguments;
 
   bool marked_for_strip = false;
 
 protected:
   virtual std::string as_string () const override;
-  virtual location_t get_locus () const override;
   virtual bool is_expr_without_block () const override;
   virtual void mark_for_strip () override;
   virtual bool is_marked_for_strip () const override;
diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index c367e30d546..b82e089fc41 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -27,30 +27,23 @@ Pieces::collect (std::string &&to_parse, bool append_newline)
 {
   auto piece_slice = collect_pieces (to_parse.c_str (), append_newline);
 
-  rust_debug ("[ARTHUR] %p, %lu", (const void *) piece_slice.base_ptr,
-	      piece_slice.len);
-
   // this performs multiple copies, can we avoid them maybe?
-  // auto pieces = std::vector<Piece> (piece_slice.base_ptr,
-  // 	     piece_slice.base_ptr + piece_slice.len);
-
-  return Pieces (piece_slice, std::move (to_parse));
+  // TODO: Instead of just creating a vec of, basically, `ffi::Piece`s, we
+  // should transform them into the proper C++ type which we can work with. so
+  // transform all the strings into C++ strings? all the Option<T> into
+  // tl::optional<T>?
+  auto pieces = std::vector<Piece> (piece_slice.base_ptr,
+				    piece_slice.base_ptr + piece_slice.len);
+
+  return Pieces (std::move (pieces), piece_slice, std::move (to_parse));
 }
 
-Pieces::~Pieces ()
-{
-  std::cerr << "Arthur: destoying pieces. this: " << (void *) this
-	    << " slice: " << slice.base_ptr << std::endl;
-  destroy_pieces (slice);
-}
+Pieces::~Pieces () { destroy_pieces (slice); }
 
-Pieces::Pieces (const Pieces &other) : to_parse (other.to_parse)
+Pieces::Pieces (const Pieces &other)
+  : pieces_vector (other.pieces_vector), to_parse (other.to_parse)
 {
   slice = clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap);
-  std::cerr << "Arthur: copying pieces: other.to_parse: "
-	    << (void *) other.to_parse.c_str ()
-	    << " ours to_parse: " << (void *) to_parse.c_str () << std::endl;
-  // auto pieces = std::vector (slice.base_ptr, slice.base_ptr + slice.len);
 }
 
 Pieces &
@@ -63,13 +56,11 @@ Pieces::operator= (const Pieces &other)
 }
 
 Pieces::Pieces (Pieces &&other)
-  : slice (
-    clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap)),
+  : pieces_vector (std::move (other.pieces_vector)),
+    slice (
+      clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap)),
     to_parse (std::move (other.to_parse))
-{
-  std::cerr << "Arthur: moving pieces. to_parse: " << (void *) to_parse.c_str ()
-	    << " base_ptr/slice: " << (void *) slice.base_ptr << std::endl;
-}
+{}
 
 } // namespace Fmt
 } // namespace Rust
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 22447c4eba0..ba412f9958c 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -262,6 +262,8 @@ struct Pieces
 
   Pieces (Pieces &&other);
 
+  const std::vector<Piece> &get_pieces () const { return pieces_vector; }
+
   // {
   //   slice = clone_pieces (&other.slice);
   //   to_parse = other.to_parse;
@@ -270,10 +272,17 @@ struct Pieces
   // }
 
 private:
-  Pieces (PieceSlice slice, std::string &&to_parse)
-    : slice (slice), to_parse (std::move (to_parse))
+  Pieces (std::vector<Piece> &&pieces_vector, PieceSlice slice,
+	  std::string &&to_parse)
+    : pieces_vector (std::move (pieces_vector)), slice (slice),
+      to_parse (std::move (to_parse))
   {}
 
+  std::vector<Piece> pieces_vector;
+
+  // this memory is held for FFI reasons - it needs to be released and cloned
+  // precisely, so try to not access it/modify it if possible. you should
+  // instead work with `pieces_vector`
   PieceSlice slice;
   std::string to_parse;
 };
diff --git a/gcc/rust/hir/rust-ast-lower-expr.cc b/gcc/rust/hir/rust-ast-lower-expr.cc
index 8e07b19df4c..ece15529b5f 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.cc
+++ b/gcc/rust/hir/rust-ast-lower-expr.cc
@@ -19,6 +19,7 @@
 #include "rust-ast-lower-expr.h"
 #include "rust-ast-lower-base.h"
 #include "rust-ast-lower-block.h"
+#include "rust-ast-lower-format-args.h"
 #include "rust-ast-lower-struct-field-expr.h"
 #include "rust-ast-lower-pattern.h"
 #include "rust-ast-lower-type.h"
@@ -833,7 +834,11 @@ ASTLoweringExpr::visit (AST::ClosureExprInnerTyped &expr)
 void
 ASTLoweringExpr::visit (AST::FormatArgs &fmt)
 {
-  rust_sorry_at (0, "unimplemented format_args!() visitor");
+  // Lowering FormatArgs is complex, and this file is already very long
+  translated = FormatArgsLowering ().go (fmt);
+
+  rust_sorry_at (fmt.get_locus (),
+		 "FormatArgs lowering is not implemented yet");
 }
 
 } // namespace HIR
diff --git a/gcc/rust/hir/rust-ast-lower-format-args.cc b/gcc/rust/hir/rust-ast-lower-format-args.cc
new file mode 100644
index 00000000000..fcae55ad8c4
--- /dev/null
+++ b/gcc/rust/hir/rust-ast-lower-format-args.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-ast-lower-format-args.h"
+#include "rust-ast-full.h"
+#include "rust-hir-full.h"
+
+namespace Rust {
+namespace HIR {
+
+FormatArgsLowering::FormatArgsLowering () {}
+
+HIR::Expr *
+FormatArgsLowering::go (AST::FormatArgs &fmt)
+{
+  // Eventually, we will ned to perform format_args!() expansion as part of HIR
+  // lowering - this enables a couple of interesting optimizations such as
+  // format_args flattening and the inlining of constants into the format
+  // strings. However, this is not a priority at the moment and it is easier to
+  // do "regular" macro expansion for `format_arsg!()`
+
+  return nullptr;
+}
+
+} // namespace HIR
+} // namespace Rust
diff --git a/gcc/rust/hir/rust-ast-lower-format-args.h b/gcc/rust/hir/rust-ast-lower-format-args.h
new file mode 100644
index 00000000000..f21635c4d0a
--- /dev/null
+++ b/gcc/rust/hir/rust-ast-lower-format-args.h
@@ -0,0 +1,40 @@
+// Copyright (C) 2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_AST_LOWER_FORMAT_ARGS
+#define RUST_AST_LOWER_FORMAT_ARGS
+
+#include "rust-ast-full-decls.h"
+#include "rust-hir-full-decls.h"
+
+namespace Rust {
+namespace HIR {
+
+class FormatArgsLowering
+{
+public:
+  FormatArgsLowering ();
+  HIR::Expr *go (AST::FormatArgs &fmt);
+
+private:
+};
+
+} // namespace HIR
+} // namespace Rust
+
+#endif // ! RUST_AST_LOWER_FORMAT_ARGS
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc
index 04a0bb65ec2..5a9f54fc7f1 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-base.cc
@@ -653,7 +653,8 @@ ResolverBase::visit (AST::FunctionParam &)
 void
 ResolverBase::visit (AST::FormatArgs &fmt)
 {
-  rust_sorry_at (0, "unimplemented format_args!() visitor");
+  rust_sorry_at (fmt.get_locus (), "%s:%u: unimplemented FormatArgs visitor",
+		 __FILE__, __LINE__);
 }
 
 } // namespace Resolver
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 033/125] gccrs: format-args: Add documentation for future expansion of function
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (30 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 032/125] gccrs: lower: Add base for lowering FormatArgs nodes Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 034/125] gccrs: Add error emitting when we can't resolve id expr Arthur Cohen
                   ` (91 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Add
	documentation regarding future tasks.
---
 gcc/rust/expand/rust-macro-builtins.cc | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index b42d1ec9367..e4ca0d8ba3b 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -1052,23 +1052,7 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
 {
   auto input = format_args_parse_arguments (invoc);
 
-  // auto fmt_arg
-  //   // FIXME: this eneds to be split up into a smaller function
-  //   = parse_single_string_literal (append_newline ?
-  //   BuiltinMacro::FormatArgsNl
-  // 				  : BuiltinMacro::FormatArgs,
-  // 		   invoc.get_delim_tok_tree (), invoc_locus,
-  // 		   invoc.get_expander ());
-
-  //  if (!fmt_arg->is_literal ())
-  //    {
-  //      rust_sorry_at (
-  // invoc_locus,
-  // "cannot yet use eager macro invocations as format strings");
-  //      return AST::Fragment::create_empty ();
-  //    }
-
-  // FIXME: We need to handle this
+  // TODO(Arthur): We need to handle this
   // // if it is not a literal, it's an eager macro invocation - return it
   // if (!fmt_expr->is_literal ())
   //   {
@@ -1077,10 +1061,10 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
   // 	    token_tree.to_token_stream ());
   //   }
 
-  // auto fmt_str = static_cast<AST::LiteralExpr &> (*fmt_arg.get ());
-
-  // Switch on the format string to know if the string is raw or cooked
-  // switch (fmt_str.get_lit_type ())
+  // TODO(Arthur): Handle this as well - raw strings are special for the
+  // format_args parser auto fmt_str = static_cast<AST::LiteralExpr &>
+  // (*fmt_arg.get ()); Switch on the format string to know if the string is raw
+  // or cooked switch (fmt_str.get_lit_type ())
   //   {
   //   // case AST::Literal::RAW_STRING:
   //   case AST::Literal::STRING:
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 034/125] gccrs: Add error emitting when we can't resolve id expr
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (31 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 033/125] gccrs: format-args: Add documentation for future expansion of function Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 035/125] gccrs: Add curly brackets, formatted clang Arthur Cohen
                   ` (90 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, jjasmine

From: jjasmine <tanghocle456@gmail.com>

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index f9731a451a3..8717c51e34a 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -130,7 +130,10 @@ Late::visit (AST::IdentifierExpr &expr)
     resolved = label;
   else if (value)
     resolved = value;
-  // TODO: else emit error?
+  else {
+      rust_error_at(expr.get_locus (), "could not resolve identifier expression: %qs", expr.get_ident ().as_string ().c_str ());
+      return;
+  }
 
   ctx.map_usage (expr.get_node_id (), *resolved);
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 035/125] gccrs: Add curly brackets, formatted clang
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (32 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 034/125] gccrs: Add error emitting when we can't resolve id expr Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 036/125] gccrs: Ensure TupleStructPattern and TuplePattern have items Arthur Cohen
                   ` (89 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, jjasmine

From: jjasmine <tanghocle456@gmail.com>

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 8717c51e34a..e5a4f234871 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -127,13 +127,20 @@ Late::visit (AST::IdentifierExpr &expr)
   auto value = ctx.values.get (expr.get_ident ());
 
   if (label)
-    resolved = label;
+    {
+      resolved = label;
+    }
   else if (value)
-    resolved = value;
-  else {
-      rust_error_at(expr.get_locus (), "could not resolve identifier expression: %qs", expr.get_ident ().as_string ().c_str ());
+    {
+      resolved = value;
+    }
+  else
+    {
+      rust_error_at (expr.get_locus (),
+		     "could not resolve identifier expression: %qs",
+		     expr.get_ident ().as_string ().c_str ());
       return;
-  }
+    }
 
   ctx.map_usage (expr.get_node_id (), *resolved);
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 036/125] gccrs: Ensure TupleStructPattern and TuplePattern have items
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (33 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 035/125] gccrs: Add curly brackets, formatted clang Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 037/125] gccrs: Clean BiMap to use tl::optional for lookups Arthur Cohen
                   ` (88 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

Note that instances of both classes which have been
moved from will have (items == nullptr).

gcc/rust/ChangeLog:

	* ast/rust-pattern.h
	(class TupleStructPattern): Assert that items != nullptr.
	(class TuplePattern): Likewise.
	(TupleStructPattern::has_items): Remove.
	(TuplePattern::has_tuple_pattern_items): Likewise.
	* parse/rust-parse-impl.h
	(Parser::parse_ident_leading_pattern):
	Prevent construction of TupleStructPattern with
	(items == nullptr).
	(Parser::parse_pattern_no_alt): Likewise.
	* ast/rust-ast-collector.cc
	(TokenCollector::visit): Remove usage of
	TupleStructPattern::has_items.
	* ast/rust-ast-visitor.cc
	(DefaultASTVisitor::visit): Likewise.
	* resolve/rust-early-name-resolver.cc
	(EarlyNameResolver::visit): Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/pattern-struct.rs: Fix test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/ast/rust-ast-collector.cc           |  3 +-
 gcc/rust/ast/rust-ast-visitor.cc             |  3 +-
 gcc/rust/ast/rust-pattern.h                  | 46 ++++++++++----------
 gcc/rust/parse/rust-parse-impl.h             | 16 -------
 gcc/rust/resolve/rust-early-name-resolver.cc | 10 -----
 gcc/testsuite/rust/compile/pattern-struct.rs |  2 +-
 6 files changed, 26 insertions(+), 54 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index c0e8e774824..744d0eb9d28 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -2503,8 +2503,7 @@ TokenCollector::visit (TupleStructPattern &pattern)
 {
   visit (pattern.get_path ());
   push (Rust::Token::make (LEFT_PAREN, pattern.get_locus ()));
-  if (pattern.has_items ())
-    visit (pattern.get_items ());
+  visit (pattern.get_items ());
   push (Rust::Token::make (RIGHT_PAREN, UNDEF_LOCATION));
 }
 
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc
index c72e2d72f6d..697c2726309 100644
--- a/gcc/rust/ast/rust-ast-visitor.cc
+++ b/gcc/rust/ast/rust-ast-visitor.cc
@@ -1225,8 +1225,7 @@ void
 DefaultASTVisitor::visit (AST::TupleStructPattern &pattern)
 {
   visit (pattern.get_path ());
-  if (pattern.has_items ())
-    visit (pattern.get_items ());
+  visit (pattern.get_items ());
 }
 
 void
diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index 6a90b536175..96f09355fae 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -1123,22 +1123,22 @@ class TupleStructPattern : public Pattern
 public:
   std::string as_string () const override;
 
-  // Returns whether the pattern has tuple struct items.
-  bool has_items () const { return items != nullptr; }
-
   TupleStructPattern (PathInExpression tuple_struct_path,
 		      std::unique_ptr<TupleStructItems> items)
     : path (std::move (tuple_struct_path)), items (std::move (items)),
       node_id (Analysis::Mappings::get ()->get_next_node_id ())
-  {}
+  {
+    rust_assert (this->items != nullptr);
+  }
 
   // Copy constructor required to clone
   TupleStructPattern (TupleStructPattern const &other) : path (other.path)
   {
     // guard to protect from null dereference
+    rust_assert (other.items != nullptr);
+
     node_id = other.node_id;
-    if (other.items != nullptr)
-      items = other.items->clone_tuple_struct_items ();
+    items = other.items->clone_tuple_struct_items ();
   }
 
   // Operator overload assignment operator to clone
@@ -1148,10 +1148,9 @@ public:
     node_id = other.node_id;
 
     // guard to protect from null dereference
-    if (other.items != nullptr)
-      items = other.items->clone_tuple_struct_items ();
-    else
-      items = nullptr;
+    rust_assert (other.items != nullptr);
+
+    items = other.items->clone_tuple_struct_items ();
 
     return *this;
   }
@@ -1164,7 +1163,11 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  std::unique_ptr<TupleStructItems> &get_items () { return items; }
+  std::unique_ptr<TupleStructItems> &get_items ()
+  {
+    rust_assert (items != nullptr);
+    return items;
+  }
 
   PathInExpression &get_path () { return path; }
   const PathInExpression &get_path () const { return path; }
@@ -1358,7 +1361,6 @@ protected:
 // AST node representing a tuple pattern
 class TuplePattern : public Pattern
 {
-  // bool has_tuple_pattern_items;
   std::unique_ptr<TuplePatternItems> items;
   location_t locus;
   NodeId node_id;
@@ -1366,21 +1368,21 @@ class TuplePattern : public Pattern
 public:
   std::string as_string () const override;
 
-  // Returns true if the tuple pattern has items
-  bool has_tuple_pattern_items () const { return items != nullptr; }
-
   TuplePattern (std::unique_ptr<TuplePatternItems> items, location_t locus)
     : items (std::move (items)), locus (locus),
       node_id (Analysis::Mappings::get ()->get_next_node_id ())
-  {}
+  {
+    rust_assert (this->items != nullptr);
+  }
 
   // Copy constructor requires clone
   TuplePattern (TuplePattern const &other) : locus (other.locus)
   {
     // guard to prevent null dereference
+    rust_assert (other.items != nullptr);
+
     node_id = other.node_id;
-    if (other.items != nullptr)
-      items = other.items->clone_tuple_pattern_items ();
+    items = other.items->clone_tuple_pattern_items ();
   }
 
   // Overload assignment operator to clone
@@ -1390,11 +1392,9 @@ public:
     node_id = other.node_id;
 
     // guard to prevent null dereference
-    if (other.items != nullptr)
-      items = other.items->clone_tuple_pattern_items ();
-    else
-      items = nullptr;
+    rust_assert (other.items != nullptr);
 
+    items = other.items->clone_tuple_pattern_items ();
     return *this;
   }
 
@@ -1405,7 +1405,7 @@ public:
   // TODO: seems kinda dodgy. Think of better way.
   std::unique_ptr<TuplePatternItems> &get_items ()
   {
-    rust_assert (has_tuple_pattern_items ());
+    rust_assert (items != nullptr);
     return items;
   }
 
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index ac1754542d4..9d9722e9714 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -10631,14 +10631,6 @@ Parser<ManagedTokenSource>::parse_pattern_no_alt ()
 	      // tuple struct
 	      lexer.skip_token ();
 
-	      // check if empty tuple
-	      if (lexer.peek_token ()->get_id () == RIGHT_PAREN)
-		{
-		  lexer.skip_token ();
-		  return std::unique_ptr<AST::TupleStructPattern> (
-		    new AST::TupleStructPattern (std::move (path), nullptr));
-		}
-
 	      // parse items
 	      std::unique_ptr<AST::TupleStructItems> items
 		= parse_tuple_struct_items ();
@@ -11094,14 +11086,6 @@ Parser<ManagedTokenSource>::parse_ident_leading_pattern ()
 	// DEBUG
 	rust_debug ("parsing tuple struct pattern");
 
-	// check if empty tuple
-	if (lexer.peek_token ()->get_id () == RIGHT_PAREN)
-	  {
-	    lexer.skip_token ();
-	    return std::unique_ptr<AST::TupleStructPattern> (
-	      new AST::TupleStructPattern (std::move (path), nullptr));
-	  }
-
 	// parse items
 	std::unique_ptr<AST::TupleStructItems> items
 	  = parse_tuple_struct_items ();
diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc
index d70f9ca9806..5447084cfdd 100644
--- a/gcc/rust/resolve/rust-early-name-resolver.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver.cc
@@ -558,16 +558,6 @@ EarlyNameResolver::visit (AST::StructPattern &)
 void
 EarlyNameResolver::visit (AST::TupleStructPattern &pattern)
 {
-  if (!pattern.has_items ())
-    {
-      rich_location rich_locus (line_table, pattern.get_locus ());
-      rich_locus.add_fixit_replace (
-	"function calls are not allowed in patterns");
-      rust_error_at (
-	rich_locus, ErrorCode::E0164,
-	"expected tuple struct or tuple variant, found associated function");
-      return;
-    }
   pattern.get_items ()->accept_vis (*this);
 }
 
diff --git a/gcc/testsuite/rust/compile/pattern-struct.rs b/gcc/testsuite/rust/compile/pattern-struct.rs
index 17275098cd2..db242418c1d 100644
--- a/gcc/testsuite/rust/compile/pattern-struct.rs
+++ b/gcc/testsuite/rust/compile/pattern-struct.rs
@@ -11,7 +11,7 @@ fn main() {
     fn bar(foo: A) {
         match foo {
             A::new() => (), 
-            // { dg-error "expected tuple struct or tuple variant, found associated function" "" { target *-*-* } .-1 }
+            // { dg-error "expected tuple struct or tuple variant, found function" "" { target *-*-* } .-1 }
             _ => {}
         }
     }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 037/125] gccrs: Clean BiMap to use tl::optional for lookups
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (34 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 036/125] gccrs: Ensure TupleStructPattern and TuplePattern have items Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 038/125] gccrs: Add support for external functions Arthur Cohen
                   ` (87 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Sourabh Jaiswal

From: Sourabh Jaiswal <sourabhrj31@gmail.com>

gcc/rust/Changelog:

	* expand/rust-expand-visitor.cc
	(ExpandVisitor::expand_inner_items): Adjust to use has_value ()
	(ExpandVisitor::expand_inner_stmts): Likewise
	* expand/rust-macro-builtins.cc (builtin_macro_from_string): Likewise
	(make_macro_path_str): Likewise
	* util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise
	* util/rust-lang-item.cc (LangItem::Parse): Adjust to return tl::optional
	(LangItem::toString) Likewise
	* util/rust-token-converter.cc (handle_suffix): Adjust to use value.or ()
	(from_literal) Likewise
	* util/bi-map.h (BiMap::lookup): Adjust to use tl::optional for
	lookups

Signed-off-by: Sourabh Jaiswal <sourabhrj31@gmail.com>
---
 gcc/rust/expand/rust-expand-visitor.cc |  8 ++++----
 gcc/rust/expand/rust-macro-builtins.cc |  8 ++++----
 gcc/rust/util/bi-map.h                 | 22 +++++++++++++++-------
 gcc/rust/util/rust-hir-map.cc          |  2 +-
 gcc/rust/util/rust-lang-item.cc        |  6 ++----
 gcc/rust/util/rust-token-converter.cc  |  5 ++---
 6 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc
index 6ca63115195..bd49fd91092 100644
--- a/gcc/rust/expand/rust-expand-visitor.cc
+++ b/gcc/rust/expand/rust-expand-visitor.cc
@@ -186,11 +186,11 @@ ExpandVisitor::expand_inner_items (
 		    {
 		      auto maybe_builtin = MacroBuiltin::builtins.lookup (
 			to_derive.get ().as_string ());
-		      if (MacroBuiltin::builtins.is_iter_ok (maybe_builtin))
+		      if (maybe_builtin.has_value ())
 			{
 			  auto new_item
 			    = builtin_derive_item (*item, current,
-						   maybe_builtin->second);
+						   maybe_builtin.value ());
 			  // this inserts the derive *before* the item - is it a
 			  // problem?
 			  it = items.insert (it, std::move (new_item));
@@ -272,11 +272,11 @@ ExpandVisitor::expand_inner_stmts (AST::BlockExpr &expr)
 		    {
 		      auto maybe_builtin = MacroBuiltin::builtins.lookup (
 			to_derive.get ().as_string ());
-		      if (MacroBuiltin::builtins.is_iter_ok (maybe_builtin))
+		      if (maybe_builtin.has_value ())
 			{
 			  auto new_item
 			    = builtin_derive_item (item, current,
-						   maybe_builtin->second);
+						   maybe_builtin.value ());
 			  // this inserts the derive *before* the item - is it a
 			  // problem?
 			  it = stmts.insert (it, std::move (new_item));
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index e4ca0d8ba3b..8cf32051c7a 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -142,9 +142,9 @@ tl::optional<BuiltinMacro>
 builtin_macro_from_string (const std::string &identifier)
 {
   auto macro = MacroBuiltin::builtins.lookup (identifier);
-  rust_assert (MacroBuiltin::builtins.is_iter_ok (macro));
+  rust_assert (macro.has_value ());
 
-  return macro->second;
+  return macro;
 }
 
 namespace {
@@ -152,9 +152,9 @@ std::string
 make_macro_path_str (BuiltinMacro kind)
 {
   auto str = MacroBuiltin::builtins.lookup (kind);
-  rust_assert (MacroBuiltin::builtins.is_iter_ok (str));
+  rust_assert (str.has_value ());
 
-  return str->second;
+  return str.value ();
 }
 
 static std::vector<std::unique_ptr<AST::MacroInvocation>>
diff --git a/gcc/rust/util/bi-map.h b/gcc/rust/util/bi-map.h
index ff26c833811..bc4f5800fb1 100644
--- a/gcc/rust/util/bi-map.h
+++ b/gcc/rust/util/bi-map.h
@@ -24,9 +24,6 @@
 // very simple bi-directional hashmap
 template <typename K, typename V> class BiMap
 {
-  using v_iter = typename std::unordered_map<K, V>::const_iterator;
-  using k_iter = typename std::unordered_map<V, K>::const_iterator;
-
 public:
   BiMap (std::unordered_map<K, V> &&original) : map (std::move (original))
   {
@@ -34,11 +31,22 @@ public:
       rmap.insert ({kv.second, kv.first});
   }
 
-  const v_iter lookup (const K &key) const { return map.find (key); }
-  const k_iter lookup (const V &key) const { return rmap.find (key); }
+  const tl::optional<const V &> lookup (const K &key) const
+  {
+    auto itr = map.find (key);
+    if (itr == map.end ())
+      return tl::nullopt;
+
+    return itr->second;
+  }
+  const tl::optional<const K &> lookup (const V &key) const
+  {
+    auto itr = rmap.find (key);
+    if (itr == rmap.end ())
+      return tl::nullopt;
 
-  bool is_iter_ok (const v_iter &iter) const { return iter != map.end (); }
-  bool is_iter_ok (const k_iter &iter) const { return iter != rmap.end (); }
+    return itr->second;
+  }
 
 private:
   std::unordered_map<K, V> map;
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc
index 1f7cb4d2c48..c62c11189ae 100644
--- a/gcc/rust/util/rust-hir-map.cc
+++ b/gcc/rust/util/rust-hir-map.cc
@@ -880,7 +880,7 @@ Mappings::insert_macro_def (AST::MacroRulesDefinition *macro)
     {
       auto builtin
 	= MacroBuiltin::builtins.lookup (macro->get_rule_name ().as_string ());
-      if (!MacroBuiltin::builtins.is_iter_ok (builtin))
+      if (!builtin.has_value ())
 	{
 	  rust_error_at (macro->get_locus (),
 			 "cannot find a built-in macro with name %qs",
diff --git a/gcc/rust/util/rust-lang-item.cc b/gcc/rust/util/rust-lang-item.cc
index 38df90f29a1..0d8a98077d1 100644
--- a/gcc/rust/util/rust-lang-item.cc
+++ b/gcc/rust/util/rust-lang-item.cc
@@ -97,17 +97,15 @@ tl::optional<LangItem::Kind>
 LangItem::Parse (const std::string &item)
 {
   auto lang_item = LangItem::lang_items.lookup (item);
-  if (!LangItem::lang_items.is_iter_ok (lang_item))
-    return tl::nullopt;
 
-  return lang_item->second;
+  return lang_item;
 }
 
 std::string
 LangItem::ToString (LangItem::Kind type)
 {
   auto str = LangItem::lang_items.lookup (type);
-  return str->second;
+  return str.value ();
 }
 
 LangItem::Kind
diff --git a/gcc/rust/util/rust-token-converter.cc b/gcc/rust/util/rust-token-converter.cc
index 41f810542de..220e891247f 100644
--- a/gcc/rust/util/rust-token-converter.cc
+++ b/gcc/rust/util/rust-token-converter.cc
@@ -67,7 +67,7 @@ handle_suffix (const const_TokenPtr &token, ProcMacro::LitKind kind)
 {
   auto str = token->as_string ();
   auto lookup = suffixes.lookup (token->get_type_hint ());
-  auto suffix = suffixes.is_iter_ok (lookup) ? lookup->second : "";
+  auto suffix = lookup.value_or ("");
   return ProcMacro::Literal::make_literal (kind, convert (token->get_locus ()),
 					   str, suffix);
 }
@@ -296,8 +296,7 @@ from_literal (const ProcMacro::Literal &literal,
 {
   auto lookup = suffixes.lookup (literal.suffix.to_string ());
   auto loc = convert (literal.span);
-  auto suffix
-    = suffixes.is_iter_ok (lookup) ? lookup->second : CORETYPE_UNKNOWN;
+  auto suffix = lookup.value_or (CORETYPE_UNKNOWN);
   // FIXME: Add spans instead of empty locations
   switch (literal.kind.tag)
     {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 038/125] gccrs: Add support for external functions
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (35 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 037/125] gccrs: Clean BiMap to use tl::optional for lookups Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 039/125] gccrs: Add get_pattern_kind to Pattern Arthur Cohen
                   ` (86 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, 0xn4utilus

From: 0xn4utilus <gyanendrabanjare8@gmail.com>

gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Function::Function): Add `is_external_function` field.
	(Function::operator=): Likewise.
	* ast/rust-ast.h: New constructor for ExternalItem.
	* ast/rust-item.h (class Function): Add `is_external_function`
	field. Update `get_node_id`.
	* ast/rust-macro.h: Update copy constructor.

Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
---
 gcc/rust/ast/rust-ast.cc  |  9 ++++++---
 gcc/rust/ast/rust-ast.h   |  4 +++-
 gcc/rust/ast/rust-item.h  | 41 +++++++++++++++++++++++++++------------
 gcc/rust/ast/rust-macro.h |  9 +++++----
 4 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index fbd795f6718..5d661989904 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -1061,9 +1061,11 @@ Union::as_string () const
 }
 
 Function::Function (Function const &other)
-  : VisItem (other), qualifiers (other.qualifiers),
-    function_name (other.function_name), where_clause (other.where_clause),
-    locus (other.locus), is_default (other.is_default)
+  : VisItem (other), ExternalItem (other.get_node_id ()),
+    qualifiers (other.qualifiers), function_name (other.function_name),
+    where_clause (other.where_clause), locus (other.locus),
+    is_default (other.is_default),
+    is_external_function (other.is_external_function)
 {
   // guard to prevent null dereference (always required)
   if (other.return_type != nullptr)
@@ -1095,6 +1097,7 @@ Function::operator= (Function const &other)
   // outer_attrs = other.outer_attrs;
   locus = other.locus;
   is_default = other.is_default;
+  is_external_function = other.is_external_function;
 
   // guard to prevent null dereference (always required)
   if (other.return_type != nullptr)
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index c4d5858dd63..92faaf297f9 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -1695,6 +1695,8 @@ class ExternalItem : public Visitable
 public:
   ExternalItem () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
 
+  ExternalItem (NodeId node_id) : node_id (node_id) {}
+
   virtual ~ExternalItem () {}
 
   // Unique pointer custom clone function
@@ -1708,7 +1710,7 @@ public:
   virtual void mark_for_strip () = 0;
   virtual bool is_marked_for_strip () const = 0;
 
-  NodeId get_node_id () const { return node_id; }
+  virtual NodeId get_node_id () const { return node_id; }
 
 protected:
   // Clone function implementation as pure virtual method
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index 44963ba386e..573888bea5a 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -1289,7 +1289,7 @@ protected:
 class LetStmt;
 
 // Rust function declaration AST node
-class Function : public VisItem, public AssociatedItem
+class Function : public VisItem, public AssociatedItem, public ExternalItem
 {
   FunctionQualifiers qualifiers;
   Identifier function_name;
@@ -1300,6 +1300,7 @@ class Function : public VisItem, public AssociatedItem
   tl::optional<std::unique_ptr<BlockExpr>> function_body;
   location_t locus;
   bool is_default;
+  bool is_external_function;
 
 public:
   std::string as_string () const override;
@@ -1330,16 +1331,17 @@ public:
 	    std::unique_ptr<Type> return_type, WhereClause where_clause,
 	    tl::optional<std::unique_ptr<BlockExpr>> function_body,
 	    Visibility vis, std::vector<Attribute> outer_attrs,
-	    location_t locus, bool is_default = false)
+	    location_t locus, bool is_default = false,
+	    bool is_external_function = false)
     : VisItem (std::move (vis), std::move (outer_attrs)),
-      qualifiers (std::move (qualifiers)),
+      ExternalItem (Stmt::node_id), qualifiers (std::move (qualifiers)),
       function_name (std::move (function_name)),
       generic_params (std::move (generic_params)),
       function_params (std::move (function_params)),
       return_type (std::move (return_type)),
       where_clause (std::move (where_clause)),
       function_body (std::move (function_body)), locus (locus),
-      is_default (is_default)
+      is_default (is_default), is_external_function (is_external_function)
   {}
 
   // TODO: add constructor with less fields
@@ -1364,6 +1366,8 @@ public:
 	   && function_params.back ()->is_variadic ();
   }
 
+  bool is_external () const { return is_external_function; }
+
   // Invalid if block is null, so base stripping on that.
   void mark_for_strip () override { function_body = nullptr; }
   bool is_marked_for_strip () const override
@@ -1422,6 +1426,9 @@ public:
     return function_params[0];
   }
 
+  // ExternalItem::node_id is same as Stmt::node_id
+  NodeId get_node_id () const override { return Stmt::node_id; }
+
 protected:
   /* Use covariance to implement clone function as returning this object
    * rather than base */
@@ -1433,6 +1440,13 @@ protected:
   {
     return new Function (*this);
   }
+
+  /* Use covariance to implement clone function as returning this object
+   * rather than base */
+  Function *clone_external_item_impl () const override
+  {
+    return new Function (*this);
+  }
 };
 
 // Rust type alias (i.e. typedef) AST node
@@ -3257,10 +3271,11 @@ public:
       item_name (std::move (item_name)), locus (locus), marked_for_strip (false)
   {}
 
+  // copy constructor
   ExternalTypeItem (ExternalTypeItem const &other)
-    : outer_attrs (other.outer_attrs), visibility (other.visibility),
-      item_name (other.item_name), locus (other.locus),
-      marked_for_strip (other.marked_for_strip)
+    : ExternalItem (other.get_node_id ()), outer_attrs (other.outer_attrs),
+      visibility (other.visibility), item_name (other.item_name),
+      locus (other.locus), marked_for_strip (other.marked_for_strip)
   {
     node_id = other.node_id;
   }
@@ -3340,8 +3355,9 @@ public:
 
   // Copy constructor
   ExternalStaticItem (ExternalStaticItem const &other)
-    : outer_attrs (other.outer_attrs), visibility (other.visibility),
-      item_name (other.item_name), locus (other.locus), has_mut (other.has_mut)
+    : ExternalItem (other.get_node_id ()), outer_attrs (other.outer_attrs),
+      visibility (other.visibility), item_name (other.item_name),
+      locus (other.locus), has_mut (other.has_mut)
   {
     node_id = other.node_id;
     // guard to prevent null dereference (only required if error state)
@@ -3607,9 +3623,10 @@ public:
 
   // Copy constructor with clone
   ExternalFunctionItem (ExternalFunctionItem const &other)
-    : outer_attrs (other.outer_attrs), visibility (other.visibility),
-      item_name (other.item_name), locus (other.locus),
-      where_clause (other.where_clause), function_params (other.function_params)
+    : ExternalItem (other.get_node_id ()), outer_attrs (other.outer_attrs),
+      visibility (other.visibility), item_name (other.item_name),
+      locus (other.locus), where_clause (other.where_clause),
+      function_params (other.function_params)
   {
     node_id = other.node_id;
     // guard to prevent null pointer dereference
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index bcf5b0b5a99..bfdebfc4203 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -722,10 +722,11 @@ private:
   {}
 
   MacroInvocation (const MacroInvocation &other)
-    : TraitItem (other.locus), outer_attrs (other.outer_attrs),
-      locus (other.locus), node_id (other.node_id),
-      invoc_data (other.invoc_data), is_semi_coloned (other.is_semi_coloned),
-      kind (other.kind), builtin_kind (other.builtin_kind)
+    : TraitItem (other.locus), ExternalItem (Expr::node_id),
+      outer_attrs (other.outer_attrs), locus (other.locus),
+      node_id (other.node_id), invoc_data (other.invoc_data),
+      is_semi_coloned (other.is_semi_coloned), kind (other.kind),
+      builtin_kind (other.builtin_kind)
   {
     if (other.kind == InvocKind::Builtin)
       for (auto &pending : other.pending_eager_invocs)
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 039/125] gccrs: Add get_pattern_kind to Pattern
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (36 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 038/125] gccrs: Add support for external functions Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 040/125] gccrs: Unify ASTValidation::visit for ExternalFunctionItem and Function Arthur Cohen
                   ` (85 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, 0xn4utilus

From: 0xn4utilus <gyanendrabanjare8@gmail.com>

gcc/rust/ChangeLog:

	* ast/rust-ast.h: Add Kind Enum to
	Pattern.
	* ast/rust-macro.h: Add get_pattern_kind().
	* ast/rust-path.h: Likewise.
	* ast/rust-pattern.h: Likewise.

Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
---
 gcc/rust/ast/rust-ast.h     | 20 ++++++++++++++++++++
 gcc/rust/ast/rust-macro.h   |  5 +++++
 gcc/rust/ast/rust-path.h    |  2 ++
 gcc/rust/ast/rust-pattern.h | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 60 insertions(+)

diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 92faaf297f9..edf726b1ffe 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -1360,12 +1360,32 @@ protected:
 class Pattern : public Visitable
 {
 public:
+  enum class Kind
+  {
+    Literal,
+    Identifier,
+    Wildcard,
+    Rest,
+    Range,
+    Reference,
+    Struct,
+    TupleStruct,
+    Tuple,
+    Grouped,
+    Slice,
+    Alt,
+    Path,
+    MacroInvocation,
+  };
+
   // Unique pointer custom clone function
   std::unique_ptr<Pattern> clone_pattern () const
   {
     return std::unique_ptr<Pattern> (clone_pattern_impl ());
   }
 
+  virtual Kind get_pattern_kind () = 0;
+
   // possible virtual methods: is_refutable()
 
   virtual ~Pattern () {}
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index bfdebfc4203..5b9ff3f22c8 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -610,6 +610,11 @@ public:
 
   std::string as_string () const override;
 
+  Pattern::Kind get_pattern_kind () override
+  {
+    return Pattern::Kind::MacroInvocation;
+  }
+
   /**
    * The default constructor you should use. Whenever we parse a macro call, we
    * cannot possibly know whether or not this call refers to a builtin macro or
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index ccac6303bb4..bd3012b1bed 100644
--- a/gcc/rust/ast/rust-path.h
+++ b/gcc/rust/ast/rust-path.h
@@ -578,6 +578,8 @@ public:
   // TODO: this seems kinda dodgy
   std::vector<PathExprSegment> &get_segments () { return segments; }
   const std::vector<PathExprSegment> &get_segments () const { return segments; }
+
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Path; }
 };
 
 /* AST node representing a path-in-expression pattern (path that allows
diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index 96f09355fae..365f3b7f69d 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -55,6 +55,8 @@ public:
 
   const Literal &get_literal () const { return lit; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Literal; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -149,6 +151,11 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override
+  {
+    return Pattern::Kind::Identifier;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -177,6 +184,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Wildcard; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -204,6 +213,8 @@ public:
 
   NodeId get_node_id () const override final { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Rest; }
+
 protected:
   RestPattern *clone_pattern_impl () const override
   {
@@ -431,6 +442,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Range; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -499,6 +512,11 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override
+  {
+    return Pattern::Kind::Reference;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -934,6 +952,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Struct; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1174,6 +1194,11 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override
+  {
+    return Pattern::Kind::TupleStruct;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1411,6 +1436,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Tuple; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1471,6 +1498,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Grouped; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1535,6 +1564,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Slice; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1600,6 +1631,8 @@ public:
 
   NodeId get_node_id () const override { return node_id; }
 
+  Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Alt; }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 040/125] gccrs: Unify ASTValidation::visit for ExternalFunctionItem and Function
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (37 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 039/125] gccrs: Add get_pattern_kind to Pattern Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 041/125] gccrs: Update resolver to use `AST::Function` instead of `AST::ExternalFunctionItem` Arthur Cohen
                   ` (84 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, 0xn4utilus

From: 0xn4utilus <gyanendrabanjare8@gmail.com>

gcc/rust/ChangeLog:

	* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
	Add external function validation support. Add ErrorCode::E0130.
	* parse/rust-parse-impl.h (Parser::parse_function): Parse
	external functions from `parse_function`.
	(Parser::parse_external_item): Clang format.
	(Parser::parse_pattern): Clang format.
	* parse/rust-parse.h: Add default parameter
	`is_external` in `parse_function`.

Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
---
 gcc/rust/checks/errors/rust-ast-validation.cc | 62 +++++++++++++++----
 gcc/rust/parse/rust-parse-impl.h              |  9 +--
 gcc/rust/parse/rust-parse.h                   |  3 +-
 3 files changed, 57 insertions(+), 17 deletions(-)

diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc
index bf70ca5d96f..f5a97b0d350 100644
--- a/gcc/rust/checks/errors/rust-ast-validation.cc
+++ b/gcc/rust/checks/errors/rust-ast-validation.cc
@@ -122,23 +122,61 @@ ASTValidation::visit (AST::Function &function)
       function.get_self_param ()->get_locus (),
       "%<self%> parameter is only allowed in associated functions");
 
-  if (!function.has_body ())
+  if (function.is_external ())
     {
-      if (context.back () == Context::INHERENT_IMPL
-	  || context.back () == Context::TRAIT_IMPL)
+      if (function.has_body ())
+	rust_error_at (function.get_locus (), "cannot have a body");
+
+      auto &params = function.get_function_params ();
+
+      if (params.size () == 1 && function.is_variadic ())
 	rust_error_at (function.get_locus (),
-		       "associated function in %<impl%> without body");
-      else if (context.back () != Context::TRAIT)
-	rust_error_at (function.get_locus (), "free function without a body");
+		       "C-variadic function must be declared with at least one "
+		       "named argument");
+
+      for (auto it = params.begin (); it != params.end (); it++)
+	{
+	  if (it->get ()->is_variadic () && it + 1 != params.end ())
+	    rust_error_at (
+	      it->get ()->get_locus (),
+	      "%<...%> must be the last argument of a C-variadic function");
+
+	  // if functional parameter
+	  if (!it->get ()->is_self () && !it->get ()->is_variadic ())
+	    {
+	      auto param = static_cast<AST::FunctionParam *> (it->get ());
+	      auto kind = param->get_pattern ()->get_pattern_kind ();
+
+	      if (kind != AST::Pattern::Kind::Identifier
+		  && kind != AST::Pattern::Kind::Wildcard)
+		rust_error_at (it->get ()->get_locus (), ErrorCode::E0130,
+			       "pattern not allowed in foreign function");
+	    }
+	}
     }
 
-  auto &function_params = function.get_function_params ();
-  for (auto it = function_params.begin (); it != function_params.end (); it++)
+  else
     {
-      if (it->get ()->is_variadic ())
-	rust_error_at (it->get ()->get_locus (),
-		       "only foreign or %<unsafe extern \"C\"%> functions may "
-		       "be C-variadic");
+      if (!function.has_body ())
+	{
+	  if (context.back () == Context::INHERENT_IMPL
+	      || context.back () == Context::TRAIT_IMPL)
+	    rust_error_at (function.get_locus (),
+			   "associated function in %<impl%> without body");
+	  else if (context.back () != Context::TRAIT)
+	    rust_error_at (function.get_locus (),
+			   "free function without a body");
+	}
+      auto &function_params = function.get_function_params ();
+      for (auto it = function_params.begin (); it != function_params.end ();
+	   it++)
+	{
+	  if (it->get ()->is_variadic ())
+	    rust_error_at (
+	      it->get ()->get_locus (),
+	      "only foreign or %<unsafe extern \"C\"%> functions may "
+	      "be C-variadic");
+	}
     }
 
   AST::ContextualASTVisitor::visit (function);
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 9d9722e9714..c8a87a11766 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -2908,7 +2908,8 @@ Parser<ManagedTokenSource>::parse_use_tree ()
 template <typename ManagedTokenSource>
 std::unique_ptr<AST::Function>
 Parser<ManagedTokenSource>::parse_function (AST::Visibility vis,
-					    AST::AttrVec outer_attrs)
+					    AST::AttrVec outer_attrs,
+					    bool is_external)
 {
   location_t locus = lexer.peek_token ()->get_locus ();
   // Get qualifiers for function if they exist
@@ -2992,7 +2993,7 @@ Parser<ManagedTokenSource>::parse_function (AST::Visibility vis,
 		       std::move (generic_params), std::move (function_params),
 		       std::move (return_type), std::move (where_clause),
 		       std::move (body), std::move (vis),
-		       std::move (outer_attrs), locus));
+		       std::move (outer_attrs), locus, false, is_external));
 }
 
 // Parses function or method qualifiers (i.e. const, unsafe, and extern).
@@ -6166,6 +6167,7 @@ Parser<ManagedTokenSource>::parse_external_item ()
     case FN_KW:
       return parse_external_function_item (std::move (vis),
 					   std::move (outer_attrs));
+
     case TYPE:
       return parse_external_type_item (std::move (vis),
 				       std::move (outer_attrs));
@@ -10474,8 +10476,7 @@ Parser<ManagedTokenSource>::parse_pattern ()
     {
       lexer.skip_token ();
       alts.push_back (parse_pattern_no_alt ());
-    }
-  while (lexer.peek_token ()->get_id () == PIPE);
+  } while (lexer.peek_token ()->get_id () == PIPE);
 
   /* alternates */
   return std::unique_ptr<AST::Pattern> (
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 8c8bf96eb8d..cdddfa6dff9 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -253,7 +253,8 @@ private:
   parse_use_decl (AST::Visibility vis, AST::AttrVec outer_attrs);
   std::unique_ptr<AST::UseTree> parse_use_tree ();
   std::unique_ptr<AST::Function> parse_function (AST::Visibility vis,
-						 AST::AttrVec outer_attrs);
+						 AST::AttrVec outer_attrs,
+						 bool is_external = false);
   AST::FunctionQualifiers parse_function_qualifiers ();
   std::vector<std::unique_ptr<AST::GenericParam>>
   parse_generic_params_in_angles ();
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 041/125] gccrs: Update resolver to use `AST::Function` instead of `AST::ExternalFunctionItem`
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (38 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 040/125] gccrs: Unify ASTValidation::visit for ExternalFunctionItem and Function Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 042/125] gccrs: Remove dead code associated with `AST::ExternalFunctionItem` Arthur Cohen
                   ` (83 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, 0xn4utilus

From: 0xn4utilus <gyanendrabanjare8@gmail.com>

gcc/rust/ChangeLog:

	* checks/errors/rust-feature-gate.cc (FeatureGate::visit):
	Check if function is_external or not.
	* hir/rust-ast-lower-extern.h: Use AST::Function
	instead of AST::ExternalFunctionItem.
	* parse/rust-parse-impl.h (Parser::parse_external_item):
	Likewise.
	(Parser::parse_pattern): Fix clang format.
	* resolve/rust-ast-resolve-implitem.h: Likewise.
	* resolve/rust-ast-resolve-item.cc (ResolveExternItem::visit):
	Likewise.
	* resolve/rust-ast-resolve-item.h: Likewise.
	* resolve/rust-default-resolver.cc (DefaultResolver::visit):
	Check if param has_pattern before using get_pattern.

Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
---
 gcc/rust/checks/errors/rust-feature-gate.cc  |  3 ++-
 gcc/rust/hir/rust-ast-lower-extern.h         | 23 +++++++++++++++-----
 gcc/rust/parse/rust-parse-impl.h             |  7 +++---
 gcc/rust/resolve/rust-ast-resolve-implitem.h |  4 ++--
 gcc/rust/resolve/rust-ast-resolve-item.cc    | 16 +++++++++-----
 gcc/rust/resolve/rust-ast-resolve-item.h     |  2 +-
 gcc/rust/resolve/rust-default-resolver.cc    |  3 ++-
 7 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/gcc/rust/checks/errors/rust-feature-gate.cc b/gcc/rust/checks/errors/rust-feature-gate.cc
index 3c943022f05..33bbfa1ec51 100644
--- a/gcc/rust/checks/errors/rust-feature-gate.cc
+++ b/gcc/rust/checks/errors/rust-feature-gate.cc
@@ -131,7 +131,8 @@ FeatureGate::visit (AST::MacroRulesDefinition &rules_def)
 void
 FeatureGate::visit (AST::Function &function)
 {
-  check_rustc_attri (function.get_outer_attrs ());
+  if (!function.is_external ())
+    check_rustc_attri (function.get_outer_attrs ());
 }
 
 void
diff --git a/gcc/rust/hir/rust-ast-lower-extern.h b/gcc/rust/hir/rust-ast-lower-extern.h
index f9e067c8e95..ad7d75422d6 100644
--- a/gcc/rust/hir/rust-ast-lower-extern.h
+++ b/gcc/rust/hir/rust-ast-lower-extern.h
@@ -65,7 +65,7 @@ public:
       item.get_outer_attrs (), item.get_locus ());
   }
 
-  void visit (AST::ExternalFunctionItem &function) override
+  void visit (AST::Function &function) override
   {
     std::vector<std::unique_ptr<HIR::WhereClauseItem> > where_clause_items;
     HIR::WhereClause where_clause (std::move (where_clause_items));
@@ -88,12 +88,25 @@ public:
     std::vector<HIR::NamedFunctionParam> function_params;
     for (auto it = begin; it != end; it++)
       {
+	auto param = static_cast<AST::FunctionParam *> (it->get ());
+
+	if (param->is_variadic () || param->is_self ())
+	  continue;
+	auto param_kind = param->get_pattern ()->get_pattern_kind ();
+
+	rust_assert (param_kind == AST::Pattern::Kind::Identifier
+		     || param_kind == AST::Pattern::Kind::Wildcard);
+	auto param_ident = static_cast<AST::IdentifierPattern *> (
+	  param->get_pattern ().get ());
+	Identifier param_name = param_kind == AST::Pattern::Kind::Identifier
+				  ? param_ident->get_ident ()
+				  : std::string ("_");
+
 	HIR::Type *param_type
-	  = ASTLoweringType::translate (it->get_type ().get ());
-	Identifier param_name = it->get_name ();
+	  = ASTLoweringType::translate (param->get_type ().get ());
 
 	auto crate_num = mappings->get_current_crate ();
-	Analysis::NodeMapping mapping (crate_num, it->get_node_id (),
+	Analysis::NodeMapping mapping (crate_num, param->get_node_id (),
 				       mappings->get_next_hir_id (crate_num),
 				       mappings->get_next_localdef_id (
 					 crate_num));
@@ -109,7 +122,7 @@ public:
 				   mappings->get_next_localdef_id (crate_num));
 
     translated = new HIR::ExternalFunctionItem (
-      mapping, function.get_identifier (), std::move (generic_params),
+      mapping, function.get_function_name (), std::move (generic_params),
       std::unique_ptr<HIR::Type> (return_type), std::move (where_clause),
       std::move (function_params), is_variadic, std::move (vis),
       function.get_outer_attrs (), function.get_locus ());
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index c8a87a11766..26b24150f7a 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -6165,8 +6165,7 @@ Parser<ManagedTokenSource>::parse_external_item ()
 				       std::move (outer_attrs), locus));
       }
     case FN_KW:
-      return parse_external_function_item (std::move (vis),
-					   std::move (outer_attrs));
+      return parse_function (std::move (vis), std::move (outer_attrs), true);
 
     case TYPE:
       return parse_external_type_item (std::move (vis),
@@ -10476,7 +10475,9 @@ Parser<ManagedTokenSource>::parse_pattern ()
     {
       lexer.skip_token ();
       alts.push_back (parse_pattern_no_alt ());
-  } while (lexer.peek_token ()->get_id () == PIPE);
+    }
+
+  while (lexer.peek_token ()->get_id () == PIPE);
 
   /* alternates */
   return std::unique_ptr<AST::Pattern> (
diff --git a/gcc/rust/resolve/rust-ast-resolve-implitem.h b/gcc/rust/resolve/rust-ast-resolve-implitem.h
index 4f4d2893f83..fa344effe67 100644
--- a/gcc/rust/resolve/rust-ast-resolve-implitem.h
+++ b/gcc/rust/resolve/rust-ast-resolve-implitem.h
@@ -189,11 +189,11 @@ public:
     item->accept_vis (resolver);
   };
 
-  void visit (AST::ExternalFunctionItem &function) override
+  void visit (AST::Function &function) override
   {
     auto decl
       = CanonicalPath::new_seg (function.get_node_id (),
-				function.get_identifier ().as_string ());
+				function.get_function_name ().as_string ());
     auto path = prefix.append (decl);
 
     resolver->get_name_scope ().insert (
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc
index 743657bc421..a3f27b3e4a0 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-item.cc
@@ -1009,11 +1009,12 @@ ResolveExternItem::go (AST::ExternalItem *item, const CanonicalPath &prefix,
 }
 
 void
-ResolveExternItem::visit (AST::ExternalFunctionItem &function)
+ResolveExternItem::visit (AST::Function &function)
 {
   NodeId scope_node_id = function.get_node_id ();
-  auto decl = CanonicalPath::new_seg (function.get_node_id (),
-				      function.get_identifier ().as_string ());
+  auto decl
+    = CanonicalPath::new_seg (function.get_node_id (),
+			      function.get_function_name ().as_string ());
   auto path = prefix.append (decl);
   auto cpath = canonical_prefix.append (decl);
 
@@ -1038,9 +1039,12 @@ ResolveExternItem::visit (AST::ExternalFunctionItem &function)
 
   // we make a new scope so the names of parameters are resolved and shadowed
   // correctly
-  for (auto &param : function.get_function_params ())
-    if (!param.is_variadic ())
-      ResolveType::go (param.get_type ().get ());
+  for (auto &it : function.get_function_params ())
+    if (!it->is_variadic ())
+      {
+	auto param = static_cast<AST::FunctionParam *> (it.get ());
+	ResolveType::go (param->get_type ().get ());
+      }
 
   // done
   resolver->get_name_scope ().pop ();
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h
index e397ffdfe8b..0133d2ca27f 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.h
+++ b/gcc/rust/resolve/rust-ast-resolve-item.h
@@ -111,7 +111,7 @@ public:
   static void go (AST::ExternalItem *item, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix);
 
-  void visit (AST::ExternalFunctionItem &function) override;
+  void visit (AST::Function &function) override;
   void visit (AST::ExternalStaticItem &item) override;
 
 private:
diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 28f04a10839..c99f2f64331 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -62,7 +62,8 @@ DefaultResolver::visit (AST::Function &function)
 	if (p->is_variadic ())
 	  {
 	    auto param = static_cast<AST::VariadicParam *> (p.get ());
-	    param->get_pattern ()->accept_vis (*this);
+	    if (param->has_pattern ())
+	      param->get_pattern ()->accept_vis (*this);
 	  }
 	else if (p->is_self ())
 	  {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 042/125] gccrs: Remove dead code associated with `AST::ExternalFunctionItem`
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (39 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 041/125] gccrs: Update resolver to use `AST::Function` instead of `AST::ExternalFunctionItem` Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 043/125] gccrs: Placate clang-format re 'gcc/rust/backend/rust-tree.cc' Arthur Cohen
                   ` (82 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, 0xn4utilus

From: 0xn4utilus <gyanendrabanjare8@gmail.com>

gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit):
	Remove dead code.
	* ast/rust-ast-collector.h: Likewise.
	* ast/rust-ast-full-decls.h (class ExternalFunctionItem):
	Likewise.
	* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):
	Likewise.
	* ast/rust-ast-visitor.h: Likewise.
	* ast/rust-ast.cc (ExternalFunctionItem::as_string): Likewise.
	(ExternalFunctionItem::accept_vis): Likewise.
	* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
	Likewise.
	* checks/errors/rust-ast-validation.h: Likewise.
	* checks/errors/rust-feature-gate.h: Likewise.
	* expand/rust-cfg-strip.cc (CfgStrip::visit):
	Likewise.
	* expand/rust-cfg-strip.h: Likewise.
	* expand/rust-derive.h: Likewise.
	* expand/rust-expand-visitor.cc (ExpandVisitor::visit):
	Likewise.
	* expand/rust-expand-visitor.h: Likewise.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit):
	Likewise.
	* hir/rust-ast-lower-base.h: Likewise.
	* metadata/rust-export-metadata.cc (ExportContext::emit_function):
	Likewise.
	* parse/rust-parse-impl.h: Likewise.
	* parse/rust-parse.h: Likewise.
	* resolve/rust-ast-resolve-base.cc (ResolverBase::visit):
	Likewise.
	* resolve/rust-ast-resolve-base.h: Likewise.
	* resolve/rust-default-resolver.cc (DefaultResolver::visit):
	Likewise.
	* resolve/rust-default-resolver.h: Likewise.
	* util/rust-attributes.cc (AttributeChecker::visit): Likewise.
	* util/rust-attributes.h: Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/extern_func_with_body.rs: New test.

Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
---
 gcc/rust/ast/rust-ast-collector.cc            | 25 -------
 gcc/rust/ast/rust-ast-collector.h             |  1 -
 gcc/rust/ast/rust-ast-full-decls.h            |  1 -
 gcc/rust/ast/rust-ast-visitor.cc              | 18 -----
 gcc/rust/ast/rust-ast-visitor.h               |  2 -
 gcc/rust/ast/rust-ast.cc                      | 69 -------------------
 gcc/rust/checks/errors/rust-ast-validation.cc | 19 -----
 gcc/rust/checks/errors/rust-ast-validation.h  |  1 -
 gcc/rust/checks/errors/rust-feature-gate.h    |  1 -
 gcc/rust/expand/rust-cfg-strip.cc             | 56 ---------------
 gcc/rust/expand/rust-cfg-strip.h              |  1 -
 gcc/rust/expand/rust-derive.h                 |  1 -
 gcc/rust/expand/rust-expand-visitor.cc        | 17 -----
 gcc/rust/expand/rust-expand-visitor.h         |  1 -
 gcc/rust/hir/rust-ast-lower-base.cc           |  3 -
 gcc/rust/hir/rust-ast-lower-base.h            |  1 -
 gcc/rust/metadata/rust-export-metadata.cc     | 41 +----------
 gcc/rust/parse/rust-parse-impl.h              | 62 -----------------
 gcc/rust/parse/rust-parse.h                   |  2 -
 gcc/rust/resolve/rust-ast-resolve-base.cc     |  4 --
 gcc/rust/resolve/rust-ast-resolve-base.h      |  1 -
 gcc/rust/resolve/rust-default-resolver.cc     |  4 --
 gcc/rust/resolve/rust-default-resolver.h      |  1 -
 gcc/rust/util/rust-attributes.cc              |  4 --
 gcc/rust/util/rust-attributes.h               |  1 -
 .../rust/compile/extern_func_with_body.rs     |  5 ++
 26 files changed, 7 insertions(+), 335 deletions(-)
 create mode 100644 gcc/testsuite/rust/compile/extern_func_with_body.rs

diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index 744d0eb9d28..eb03dccaf84 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -2084,31 +2084,6 @@ TokenCollector::visit (ExternalStaticItem &item)
   push (Rust::Token::make (SEMICOLON, UNDEF_LOCATION));
 }
 
-void
-TokenCollector::visit (ExternalFunctionItem &function)
-{
-  visit_items_as_lines (function.get_outer_attrs ());
-  visit (function.get_visibility ());
-
-  auto id = function.get_identifier ().as_string ();
-
-  push (Rust::Token::make (FN_KW, function.get_locus ()));
-  push (Rust::Token::make_identifier (UNDEF_LOCATION, std::move (id)));
-  if (function.has_generics ())
-    visit (function.get_generic_params ());
-  push (Rust::Token::make (LEFT_PAREN, UNDEF_LOCATION));
-
-  visit_items_joined_by_separator (function.get_function_params ());
-
-  push (Rust::Token::make (RIGHT_PAREN, UNDEF_LOCATION));
-  if (function.has_return_type ())
-    {
-      push (Rust::Token::make (RETURN_TYPE, UNDEF_LOCATION));
-      visit (function.get_return_type ());
-    }
-  push (Rust::Token::make (SEMICOLON, UNDEF_LOCATION));
-}
-
 void
 TokenCollector::visit (ExternBlock &block)
 {
diff --git a/gcc/rust/ast/rust-ast-collector.h b/gcc/rust/ast/rust-ast-collector.h
index ec695ef5b31..fdc99bb7086 100644
--- a/gcc/rust/ast/rust-ast-collector.h
+++ b/gcc/rust/ast/rust-ast-collector.h
@@ -333,7 +333,6 @@ public:
   void visit (TraitImpl &impl);
   void visit (ExternalTypeItem &item);
   void visit (ExternalStaticItem &item);
-  void visit (ExternalFunctionItem &item);
   void visit (ExternBlock &block);
 
   // rust-macro.h
diff --git a/gcc/rust/ast/rust-ast-full-decls.h b/gcc/rust/ast/rust-ast-full-decls.h
index 8d5c8dbc821..dd982c448e0 100644
--- a/gcc/rust/ast/rust-ast-full-decls.h
+++ b/gcc/rust/ast/rust-ast-full-decls.h
@@ -203,7 +203,6 @@ class ExternalItem;
 class ExternalTypeItem;
 class ExternalStaticItem;
 class NamedFunctionParam;
-class ExternalFunctionItem;
 class ExternBlock;
 
 // rust-macro.h
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc
index 697c2726309..de4242afeb5 100644
--- a/gcc/rust/ast/rust-ast-visitor.cc
+++ b/gcc/rust/ast/rust-ast-visitor.cc
@@ -1004,24 +1004,6 @@ DefaultASTVisitor::visit (AST::NamedFunctionParam &param)
     visit (param.get_type ());
 }
 
-void
-DefaultASTVisitor::visit (AST::ExternalFunctionItem &item)
-{
-  visit_outer_attrs (item);
-  visit (item.get_visibility ());
-  for (auto &generic : item.get_generic_params ())
-    visit (generic);
-
-  if (item.has_where_clause ())
-    visit (item.get_where_clause ());
-
-  for (auto &param : item.get_function_params ())
-    visit (param);
-
-  if (item.has_return_type ())
-    visit (item.get_return_type ());
-}
-
 void
 DefaultASTVisitor::visit (AST::ExternBlock &block)
 {
diff --git a/gcc/rust/ast/rust-ast-visitor.h b/gcc/rust/ast/rust-ast-visitor.h
index c5c9a025ba6..622e7f766a3 100644
--- a/gcc/rust/ast/rust-ast-visitor.h
+++ b/gcc/rust/ast/rust-ast-visitor.h
@@ -164,7 +164,6 @@ public:
   // virtual void visit(ExternalItem& item) = 0;
   virtual void visit (ExternalTypeItem &type) = 0;
   virtual void visit (ExternalStaticItem &item) = 0;
-  virtual void visit (ExternalFunctionItem &item) = 0;
   virtual void visit (ExternBlock &block) = 0;
 
   // rust-macro.h
@@ -338,7 +337,6 @@ protected:
   virtual void visit (AST::TraitImpl &impl) override;
   virtual void visit (AST::ExternalTypeItem &item) override;
   virtual void visit (AST::ExternalStaticItem &item) override;
-  virtual void visit (AST::ExternalFunctionItem &item) override;
   virtual void visit (AST::ExternBlock &block) override;
   virtual void visit (AST::MacroMatchFragment &match) override;
   virtual void visit (AST::MacroMatchRepetition &match) override;
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index 5d661989904..6eb3394c146 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -2974,69 +2974,6 @@ ExternalStaticItem::as_string () const
   return str;
 }
 
-std::string
-ExternalFunctionItem::as_string () const
-{
-  // outer attributes
-  std::string str = append_attributes (outer_attrs, OUTER);
-
-  // start visibility on new line and with a space
-  str += "\n" + visibility.as_string () + " ";
-
-  str += "fn ";
-
-  // add name
-  str += item_name.as_string ();
-
-  // generic params
-  str += "\n Generic params: ";
-  if (generic_params.empty ())
-    {
-      str += "none";
-    }
-  else
-    {
-      for (const auto &param : generic_params)
-	{
-	  // DEBUG: null pointer check
-	  if (param == nullptr)
-	    {
-	      rust_debug (
-		"something really terrible has gone wrong - null pointer "
-		"generic param in external function item.");
-	      return "NULL_POINTER_MARK";
-	    }
-
-	  str += "\n  " + param->as_string ();
-	}
-    }
-
-  // function params
-  str += "\n Function params: ";
-  if (function_params.empty ())
-    {
-      str += "none";
-    }
-  else
-    {
-      for (const auto &param : function_params)
-	str += "\n  " + param.as_string ();
-    }
-
-  // add type on new line
-  str += "\n (return) Type: "
-	 + (has_return_type () ? return_type->as_string () : "()");
-
-  // where clause
-  str += "\n Where clause: ";
-  if (has_where_clause ())
-    str += where_clause.as_string ();
-  else
-    str += "none";
-
-  return str;
-}
-
 std::string
 NamedFunctionParam::as_string () const
 {
@@ -4866,12 +4803,6 @@ ExternalStaticItem::accept_vis (ASTVisitor &vis)
   vis.visit (*this);
 }
 
-void
-ExternalFunctionItem::accept_vis (ASTVisitor &vis)
-{
-  vis.visit (*this);
-}
-
 void
 ExternBlock::accept_vis (ASTVisitor &vis)
 {
diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc
index f5a97b0d350..d1edb890ae6 100644
--- a/gcc/rust/checks/errors/rust-ast-validation.cc
+++ b/gcc/rust/checks/errors/rust-ast-validation.cc
@@ -64,25 +64,6 @@ ASTValidation::visit (AST::ConstantItem &const_item)
   AST::ContextualASTVisitor::visit (const_item);
 }
 
-void
-ASTValidation::visit (AST::ExternalFunctionItem &item)
-{
-  auto &params = item.get_function_params ();
-
-  if (params.size () == 1 && params[0].is_variadic ())
-    rust_error_at (
-      params[0].get_locus (),
-      "C-variadic function must be declared with at least one named argument");
-
-  for (auto it = params.begin (); it != params.end (); it++)
-    if (it->is_variadic () && it + 1 != params.end ())
-      rust_error_at (
-	it->get_locus (),
-	"%<...%> must be the last argument of a C-variadic function");
-
-  AST::ContextualASTVisitor::visit (item);
-}
-
 void
 ASTValidation::visit (AST::Union &item)
 {
diff --git a/gcc/rust/checks/errors/rust-ast-validation.h b/gcc/rust/checks/errors/rust-ast-validation.h
index 641fb26f089..53352c1a64e 100644
--- a/gcc/rust/checks/errors/rust-ast-validation.h
+++ b/gcc/rust/checks/errors/rust-ast-validation.h
@@ -38,7 +38,6 @@ public:
   virtual void visit (AST::ConstantItem &const_item);
   virtual void visit (AST::Lifetime &lifetime);
   virtual void visit (AST::LoopLabel &label);
-  virtual void visit (AST::ExternalFunctionItem &item);
   virtual void visit (AST::Union &item);
   virtual void visit (AST::Function &function);
   virtual void visit (AST::Trait &trait);
diff --git a/gcc/rust/checks/errors/rust-feature-gate.h b/gcc/rust/checks/errors/rust-feature-gate.h
index ef7449aa581..481b5a53061 100644
--- a/gcc/rust/checks/errors/rust-feature-gate.h
+++ b/gcc/rust/checks/errors/rust-feature-gate.h
@@ -130,7 +130,6 @@ public:
   void visit (AST::Trait &trait) override {}
   void visit (AST::ExternalTypeItem &item) override;
   void visit (AST::ExternalStaticItem &item) override {}
-  void visit (AST::ExternalFunctionItem &item) override {}
   void visit (AST::ExternBlock &block) override;
   void visit (AST::MacroMatchFragment &match) override {}
   void visit (AST::MacroMatchRepetition &match) override {}
diff --git a/gcc/rust/expand/rust-cfg-strip.cc b/gcc/rust/expand/rust-cfg-strip.cc
index 2b51a890247..923015fa05e 100644
--- a/gcc/rust/expand/rust-cfg-strip.cc
+++ b/gcc/rust/expand/rust-cfg-strip.cc
@@ -2195,62 +2195,6 @@ CfgStrip::visit (AST::ExternalStaticItem &item)
     rust_error_at (type->get_locus (), "cannot strip type in this position");
 }
 
-void
-CfgStrip::visit (AST::ExternalFunctionItem &item)
-{
-  // strip test based on outer attrs
-  expand_cfg_attrs (item.get_outer_attrs ());
-  if (fails_cfg_with_expand (item.get_outer_attrs ()))
-    {
-      item.mark_for_strip ();
-      return;
-    }
-
-  AST::DefaultASTVisitor::visit (item);
-
-  /* strip function parameters if required - this is specifically
-   * allowed by spec */
-  auto &params = item.get_function_params ();
-  for (auto it = params.begin (); it != params.end ();)
-    {
-      auto &param = *it;
-
-      auto &param_attrs = param.get_outer_attrs ();
-      expand_cfg_attrs (param_attrs);
-      if (fails_cfg_with_expand (param_attrs))
-	{
-	  it = params.erase (it);
-	  continue;
-	}
-
-      if (!param.is_variadic ())
-	{
-	  auto &type = param.get_type ();
-	  if (type->is_marked_for_strip ())
-	    rust_error_at (type->get_locus (),
-			   "cannot strip type in this position");
-	}
-
-      // increment if nothing else happens
-      ++it;
-    }
-  /* NOTE: these are extern function params, which may have different
-   * rules and restrictions to "normal" function params. So expansion
-   * handled separately. */
-
-  /* TODO: assuming that variadic nature cannot be stripped. If this
-   * is not true, then have code here to do so. */
-
-  if (item.has_return_type ())
-    {
-      auto &return_type = item.get_return_type ();
-
-      if (return_type->is_marked_for_strip ())
-	rust_error_at (return_type->get_locus (),
-		       "cannot strip type in this position");
-    }
-}
-
 void
 CfgStrip::visit (AST::ExternBlock &block)
 {
diff --git a/gcc/rust/expand/rust-cfg-strip.h b/gcc/rust/expand/rust-cfg-strip.h
index a3931823ab1..4a8e6041ff2 100644
--- a/gcc/rust/expand/rust-cfg-strip.h
+++ b/gcc/rust/expand/rust-cfg-strip.h
@@ -150,7 +150,6 @@ public:
   void visit (AST::TraitImpl &impl) override;
   void visit (AST::ExternalTypeItem &item) override;
   void visit (AST::ExternalStaticItem &item) override;
-  void visit (AST::ExternalFunctionItem &item) override;
   void visit (AST::ExternBlock &block) override;
 
   // I don't think it would be possible to strip macros without expansion
diff --git a/gcc/rust/expand/rust-derive.h b/gcc/rust/expand/rust-derive.h
index f953c3decbf..cbe5bbbcbea 100644
--- a/gcc/rust/expand/rust-derive.h
+++ b/gcc/rust/expand/rust-derive.h
@@ -166,7 +166,6 @@ private:
   virtual void visit (TraitImpl &impl) override final{};
   virtual void visit (ExternalTypeItem &type) override final{};
   virtual void visit (ExternalStaticItem &item) override final{};
-  virtual void visit (ExternalFunctionItem &item) override final{};
   virtual void visit (ExternBlock &block) override final{};
   virtual void visit (MacroMatchFragment &match) override final{};
   virtual void visit (MacroMatchRepetition &match) override final{};
diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc
index bd49fd91092..6c1efb1d2e0 100644
--- a/gcc/rust/expand/rust-expand-visitor.cc
+++ b/gcc/rust/expand/rust-expand-visitor.cc
@@ -922,23 +922,6 @@ ExpandVisitor::visit (AST::ExternalStaticItem &static_item)
   maybe_expand_type (static_item.get_type ());
 }
 
-void
-ExpandVisitor::visit (AST::ExternalFunctionItem &item)
-{
-  for (auto &param : item.get_generic_params ())
-    visit (param);
-
-  for (auto &param : item.get_function_params ())
-    if (!param.is_variadic ())
-      maybe_expand_type (param.get_type ());
-
-  if (item.has_return_type ())
-    maybe_expand_type (item.get_return_type ());
-
-  if (item.has_where_clause ())
-    expand_where_clause (item.get_where_clause ());
-}
-
 void
 ExpandVisitor::visit (AST::ExternBlock &block)
 {
diff --git a/gcc/rust/expand/rust-expand-visitor.h b/gcc/rust/expand/rust-expand-visitor.h
index f40b5773fc1..034aeede2f4 100644
--- a/gcc/rust/expand/rust-expand-visitor.h
+++ b/gcc/rust/expand/rust-expand-visitor.h
@@ -252,7 +252,6 @@ public:
   void visit (AST::TraitImpl &impl) override;
   void visit (AST::ExternalTypeItem &item) override;
   void visit (AST::ExternalStaticItem &item) override;
-  void visit (AST::ExternalFunctionItem &item) override;
   void visit (AST::ExternBlock &block) override;
 
   // I don't think it would be possible to strip macros without expansion
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index 54c05208e7b..ff6ef25a348 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -345,9 +345,6 @@ void
 ASTLoweringBase::visit (AST::ExternalStaticItem &)
 {}
 void
-ASTLoweringBase::visit (AST::ExternalFunctionItem &)
-{}
-void
 ASTLoweringBase::visit (AST::ExternBlock &)
 {}
 
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index 7b0ce375f83..c19e9c03b5f 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -186,7 +186,6 @@ public:
   //  virtual void visit(ExternalItem& item);
   virtual void visit (AST::ExternalTypeItem &item);
   virtual void visit (AST::ExternalStaticItem &item);
-  virtual void visit (AST::ExternalFunctionItem &item);
   virtual void visit (AST::ExternBlock &block);
 
   // rust-macro.h
diff --git a/gcc/rust/metadata/rust-export-metadata.cc b/gcc/rust/metadata/rust-export-metadata.cc
index a946c67422d..589511ef9ce 100644
--- a/gcc/rust/metadata/rust-export-metadata.cc
+++ b/gcc/rust/metadata/rust-export-metadata.cc
@@ -93,46 +93,9 @@ ExportContext::emit_function (const HIR::Function &fn)
       // FIXME assert that this is actually an AST::Function
       AST::Function &function = static_cast<AST::Function &> (vis_item);
 
-      // we can emit an extern block with abi of "rust"
-      Identifier item_name = function.get_function_name ();
-
-      // always empty for extern linkage
-      AST::WhereClause where_clause = AST::WhereClause::create_empty ();
-      std::vector<std::unique_ptr<AST::GenericParam>> generic_params;
-
-      AST::Visibility vis = function.get_visibility ();
-      std::unique_ptr<AST::Type> return_type
-	= std::unique_ptr<AST::Type> (nullptr);
-      if (function.has_return_type ())
-	{
-	  return_type = function.get_return_type ()->clone_type ();
-	}
-
-      std::vector<AST::NamedFunctionParam> function_params;
-      for (auto &p : function.get_function_params ())
-	{
-	  if (p->is_variadic () || p->is_self ())
-	    rust_unreachable ();
-	  auto param = static_cast<AST::FunctionParam *> (p.get ());
-	  std::string name = param->get_pattern ()->as_string ();
-	  std::unique_ptr<AST::Type> param_type
-	    = param->get_type ()->clone_type ();
-
-	  AST::NamedFunctionParam np (name, std::move (param_type), {},
-				      param->get_locus ());
-	  function_params.push_back (std::move (np));
-	}
-
-      AST::ExternalItem *external_item
-	= new AST::ExternalFunctionItem (item_name, {} /* generic_params */,
-					 std::move (return_type), where_clause,
-					 std::move (function_params), vis,
-					 function.get_outer_attrs (),
-					 function.get_locus ());
-
       std::vector<std::unique_ptr<AST::ExternalItem>> external_items;
-      external_items.push_back (
-	std::unique_ptr<AST::ExternalItem> (external_item));
+      external_items.push_back (std::unique_ptr<AST::ExternalItem> (
+	static_cast<AST::ExternalItem *> (&function)));
 
       AST::ExternBlock extern_block (get_string_from_abi (Rust::ABI::RUST),
 				     std::move (external_items),
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 26b24150f7a..b6c2ca3fc0c 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -6034,68 +6034,6 @@ Parser<ManagedTokenSource>::parse_named_function_params (
   return params;
 }
 
-template <typename ManagedTokenSource>
-std::unique_ptr<AST::ExternalFunctionItem>
-Parser<ManagedTokenSource>::parse_external_function_item (
-  AST::Visibility vis, AST::AttrVec outer_attrs)
-{
-  location_t locus = lexer.peek_token ()->get_locus ();
-
-  // parse extern function declaration item
-  // skip function token
-  lexer.skip_token ();
-
-  // parse identifier
-  const_TokenPtr ident_tok = expect_token (IDENTIFIER);
-  if (ident_tok == nullptr)
-    {
-      skip_after_semicolon ();
-      return nullptr;
-    }
-  Identifier ident{ident_tok};
-
-  // parse (optional) generic params
-  std::vector<std::unique_ptr<AST::GenericParam>> generic_params
-    = parse_generic_params_in_angles ();
-
-  if (!skip_token (LEFT_PAREN))
-    {
-      skip_after_semicolon ();
-      return nullptr;
-    }
-
-  // parse parameters
-  std::vector<AST::NamedFunctionParam> function_params
-    = parse_named_function_params (
-      [] (TokenId id) { return id == RIGHT_PAREN; });
-
-  if (!skip_token (RIGHT_PAREN))
-    {
-      skip_after_semicolon ();
-      return nullptr;
-    }
-
-  // parse (optional) return type
-  std::unique_ptr<AST::Type> return_type = parse_function_return_type ();
-
-  // parse (optional) where clause
-  AST::WhereClause where_clause = parse_where_clause ();
-
-  if (!skip_token (SEMICOLON))
-    {
-      // skip somewhere?
-      return nullptr;
-    }
-
-  function_params.shrink_to_fit ();
-
-  return std::unique_ptr<AST::ExternalFunctionItem> (
-    new AST::ExternalFunctionItem (
-      std::move (ident), std::move (generic_params), std::move (return_type),
-      std::move (where_clause), std::move (function_params), std::move (vis),
-      std::move (outer_attrs), locus));
-}
-
 // Parses a single extern block item (static or function declaration).
 template <typename ManagedTokenSource>
 std::unique_ptr<AST::ExternalItem>
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index cdddfa6dff9..c00bf9c7e2e 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -310,8 +310,6 @@ private:
   AST::Lifetime lifetime_from_token (const_TokenPtr tok);
   std::unique_ptr<AST::ExternalTypeItem>
   parse_external_type_item (AST::Visibility vis, AST::AttrVec outer_attrs);
-  std::unique_ptr<AST::ExternalFunctionItem>
-  parse_external_function_item (AST::Visibility vis, AST::AttrVec outer_attrs);
   AST::NamedFunctionParam parse_named_function_param ();
   template <typename EndTokenPred>
   std::vector<AST::NamedFunctionParam>
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc
index 5a9f54fc7f1..1ef162d37e0 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-base.cc
@@ -430,10 +430,6 @@ void
 ResolverBase::visit (AST::ExternalStaticItem &)
 {}
 
-void
-ResolverBase::visit (AST::ExternalFunctionItem &)
-{}
-
 void
 ResolverBase::visit (AST::ExternBlock &)
 {}
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.h b/gcc/rust/resolve/rust-ast-resolve-base.h
index 3b4d28618e4..648243b6fb6 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.h
+++ b/gcc/rust/resolve/rust-ast-resolve-base.h
@@ -135,7 +135,6 @@ public:
 
   void visit (AST::ExternalTypeItem &);
   void visit (AST::ExternalStaticItem &);
-  void visit (AST::ExternalFunctionItem &);
   void visit (AST::ExternBlock &);
 
   void visit (AST::MacroMatchFragment &);
diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index c99f2f64331..789cc4eef42 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -492,10 +492,6 @@ void
 DefaultResolver::visit (AST::ExternalStaticItem &)
 {}
 
-void
-DefaultResolver::visit (AST::ExternalFunctionItem &)
-{}
-
 void
 DefaultResolver::visit (AST::MacroMatchRepetition &)
 {}
diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h
index 20458ede7bc..97ad6d78be3 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -118,7 +118,6 @@ public:
   void visit (AST::TraitItemType &);
   void visit (AST::ExternalTypeItem &);
   void visit (AST::ExternalStaticItem &);
-  void visit (AST::ExternalFunctionItem &);
   void visit (AST::MacroMatchRepetition &);
   void visit (AST::MacroMatcher &);
   void visit (AST::MacroRulesDefinition &);
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 715e9a0b361..eac29808299 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -766,10 +766,6 @@ void
 AttributeChecker::visit (AST::ExternalStaticItem &)
 {}
 
-void
-AttributeChecker::visit (AST::ExternalFunctionItem &)
-{}
-
 void
 AttributeChecker::visit (AST::ExternBlock &block)
 {
diff --git a/gcc/rust/util/rust-attributes.h b/gcc/rust/util/rust-attributes.h
index d78ab0b3319..f557b2d46b3 100644
--- a/gcc/rust/util/rust-attributes.h
+++ b/gcc/rust/util/rust-attributes.h
@@ -199,7 +199,6 @@ private:
   void visit (AST::TraitImpl &impl) override;
   void visit (AST::ExternalTypeItem &item) override;
   void visit (AST::ExternalStaticItem &item) override;
-  void visit (AST::ExternalFunctionItem &item) override;
   void visit (AST::ExternBlock &block) override;
 
   // rust-macro.h
diff --git a/gcc/testsuite/rust/compile/extern_func_with_body.rs b/gcc/testsuite/rust/compile/extern_func_with_body.rs
new file mode 100644
index 00000000000..180c4340c31
--- /dev/null
+++ b/gcc/testsuite/rust/compile/extern_func_with_body.rs
@@ -0,0 +1,5 @@
+extern "C" {
+    fn myfun0(a:i32,...) {}
+    // { dg-error "cannot have a body" "" { target *-*-* } .-1 }
+}
+
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 043/125] gccrs: Placate clang-format re 'gcc/rust/backend/rust-tree.cc'
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (40 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 042/125] gccrs: Remove dead code associated with `AST::ExternalFunctionItem` Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 044/125] gccrs: Replace reference to unique pointer with reference Arthur Cohen
                   ` (81 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <tschwinge@baylibre.com>

Reformat the upstream GCC commit f4a2ae2338962208b8039f154f5912402e94c378
"Change MODE_BITSIZE to MODE_PRECISION for MODE_VECTOR_BOOL" change to
'gcc/rust/backend/rust-tree.cc' to clang-format's liking.

	gcc/rust/
	* backend/rust-tree.cc (c_common_type_for_mode): Placate clang-format.
---
 gcc/rust/backend/rust-tree.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index 2a5ffcbf895..cdb79095da8 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -5371,8 +5371,8 @@ c_common_type_for_mode (machine_mode mode, int unsignedp)
   else if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL
 	   && valid_vector_subparts_p (GET_MODE_NUNITS (mode)))
     {
-      unsigned int elem_bits
-	= vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode));
+      unsigned int elem_bits = vector_element_size (GET_MODE_PRECISION (mode),
+						    GET_MODE_NUNITS (mode));
       tree bool_type = build_nonstandard_boolean_type (elem_bits);
       return build_vector_type_for_mode (bool_type, mode);
     }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 044/125] gccrs: Replace reference to unique pointer with reference
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (41 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 043/125] gccrs: Placate clang-format re 'gcc/rust/backend/rust-tree.cc' Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 045/125] gccrs: Replace unique_ptr references with references Arthur Cohen
                   ` (80 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Reference to unique pointers are a known anti pattern, only the element
shall be taken by reference instead of the whole wrapper.

gcc/rust/ChangeLog:

	* ast/rust-item.h: Change getter function prototype to return a
	reference directly instead of a reference to the wrapper type.
	* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Fix
	the code to accept references instead.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Change
	function implementation to return a reference.
	* hir/rust-ast-lower-base.h: Accept a reference instead of a unique
	pointer reference.
	* resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Adapt the code
	to a reference instead of a unique pointer.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/ast/rust-item.h                      |  8 +++----
 gcc/rust/checks/errors/rust-ast-validation.cc |  2 +-
 gcc/rust/hir/rust-ast-lower-base.cc           | 24 +++++++++----------
 gcc/rust/hir/rust-ast-lower-base.h            |  2 +-
 gcc/rust/resolve/rust-ast-resolve-item.cc     | 19 +++++++--------
 5 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index 573888bea5a..d09f4550062 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -1415,15 +1415,15 @@ public:
     return return_type;
   }
 
-  std::unique_ptr<Param> &get_self_param ()
+  Param &get_self_param ()
   {
     rust_assert (has_self_param ());
-    return function_params[0];
+    return *function_params[0];
   }
-  const std::unique_ptr<Param> &get_self_param () const
+  const Param &get_self_param () const
   {
     rust_assert (has_self_param ());
-    return function_params[0];
+    return *function_params[0];
   }
 
   // ExternalItem::node_id is same as Stmt::node_id
diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc
index d1edb890ae6..d5892087889 100644
--- a/gcc/rust/checks/errors/rust-ast-validation.cc
+++ b/gcc/rust/checks/errors/rust-ast-validation.cc
@@ -100,7 +100,7 @@ ASTValidation::visit (AST::Function &function)
       && context.back () != Context::INHERENT_IMPL
       && function.has_self_param ())
     rust_error_at (
-      function.get_self_param ()->get_locus (),
+      function.get_self_param ().get_locus (),
       "%<self%> parameter is only allowed in associated functions");
 
   if (function.is_external ())
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index ff6ef25a348..652530ae7a5 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -648,31 +648,31 @@ ASTLoweringBase::lower_generic_args (AST::GenericArgs &args)
 }
 
 HIR::SelfParam
-ASTLoweringBase::lower_self (std::unique_ptr<AST::Param> &param)
+ASTLoweringBase::lower_self (AST::Param &param)
 {
-  rust_assert (param->is_self ());
+  rust_assert (param.is_self ());
 
-  auto self = static_cast<AST::SelfParam *> (param.get ());
+  auto self = static_cast<AST::SelfParam &> (param);
   auto crate_num = mappings->get_current_crate ();
-  Analysis::NodeMapping mapping (crate_num, self->get_node_id (),
+  Analysis::NodeMapping mapping (crate_num, self.get_node_id (),
 				 mappings->get_next_hir_id (crate_num),
 				 mappings->get_next_localdef_id (crate_num));
 
-  if (self->has_type ())
+  if (self.has_type ())
     {
-      HIR::Type *type = ASTLoweringType::translate (self->get_type ().get ());
+      HIR::Type *type = ASTLoweringType::translate (self.get_type ().get ());
       return HIR::SelfParam (mapping, std::unique_ptr<HIR::Type> (type),
-			     self->get_is_mut (), self->get_locus ());
+			     self.get_is_mut (), self.get_locus ());
     }
-  else if (!self->get_has_ref ())
+  else if (!self.get_has_ref ())
     {
       return HIR::SelfParam (mapping, std::unique_ptr<HIR::Type> (nullptr),
-			     self->get_is_mut (), self->get_locus ());
+			     self.get_is_mut (), self.get_locus ());
     }
 
-  AST::Lifetime l = self->get_lifetime ();
-  return HIR::SelfParam (mapping, lower_lifetime (l), self->get_is_mut (),
-			 self->get_locus ());
+  AST::Lifetime l = self.get_lifetime ();
+  return HIR::SelfParam (mapping, lower_lifetime (l), self.get_is_mut (),
+			 self.get_locus ());
 }
 
 HIR::Type *
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index c19e9c03b5f..c01c7c85767 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -278,7 +278,7 @@ protected:
 
   HIR::GenericArgsBinding lower_binding (AST::GenericArgsBinding &binding);
 
-  HIR::SelfParam lower_self (std::unique_ptr<AST::Param> &self);
+  HIR::SelfParam lower_self (AST::Param &self);
 
   HIR::Type *lower_type_no_bounds (AST::TypeNoBounds *type);
 
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc
index a3f27b3e4a0..c65f112ea3b 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-item.cc
@@ -489,32 +489,31 @@ ResolveItem::visit (AST::Function &function)
   if (function.has_self_param ())
     {
       // self turns into (self: Self) as a function param
-      std::unique_ptr<AST::Param> &s_param = function.get_self_param ();
-      auto self_param = static_cast<AST::SelfParam *> (s_param.get ());
+      AST::Param &s_param = function.get_self_param ();
+      auto &self_param = static_cast<AST::SelfParam &> (s_param);
 
       // FIXME: which location should be used for Rust::Identifier `self`?
       AST::IdentifierPattern self_pattern (
-	self_param->get_node_id (), {"self"}, self_param->get_locus (),
-	self_param->get_has_ref (), self_param->get_is_mut (),
+	self_param.get_node_id (), {"self"}, self_param.get_locus (),
+	self_param.get_has_ref (), self_param.get_is_mut (),
 	std::unique_ptr<AST::Pattern> (nullptr));
       PatternDeclaration::go (&self_pattern, Rib::ItemType::Param);
 
-      if (self_param->has_type ())
+      if (self_param.has_type ())
 	{
 	  // This shouldn't happen the parser should already error for this
-	  rust_assert (!self_param->get_has_ref ());
-	  ResolveType::go (self_param->get_type ().get ());
+	  rust_assert (!self_param.get_has_ref ());
+	  ResolveType::go (self_param.get_type ().get ());
 	}
       else
 	{
 	  // here we implicitly make self have a type path of Self
 	  std::vector<std::unique_ptr<AST::TypePathSegment>> segments;
 	  segments.push_back (std::unique_ptr<AST::TypePathSegment> (
-	    new AST::TypePathSegment ("Self", false,
-				      self_param->get_locus ())));
+	    new AST::TypePathSegment ("Self", false, self_param.get_locus ())));
 
 	  AST::TypePath self_type_path (std::move (segments),
-					self_param->get_locus ());
+					self_param.get_locus ());
 	  ResolveType::go (&self_type_path);
 	}
     }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 045/125] gccrs: Replace unique_ptr references with references
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (42 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 044/125] gccrs: Replace reference to unique pointer with reference Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 046/125] gccrs: macro: Use MacroInvocation's node_id in ExternalItem constructor Arthur Cohen
                   ` (79 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

This kind of double indirection is pointless and prone to error. This
commit change the api of all getters from the AST to use references
directly instead of references to unique pointers.

gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit): Remove reference
	to unique pointer and replace it with a direct reference to the wrapped
	data.
	* ast/rust-ast.cc (VariadicParam::as_string): Likewise.
	(BlockExpr::normalize_tail_expr): Likewise.
	* ast/rust-expr.h: Likewise and add pointer getter in order to allow
	pointer reseat.
	* ast/rust-item.h: Likewise and add pointer getter for reseat.
	* ast/rust-path.h: Likewise.
	* ast/rust-pattern.h: Likewise.
	* ast/rust-stmt.h: Likewise.
	* ast/rust-type.h: Likewise.
	* expand/rust-cfg-strip.cc (CfgStrip::maybe_strip_struct_fields):
	Remove references to unique pointers and replace it with direct
	references to the wrapped object.
	(CfgStrip::maybe_strip_tuple_fields): Likewise.
	(CfgStrip::maybe_strip_generic_args): Likewise.
	(CfgStrip::maybe_strip_qualified_path_type): Likewise.
	(CfgStrip::visit): Likewise.
	* expand/rust-expand-visitor.cc (ExpandVisitor::maybe_expand_expr):
	Likewise.
	(ExpandVisitor::maybe_expand_type): Likewise.
	(ExpandVisitor::visit): Likewise.
	* expand/rust-expand-visitor.h: Likewise.
	* hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_binding):
	Likewise.
	(ASTLoweringBase::lower_generic_args): Likewise.
	(ASTLoweringBase::lower_self): Likewise.
	(ASTLoweringBase::lower_type_no_bounds): Likewise.
	(ASTLoweringBase::lower_bound): Likewise.
	(ASTLoweringBase::lower_range_pattern_bound): Likewise.
	* hir/rust-ast-lower-base.h: Likewise.
	* hir/rust-ast-lower-block.h: Likewise.
	* hir/rust-ast-lower-enumitem.h: Likewise.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::translate): Likewise.
	(ASTLoweringExpr::visit): Likewise.
	* hir/rust-ast-lower-expr.h: Likewise.
	* hir/rust-ast-lower-extern.h: Likewise.
	* hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::translate):
	Likewise.
	(ASTLowerImplItem::visit): Likewise.
	(ASTLowerTraitItem::translate): Likewise.
	(ASTLowerTraitItem::visit): Likewise.
	* hir/rust-ast-lower-implitem.h: Likewise.
	* hir/rust-ast-lower-item.cc (ASTLoweringItem::translate): Likewise.
	(ASTLoweringItem::visit): Likewise.
	* hir/rust-ast-lower-item.h: Likewise.
	* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate):
	Likewise.
	(ASTLoweringPattern::visit): Likewise.
	* hir/rust-ast-lower-pattern.h: Likewise.
	* hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Likewise.
	* hir/rust-ast-lower-struct-field-expr.h: Likewise.
	* hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Likewise.
	(ASTLowerQualifiedPathInType::visit): Likewise.
	(ASTLoweringType::translate): Likewise.
	(ASTLoweringType::visit): Likewise.
	(ASTLowerGenericParam::translate): Likewise.
	(ASTLowerGenericParam::visit): Likewise.
	(ASTLoweringTypeBounds::translate): Likewise.
	(ASTLoweringTypeBounds::visit): Likewise.
	(ASTLowerWhereClauseItem::visit): Likewise.
	* hir/rust-ast-lower-type.h: Likewise.
	* hir/rust-ast-lower.cc (ASTLowering::go): Likewise.
	(ASTLoweringBlock::visit): Likewise.
	(ASTLoweringIfBlock::visit): Likewise.
	(ASTLoweringIfLetBlock::visit): Likewise.
	(ASTLowerStructExprField::visit): Likewise.
	(ASTLoweringExprWithBlock::visit): Likewise.
	(ASTLoweringBase::lower_qual_path_type): Likewise.
	(ASTLoweringBase::lower_closure_param): Likewise.
	* resolve/rust-ast-resolve-base.cc (ResolverBase::resolve_visibility):
	Likewise.
	* resolve/rust-ast-resolve-expr.cc (ResolveExpr::go): Likewise.
	(ResolveExpr::visit): Likewise.
	(ResolveExpr::resolve_closure_param): Likewise.
	* resolve/rust-ast-resolve-expr.h: Likewise.
	* resolve/rust-ast-resolve-implitem.h: Likewise.
	* resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
	Likewise.
	(ResolveItem::go): Likewise.
	(ResolveItem::visit): Likewise.
	(ResolveItem::resolve_impl_item): Likewise.
	(ResolveItem::resolve_extern_item): Likewise.
	(ResolveImplItems::go): Likewise.
	(ResolveExternItem::go): Likewise.
	(ResolveExternItem::visit): Likewise.
	* resolve/rust-ast-resolve-item.h: Likewise.
	* resolve/rust-ast-resolve-path.cc (ResolvePath::go): Likewise.
	(ResolvePath::resolve_path): Likewise.
	* resolve/rust-ast-resolve-path.h: Likewise.
	* resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::go):
	Likewise.
	(PatternDeclaration::visit): Likewise.
	(resolve_range_pattern_bound): Likewise.
	* resolve/rust-ast-resolve-pattern.h: Likewise.
	* resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): Likewise.
	* resolve/rust-ast-resolve-stmt.h: Likewise.
	* resolve/rust-ast-resolve-struct-expr-field.cc (ResolveStructExprField::go):
	Likewise.
	(ResolveStructExprField::visit): Likewise.
	* resolve/rust-ast-resolve-struct-expr-field.h: Likewise.
	* resolve/rust-ast-resolve-toplevel.h: Likewise.
	* resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise.
	(ResolveRelativeTypePath::go): Likewise.
	(ResolveRelativeQualTypePath::resolve_qual_seg): Likewise.
	(ResolveTypeToCanonicalPath::go): Likewise.
	(ResolveTypeToCanonicalPath::visit): Likewise.
	(ResolveGenericArgs::resolve_disambiguated_generic): Likewise.
	(ResolveGenericArgs::go): Likewise.
	* resolve/rust-ast-resolve-type.h: Likewise.
	* resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise.
	* resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_qualified_path_type):
	Likewise.
	(EarlyNameResolver::visit): Likewise.
	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
	Likewise.
	* checks/errors/rust-ast-validation.cc: Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/ast/rust-ast-collector.cc            |   3 +-
 gcc/rust/ast/rust-ast.cc                      |   4 +-
 gcc/rust/ast/rust-expr.h                      | 302 ++++++++----
 gcc/rust/ast/rust-item.h                      | 160 +++++-
 gcc/rust/ast/rust-path.h                      |  50 +-
 gcc/rust/ast/rust-pattern.h                   |  36 +-
 gcc/rust/ast/rust-stmt.h                      |  35 +-
 gcc/rust/ast/rust-type.h                      |  34 +-
 gcc/rust/checks/errors/rust-ast-validation.cc |   4 +-
 gcc/rust/expand/rust-cfg-strip.cc             | 456 +++++++++---------
 gcc/rust/expand/rust-expand-visitor.cc        |  92 ++--
 gcc/rust/expand/rust-expand-visitor.h         |  10 +-
 gcc/rust/hir/rust-ast-lower-base.cc           |  39 +-
 gcc/rust/hir/rust-ast-lower-base.h            |   6 +-
 gcc/rust/hir/rust-ast-lower-block.h           |  42 +-
 gcc/rust/hir/rust-ast-lower-enumitem.h        |   8 +-
 gcc/rust/hir/rust-ast-lower-expr.cc           | 130 +++--
 gcc/rust/hir/rust-ast-lower-expr.h            |  10 +-
 gcc/rust/hir/rust-ast-lower-extern.h          |  22 +-
 gcc/rust/hir/rust-ast-lower-implitem.cc       |  47 +-
 gcc/rust/hir/rust-ast-lower-implitem.h        |   4 +-
 gcc/rust/hir/rust-ast-lower-item.cc           |  68 ++-
 gcc/rust/hir/rust-ast-lower-item.h            |   2 +-
 gcc/rust/hir/rust-ast-lower-pattern.cc        |  54 +--
 gcc/rust/hir/rust-ast-lower-pattern.h         |   2 +-
 gcc/rust/hir/rust-ast-lower-stmt.cc           |  30 +-
 .../hir/rust-ast-lower-struct-field-expr.h    |   6 +-
 gcc/rust/hir/rust-ast-lower-type.cc           |  67 ++-
 gcc/rust/hir/rust-ast-lower-type.h            |   6 +-
 gcc/rust/hir/rust-ast-lower.cc                |  70 ++-
 gcc/rust/resolve/rust-ast-resolve-base.cc     |   2 +-
 gcc/rust/resolve/rust-ast-resolve-expr.cc     | 160 +++---
 gcc/rust/resolve/rust-ast-resolve-expr.h      |   2 +-
 gcc/rust/resolve/rust-ast-resolve-implitem.h  |  10 +-
 gcc/rust/resolve/rust-ast-resolve-item.cc     | 203 ++++----
 gcc/rust/resolve/rust-ast-resolve-item.h      |  10 +-
 gcc/rust/resolve/rust-ast-resolve-path.cc     |  38 +-
 gcc/rust/resolve/rust-ast-resolve-path.h      |  12 +-
 gcc/rust/resolve/rust-ast-resolve-pattern.cc  |  65 ++-
 gcc/rust/resolve/rust-ast-resolve-pattern.h   |   4 +-
 gcc/rust/resolve/rust-ast-resolve-stmt.cc     |  17 +-
 gcc/rust/resolve/rust-ast-resolve-stmt.h      |  71 ++-
 .../rust-ast-resolve-struct-expr-field.cc     |  10 +-
 .../rust-ast-resolve-struct-expr-field.h      |   2 +-
 gcc/rust/resolve/rust-ast-resolve-toplevel.h  |  26 +-
 gcc/rust/resolve/rust-ast-resolve-type.cc     |  47 +-
 gcc/rust/resolve/rust-ast-resolve-type.h      |  36 +-
 gcc/rust/resolve/rust-ast-resolve.cc          |   9 +-
 gcc/rust/resolve/rust-default-resolver.cc     |  68 +--
 gcc/rust/resolve/rust-early-name-resolver.cc  |  28 +-
 .../rust-toplevel-name-resolver-2.0.cc        |   6 +-
 51 files changed, 1418 insertions(+), 1207 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index eb03dccaf84..a2cb506805b 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -2546,8 +2546,7 @@ TokenCollector::visit (LetStmt &stmt)
 {
   push (Rust::Token::make (LET, stmt.get_locus ()));
   auto &pattern = stmt.get_pattern ();
-  if (pattern)
-    visit (pattern);
+  visit (pattern);
 
   if (stmt.has_type ())
     {
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index 6eb3394c146..326379cf40c 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -2291,7 +2291,7 @@ std::string
 VariadicParam::as_string () const
 {
   if (has_pattern ())
-    return get_pattern ()->as_string () + " : ...";
+    return get_pattern ().as_string () + " : ...";
   else
     return "...";
 }
@@ -4258,7 +4258,7 @@ BlockExpr::normalize_tail_expr ()
 
 	  if (!stmt.is_semicolon_followed ())
 	    {
-	      expr = std::move (stmt.get_expr ());
+	      expr = std::move (stmt.take_expr ());
 	      statements.pop_back ();
 	    }
 	}
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 4830ae0d2d3..d3dc197ea55 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -387,10 +387,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_borrowed_expr ()
+  Expr &get_borrowed_expr ()
   {
     rust_assert (main_or_left_expr != nullptr);
-    return main_or_left_expr;
+    return *main_or_left_expr;
   }
 
   bool get_is_mut () const { return is_mut; }
@@ -421,10 +421,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_dereferenced_expr ()
+  Expr &get_dereferenced_expr ()
   {
     rust_assert (main_or_left_expr != nullptr);
-    return main_or_left_expr;
+    return *main_or_left_expr;
   }
 
 protected:
@@ -452,10 +452,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_propagating_expr ()
+  Expr &get_propagating_expr ()
   {
     rust_assert (main_or_left_expr != nullptr);
-    return main_or_left_expr;
+    return *main_or_left_expr;
   }
 
 protected:
@@ -495,10 +495,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_negated_expr ()
+  Expr &get_negated_expr ()
   {
     rust_assert (main_or_left_expr != nullptr);
-    return main_or_left_expr;
+    return *main_or_left_expr;
   }
 
 protected:
@@ -561,14 +561,26 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_left_expr ()
+  Expr &get_left_expr ()
+  {
+    rust_assert (main_or_left_expr != nullptr);
+    return *main_or_left_expr;
+  }
+
+  std::unique_ptr<Expr> &get_left_expr_ptr ()
   {
     rust_assert (main_or_left_expr != nullptr);
     return main_or_left_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_right_expr ()
+  Expr &get_right_expr ()
+  {
+    rust_assert (right_expr != nullptr);
+    return *right_expr;
+  }
+
+  std::unique_ptr<Expr> &get_right_expr_ptr ()
   {
     rust_assert (right_expr != nullptr);
     return right_expr;
@@ -637,14 +649,26 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_left_expr ()
+  Expr &get_left_expr ()
+  {
+    rust_assert (main_or_left_expr != nullptr);
+    return *main_or_left_expr;
+  }
+
+  std::unique_ptr<Expr> &get_left_expr_ptr ()
   {
     rust_assert (main_or_left_expr != nullptr);
     return main_or_left_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_right_expr ()
+  Expr &get_right_expr ()
+  {
+    rust_assert (right_expr != nullptr);
+    return *right_expr;
+  }
+
+  std::unique_ptr<Expr> &get_right_expr_ptr ()
   {
     rust_assert (right_expr != nullptr);
     return right_expr;
@@ -713,14 +737,26 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_left_expr ()
+  Expr &get_left_expr ()
+  {
+    rust_assert (main_or_left_expr != nullptr);
+    return *main_or_left_expr;
+  }
+
+  std::unique_ptr<Expr> &get_left_expr_ptr ()
   {
     rust_assert (main_or_left_expr != nullptr);
     return main_or_left_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_right_expr ()
+  Expr &get_right_expr ()
+  {
+    rust_assert (right_expr != nullptr);
+    return *right_expr;
+  }
+
+  std::unique_ptr<Expr> &get_right_expr_ptr ()
   {
     rust_assert (right_expr != nullptr);
     return right_expr;
@@ -777,17 +813,17 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_casted_expr ()
+  Expr &get_casted_expr ()
   {
     rust_assert (main_or_left_expr != nullptr);
-    return main_or_left_expr;
+    return *main_or_left_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<TypeNoBounds> &get_type_to_cast_to ()
+  TypeNoBounds &get_type_to_cast_to ()
   {
     rust_assert (type_to_convert_to != nullptr);
-    return type_to_convert_to;
+    return *type_to_convert_to;
   }
 
 protected:
@@ -843,19 +879,31 @@ public:
   void visit_rhs (ASTVisitor &vis) { right_expr->accept_vis (vis); }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_left_expr ()
+  Expr &get_left_expr ()
+  {
+    rust_assert (main_or_left_expr != nullptr);
+    return *main_or_left_expr;
+  }
+
+  std::unique_ptr<Expr> &get_left_expr_ptr ()
   {
     rust_assert (main_or_left_expr != nullptr);
     return main_or_left_expr;
   }
 
-  // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_right_expr ()
+  std::unique_ptr<Expr> &get_right_expr_ptr ()
   {
     rust_assert (right_expr != nullptr);
     return right_expr;
   }
 
+  // TODO: is this better? Or is a "vis_block" better?
+  Expr &get_right_expr ()
+  {
+    rust_assert (right_expr != nullptr);
+    return *right_expr;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -917,14 +965,26 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_left_expr ()
+  Expr &get_left_expr ()
+  {
+    rust_assert (main_or_left_expr != nullptr);
+    return *main_or_left_expr;
+  }
+
+  std::unique_ptr<Expr> &get_left_expr_ptr ()
   {
     rust_assert (main_or_left_expr != nullptr);
     return main_or_left_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_right_expr ()
+  Expr &get_right_expr ()
+  {
+    rust_assert (right_expr != nullptr);
+    return *right_expr;
+  }
+
+  std::unique_ptr<Expr> &get_right_expr_ptr ()
   {
     rust_assert (right_expr != nullptr);
     return right_expr;
@@ -1012,7 +1072,13 @@ public:
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr_in_parens ()
+  Expr &get_expr_in_parens ()
+  {
+    rust_assert (expr_in_parens != nullptr);
+    return *expr_in_parens;
+  }
+
+  std::unique_ptr<Expr> &get_expr_in_parens_ptr ()
   {
     rust_assert (expr_in_parens != nullptr);
     return expr_in_parens;
@@ -1147,17 +1213,17 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_elem_to_copy ()
+  Expr &get_elem_to_copy ()
   {
     rust_assert (elem_to_copy != nullptr);
-    return elem_to_copy;
+    return *elem_to_copy;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_num_copies ()
+  Expr &get_num_copies ()
   {
     rust_assert (num_copies != nullptr);
-    return num_copies;
+    return *num_copies;
   }
 
 protected:
@@ -1331,17 +1397,17 @@ public:
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_array_expr ()
+  Expr &get_array_expr ()
   {
     rust_assert (array_expr != nullptr);
-    return array_expr;
+    return *array_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_index_expr ()
+  Expr &get_index_expr ()
   {
     rust_assert (index_expr != nullptr);
-    return index_expr;
+    return *index_expr;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -1521,10 +1587,10 @@ public:
   bool is_marked_for_strip () const override { return tuple_expr == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_tuple_expr ()
+  Expr &get_tuple_expr ()
   {
     rust_assert (tuple_expr != nullptr);
-    return tuple_expr;
+    return *tuple_expr;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -1664,10 +1730,10 @@ public:
   std::string as_string () const;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_base_struct ()
+  Expr &get_base_struct ()
   {
     rust_assert (base_struct != nullptr);
-    return base_struct;
+    return *base_struct;
   }
 };
 
@@ -1763,10 +1829,10 @@ public:
   std::string as_string () const override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_value ()
+  Expr &get_value ()
   {
     rust_assert (value != nullptr);
-    return value;
+    return *value;
   }
 };
 
@@ -2021,10 +2087,10 @@ public:
   std::vector<std::unique_ptr<Expr> > &get_params () { return params; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_function_expr ()
+  Expr &get_function_expr ()
   {
     rust_assert (function != nullptr);
-    return function;
+    return *function;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -2121,10 +2187,10 @@ public:
   std::vector<std::unique_ptr<Expr> > &get_params () { return params; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_receiver_expr ()
+  Expr &get_receiver_expr ()
   {
     rust_assert (receiver != nullptr);
-    return receiver;
+    return *receiver;
   }
 
   const PathExprSegment &get_method_name () const { return method_name; }
@@ -2207,10 +2273,10 @@ public:
   bool is_marked_for_strip () const override { return receiver == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_receiver_expr ()
+  Expr &get_receiver_expr ()
   {
     rust_assert (receiver != nullptr);
-    return receiver;
+    return *receiver;
   }
 
   Identifier get_field_name () const { return field; }
@@ -2304,13 +2370,19 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
   std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
 
-  std::unique_ptr<Pattern> &get_pattern ()
+  Pattern &get_pattern ()
   {
     rust_assert (pattern != nullptr);
-    return pattern;
+    return *pattern;
   }
 
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (has_type_given ());
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (has_type_given ());
     return type;
@@ -2411,10 +2483,10 @@ public:
     return closure_inner == nullptr;
   }
 
-  std::unique_ptr<Expr> &get_definition_expr ()
+  Expr &get_definition_expr ()
   {
     rust_assert (closure_inner != nullptr);
-    return closure_inner;
+    return *closure_inner;
   }
 
 protected:
@@ -2532,7 +2604,13 @@ public:
   std::vector<std::unique_ptr<Stmt> > &get_statements () { return statements; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_tail_expr ()
+  Expr &get_tail_expr ()
+  {
+    rust_assert (has_tail_expr ());
+    return *expr;
+  }
+
+  std::unique_ptr<Expr> &get_tail_expr_ptr ()
   {
     rust_assert (has_tail_expr ());
     return expr;
@@ -2651,14 +2729,20 @@ public:
   bool is_marked_for_strip () const override { return expr == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<BlockExpr> &get_definition_block ()
+  BlockExpr &get_definition_block ()
   {
     rust_assert (expr != nullptr);
-    return expr;
+    return *expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_return_type ()
+  Type &get_return_type ()
+  {
+    rust_assert (return_type != nullptr);
+    return *return_type;
+  }
+
+  std::unique_ptr<Type> &get_return_type_ptr ()
   {
     rust_assert (return_type != nullptr);
     return return_type;
@@ -2794,10 +2878,10 @@ public:
   bool is_marked_for_strip () const override { return marked_for_strip; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_break_expr ()
+  Expr &get_break_expr ()
   {
     rust_assert (has_break_expr ());
-    return break_expr;
+    return *break_expr;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -2906,17 +2990,17 @@ public:
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_from_expr ()
+  Expr &get_from_expr ()
   {
     rust_assert (from != nullptr);
-    return from;
+    return *from;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_to_expr ()
+  Expr &get_to_expr ()
   {
     rust_assert (to != nullptr);
-    return to;
+    return *to;
   }
 
 protected:
@@ -2974,10 +3058,10 @@ public:
   bool is_marked_for_strip () const override { return from == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_from_expr ()
+  Expr &get_from_expr ()
   {
     rust_assert (from != nullptr);
-    return from;
+    return *from;
   }
 
 protected:
@@ -3036,10 +3120,10 @@ public:
   bool is_marked_for_strip () const override { return to == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_to_expr ()
+  Expr &get_to_expr ()
   {
     rust_assert (to != nullptr);
-    return to;
+    return *to;
   }
 
 protected:
@@ -3142,17 +3226,17 @@ public:
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_from_expr ()
+  Expr &get_from_expr ()
   {
     rust_assert (from != nullptr);
-    return from;
+    return *from;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_to_expr ()
+  Expr &get_to_expr ()
   {
     rust_assert (to != nullptr);
-    return to;
+    return *to;
   }
 
 protected:
@@ -3211,10 +3295,10 @@ public:
   bool is_marked_for_strip () const override { return to == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_to_expr ()
+  Expr &get_to_expr ()
   {
     rust_assert (to != nullptr);
-    return to;
+    return *to;
   }
 
 protected:
@@ -3290,10 +3374,10 @@ public:
   bool is_marked_for_strip () const override { return marked_for_strip; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_returned_expr ()
+  Expr &get_returned_expr ()
   {
     rust_assert (return_expr != nullptr);
-    return return_expr;
+    return *return_expr;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -3372,10 +3456,10 @@ public:
   bool is_marked_for_strip () const override { return expr == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<BlockExpr> &get_block_expr ()
+  BlockExpr &get_block_expr ()
   {
     rust_assert (expr != nullptr);
-    return expr;
+    return *expr;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -3461,10 +3545,10 @@ public:
   bool is_marked_for_strip () const override { return loop_block == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<BlockExpr> &get_loop_block ()
+  BlockExpr &get_loop_block ()
   {
     rust_assert (loop_block != nullptr);
-    return loop_block;
+    return *loop_block;
   }
 
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
@@ -3544,10 +3628,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_predicate_expr ()
+  Expr &get_predicate_expr ()
   {
     rust_assert (condition != nullptr);
-    return condition;
+    return *condition;
   }
 
 protected:
@@ -3617,10 +3701,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_scrutinee_expr ()
+  Expr &get_scrutinee_expr ()
   {
     rust_assert (scrutinee != nullptr);
-    return scrutinee;
+    return *scrutinee;
   }
 
   // TODO: this mutable getter seems really dodgy. Think up better way.
@@ -3689,17 +3773,17 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_iterator_expr ()
+  Expr &get_iterator_expr ()
   {
     rust_assert (iterator_expr != nullptr);
-    return iterator_expr;
+    return *iterator_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Pattern> &get_pattern ()
+  Pattern &get_pattern ()
   {
     rust_assert (pattern != nullptr);
-    return pattern;
+    return *pattern;
   }
 
 protected:
@@ -3786,17 +3870,23 @@ public:
   void vis_if_block (ASTVisitor &vis) { if_block->accept_vis (vis); }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_condition_expr ()
+  Expr &get_condition_expr ()
+  {
+    rust_assert (condition != nullptr);
+    return *condition;
+  }
+
+  std::unique_ptr<Expr> &get_condition_expr_ptr ()
   {
     rust_assert (condition != nullptr);
     return condition;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<BlockExpr> &get_if_block ()
+  BlockExpr &get_if_block ()
   {
     rust_assert (if_block != nullptr);
-    return if_block;
+    return *if_block;
   }
 
   // Invalid if if block or condition is null, so base stripping on that.
@@ -3874,10 +3964,10 @@ public:
   void vis_else_block (ASTVisitor &vis) { else_block->accept_vis (vis); }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<ExprWithBlock> &get_else_block ()
+  ExprWithBlock &get_else_block ()
   {
     rust_assert (else_block != nullptr);
-    return else_block;
+    return *else_block;
   }
 
 protected:
@@ -3975,17 +4065,23 @@ public:
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_value_expr ()
+  Expr &get_value_expr ()
+  {
+    rust_assert (value != nullptr);
+    return *value;
+  }
+
+  std::unique_ptr<Expr> &get_value_expr_ptr ()
   {
     rust_assert (value != nullptr);
     return value;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<BlockExpr> &get_if_block ()
+  BlockExpr &get_if_block ()
   {
     rust_assert (if_block != nullptr);
-    return if_block;
+    return *if_block;
   }
 
   // TODO: this mutable getter seems really dodgy. Think up better way.
@@ -4067,10 +4163,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<ExprWithBlock> &get_else_block ()
+  ExprWithBlock &get_else_block ()
   {
     rust_assert (else_block != nullptr);
-    return else_block;
+    return *else_block;
   }
 
 protected:
@@ -4159,7 +4255,13 @@ public:
   std::string as_string () const;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_guard_expr ()
+  Expr &get_guard_expr ()
+  {
+    rust_assert (has_match_arm_guard ());
+    return *guard_expr;
+  }
+
+  std::unique_ptr<Expr> &get_guard_expr_ptr ()
   {
     rust_assert (has_match_arm_guard ());
     return guard_expr;
@@ -4220,7 +4322,13 @@ public:
   std::string as_string () const;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr ()
+  Expr &get_expr ()
+  {
+    rust_assert (expr != nullptr);
+    return *expr;
+  }
+
+  std::unique_ptr<Expr> &get_expr_ptr ()
   {
     rust_assert (expr != nullptr);
     return expr;
@@ -4315,10 +4423,10 @@ public:
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_scrutinee_expr ()
+  Expr &get_scrutinee_expr ()
   {
     rust_assert (branch_value != nullptr);
-    return branch_value;
+    return *branch_value;
   }
 
   const std::vector<MatchCase> &get_match_cases () const { return match_arms; }
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index d09f4550062..c03de9b1a92 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -141,7 +141,13 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type != nullptr);
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type != nullptr);
     return type;
@@ -288,7 +294,13 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (bound_type != nullptr);
+    return *bound_type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (bound_type != nullptr);
     return bound_type;
@@ -516,7 +528,13 @@ public:
   NodeId get_node_id () const { return node_id; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (has_type ());
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (has_type ());
     return type;
@@ -611,16 +629,16 @@ public:
     return new VariadicParam (*this);
   }
 
-  std::unique_ptr<Pattern> &get_pattern ()
+  Pattern &get_pattern ()
   {
     rust_assert (param_name != nullptr);
-    return param_name;
+    return *param_name;
   }
 
-  const std::unique_ptr<Pattern> &get_pattern () const
+  const Pattern &get_pattern () const
   {
     rust_assert (param_name != nullptr);
-    return param_name;
+    return *param_name;
   }
 
   bool has_pattern () const { return param_name != nullptr; }
@@ -694,16 +712,22 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Pattern> &get_pattern ()
+  Pattern &get_pattern ()
   {
     rust_assert (param_name != nullptr);
-    return param_name;
+    return *param_name;
   }
 
   bool has_name () const { return param_name != nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type != nullptr);
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type != nullptr);
     return type;
@@ -1409,7 +1433,13 @@ public:
   WhereClause &get_where_clause () { return where_clause; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_return_type ()
+  Type &get_return_type ()
+  {
+    rust_assert (has_return_type ());
+    return *return_type;
+  }
+
+  std::unique_ptr<Type> &get_return_type_ptr ()
   {
     rust_assert (has_return_type ());
     return return_type;
@@ -1552,10 +1582,10 @@ public:
   WhereClause &get_where_clause () { return where_clause; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type_aliased ()
+  Type &get_type_aliased ()
   {
     rust_assert (existing_type != nullptr);
-    return existing_type;
+    return *existing_type;
   }
 
   Identifier get_new_type_name () const { return new_type_name; }
@@ -1750,7 +1780,13 @@ public:
   location_t get_locus () const { return locus; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_field_type ()
+  Type &get_field_type ()
+  {
+    rust_assert (field_type != nullptr);
+    return *field_type;
+  }
+
+  std::unique_ptr<Type> &get_field_type_ptr ()
   {
     rust_assert (field_type != nullptr);
     return field_type;
@@ -1901,7 +1937,13 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_field_type ()
+  Type &get_field_type ()
+  {
+    rust_assert (field_type != nullptr);
+    return *field_type;
+  }
+
+  std::unique_ptr<Type> &get_field_type_ptr ()
   {
     rust_assert (field_type != nullptr);
     return field_type;
@@ -2098,7 +2140,13 @@ public:
   bool has_expr () { return expression != nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr ()
+  Expr &get_expr ()
+  {
+    rust_assert (expression != nullptr);
+    return *expression;
+  }
+
+  std::unique_ptr<Expr> &get_expr_ptr ()
   {
     rust_assert (expression != nullptr);
     return expression;
@@ -2414,14 +2462,26 @@ public:
   bool has_expr () { return const_expr != nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr ()
+  Expr &get_expr ()
+  {
+    rust_assert (const_expr != nullptr);
+    return *const_expr;
+  }
+
+  std::unique_ptr<Expr> &get_expr_ptr ()
   {
     rust_assert (const_expr != nullptr);
     return const_expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type != nullptr);
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type != nullptr);
     return type;
@@ -2521,14 +2581,26 @@ public:
   bool has_expr () { return expr != nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr ()
+  Expr &get_expr ()
+  {
+    rust_assert (expr != nullptr);
+    return *expr;
+  }
+
+  std::unique_ptr<Expr> &get_expr_ptr ()
   {
     rust_assert (expr != nullptr);
     return expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type != nullptr);
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type != nullptr);
     return type;
@@ -2629,14 +2701,26 @@ public:
   bool has_expr () const { return expr != nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr ()
+  Expr &get_expr ()
+  {
+    rust_assert (has_expr ());
+    return *expr;
+  }
+
+  std::unique_ptr<Expr> &get_expr_ptr ()
   {
     rust_assert (has_expr ());
     return expr;
   }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type != nullptr);
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type != nullptr);
     return type;
@@ -2958,7 +3042,13 @@ public:
   WhereClause &get_where_clause () { return where_clause; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (trait_type != nullptr);
+    return *trait_type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (trait_type != nullptr);
     return trait_type;
@@ -3409,7 +3499,13 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (item_type != nullptr);
+    return *item_type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (item_type != nullptr);
     return item_type;
@@ -3542,7 +3638,13 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (param_type != nullptr);
+    return *param_type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (param_type != nullptr);
     return param_type;
@@ -3700,7 +3802,13 @@ public:
   WhereClause &get_where_clause () { return where_clause; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Type> &get_return_type ()
+  Type &get_return_type ()
+  {
+    rust_assert (has_return_type ());
+    return *return_type;
+  }
+
+  std::unique_ptr<Type> &get_return_type_ptr ()
   {
     rust_assert (has_return_type ());
     return return_type;
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index bd3012b1bed..83412ebea8c 100644
--- a/gcc/rust/ast/rust-path.h
+++ b/gcc/rust/ast/rust-path.h
@@ -120,7 +120,13 @@ public:
   std::string as_string () const;
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type != nullptr);
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type != nullptr);
     return type;
@@ -216,10 +222,10 @@ public:
     switch (get_kind ())
       {
       case Kind::Const:
-	get_expression ()->accept_vis (visitor);
+	get_expression ().accept_vis (visitor);
 	break;
       case Kind::Type:
-	get_type ()->accept_vis (visitor);
+	get_type ().accept_vis (visitor);
 	break;
       case Kind::Either:
 	break;
@@ -228,14 +234,28 @@ public:
       }
   }
 
-  std::unique_ptr<Expr> &get_expression ()
+  Expr &get_expression ()
+  {
+    rust_assert (kind == Kind::Const);
+
+    return *expression;
+  }
+
+  std::unique_ptr<Expr> &get_expression_ptr ()
   {
     rust_assert (kind == Kind::Const);
 
     return expression;
   }
 
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (kind == Kind::Type);
+
+    return *type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (kind == Kind::Type);
 
@@ -352,11 +372,11 @@ public:
 
   Attribute &get_outer_attribute () { return outer_attr; }
 
-  std::unique_ptr<AST::Type> &get_type ()
+  AST::Type &get_type ()
   {
     rust_assert (has_type ());
 
-    return type;
+    return *type;
   }
 
   GenericArg &get_default_value ()
@@ -957,7 +977,13 @@ public:
   std::vector<std::unique_ptr<Type> > &get_params () { return inputs; }
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Type> &get_return_type ()
+  Type &get_return_type ()
+  {
+    rust_assert (has_return_type ());
+    return *return_type;
+  }
+
+  std::unique_ptr<Type> &get_return_type_ptr ()
   {
     rust_assert (has_return_type ());
     return return_type;
@@ -1176,7 +1202,13 @@ public:
   location_t get_locus () const { return locus; }
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (type_to_invoke_on != nullptr);
+    return *type_to_invoke_on;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (type_to_invoke_on != nullptr);
     return type_to_invoke_on;
diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h
index 365f3b7f69d..abf6de6a043 100644
--- a/gcc/rust/ast/rust-pattern.h
+++ b/gcc/rust/ast/rust-pattern.h
@@ -138,10 +138,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Pattern> &get_pattern_to_bind ()
+  Pattern &get_pattern_to_bind ()
   {
     rust_assert (has_pattern_to_bind ());
-    return to_bind;
+    return *to_bind;
   }
 
   Identifier get_ident () const { return variable_ident; }
@@ -428,16 +428,16 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? or is a "vis_bound" better?
-  std::unique_ptr<RangePatternBound> &get_lower_bound ()
+  RangePatternBound &get_lower_bound ()
   {
     rust_assert (lower != nullptr);
-    return lower;
+    return *lower;
   }
 
-  std::unique_ptr<RangePatternBound> &get_upper_bound ()
+  RangePatternBound &get_upper_bound ()
   {
     rust_assert (upper != nullptr);
-    return upper;
+    return *upper;
   }
 
   NodeId get_node_id () const override { return node_id; }
@@ -500,10 +500,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Pattern> &get_referenced_pattern ()
+  Pattern &get_referenced_pattern ()
   {
     rust_assert (pattern != nullptr);
-    return pattern;
+    return *pattern;
   }
 
   bool is_double_reference () const { return has_two_amps; }
@@ -663,10 +663,10 @@ public:
   TupleIndex get_index () { return index; }
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Pattern> &get_index_pattern ()
+  Pattern &get_index_pattern ()
   {
     rust_assert (tuple_pattern != nullptr);
-    return tuple_pattern;
+    return *tuple_pattern;
   }
 
   ItemType get_item_type () const override final { return ItemType::TUPLE_PAT; }
@@ -743,10 +743,10 @@ public:
   const Identifier &get_identifier () const { return ident; }
 
   // TODO: is this better? Or is a "vis_pattern" better?
-  std::unique_ptr<Pattern> &get_ident_pattern ()
+  Pattern &get_ident_pattern ()
   {
     rust_assert (ident_pattern != nullptr);
-    return ident_pattern;
+    return *ident_pattern;
   }
 
   ItemType get_item_type () const override final { return ItemType::IDENT_PAT; }
@@ -1183,10 +1183,10 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  std::unique_ptr<TupleStructItems> &get_items ()
+  TupleStructItems &get_items ()
   {
     rust_assert (items != nullptr);
-    return items;
+    return *items;
   }
 
   PathInExpression &get_path () { return path; }
@@ -1428,10 +1428,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: seems kinda dodgy. Think of better way.
-  std::unique_ptr<TuplePatternItems> &get_items ()
+  TuplePatternItems &get_items ()
   {
     rust_assert (items != nullptr);
-    return items;
+    return *items;
   }
 
   NodeId get_node_id () const override { return node_id; }
@@ -1490,10 +1490,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: seems kinda dodgy. Think of better way.
-  std::unique_ptr<Pattern> &get_pattern_in_parens ()
+  Pattern &get_pattern_in_parens ()
   {
     rust_assert (pattern_in_parens != nullptr);
-    return pattern_in_parens;
+    return *pattern_in_parens;
   }
 
   NodeId get_node_id () const override { return node_id; }
diff --git a/gcc/rust/ast/rust-stmt.h b/gcc/rust/ast/rust-stmt.h
index b332425316c..51c59182ba6 100644
--- a/gcc/rust/ast/rust-stmt.h
+++ b/gcc/rust/ast/rust-stmt.h
@@ -22,6 +22,7 @@
 #include "rust-ast.h"
 #include "rust-path.h"
 #include "rust-expr.h"
+#include <memory>
 
 namespace Rust {
 namespace AST {
@@ -155,19 +156,31 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_init_expr ()
+  Expr &get_init_expr ()
+  {
+    rust_assert (has_init_expr ());
+    return *init_expr;
+  }
+
+  std::unique_ptr<Expr> &get_init_expr_ptr ()
   {
     rust_assert (has_init_expr ());
     return init_expr;
   }
 
-  std::unique_ptr<Pattern> &get_pattern ()
+  Pattern &get_pattern ()
   {
     rust_assert (variables_pattern != nullptr);
-    return variables_pattern;
+    return *variables_pattern;
+  }
+
+  Type &get_type ()
+  {
+    rust_assert (has_type ());
+    return *type;
   }
 
-  std::unique_ptr<Type> &get_type ()
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (has_type ());
     return type;
@@ -249,12 +262,24 @@ public:
   bool is_marked_for_strip () const override { return expr == nullptr; }
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<Expr> &get_expr ()
+  Expr &get_expr ()
+  {
+    rust_assert (expr != nullptr);
+    return *expr;
+  }
+
+  std::unique_ptr<Expr> &get_expr_ptr ()
   {
     rust_assert (expr != nullptr);
     return expr;
   }
 
+  std::unique_ptr<Expr> take_expr ()
+  {
+    rust_assert (expr != nullptr);
+    return std::move (expr);
+  }
+
   bool is_semicolon_followed () const { return semicolon_followed; }
 
 protected:
diff --git a/gcc/rust/ast/rust-type.h b/gcc/rust/ast/rust-type.h
index 91a9d2f5999..23572a29a45 100644
--- a/gcc/rust/ast/rust-type.h
+++ b/gcc/rust/ast/rust-type.h
@@ -513,10 +513,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: would a "vis_type" be better?
-  std::unique_ptr<TypeNoBounds> &get_type_pointed_to ()
+  TypeNoBounds &get_type_pointed_to ()
   {
     rust_assert (type != nullptr);
-    return type;
+    return *type;
   }
 
 protected:
@@ -580,17 +580,17 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: would a "vis_type" be better?
-  std::unique_ptr<TypeNoBounds> &get_type_referenced ()
+  TypeNoBounds &get_type_referenced ()
   {
     rust_assert (type != nullptr);
-    return type;
+    return *type;
   }
 
   bool get_has_mut () const { return has_mut; }
 
   Lifetime &get_lifetime () { return lifetime; }
 
-  std::unique_ptr<TypeNoBounds> &get_base_type () { return type; }
+  TypeNoBounds &get_base_type () { return *type; }
 
 protected:
   /* Use covariance to implement clone function as returning this object rather
@@ -641,17 +641,17 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: would a "vis_type" be better?
-  std::unique_ptr<Type> &get_elem_type ()
+  Type &get_elem_type ()
   {
     rust_assert (elem_type != nullptr);
-    return elem_type;
+    return *elem_type;
   }
 
   // TODO: would a "vis_expr" be better?
-  std::unique_ptr<Expr> &get_size_expr ()
+  Expr &get_size_expr ()
   {
     rust_assert (size != nullptr);
-    return size;
+    return *size;
   }
 
 protected:
@@ -701,10 +701,10 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: would a "vis_type" be better?
-  std::unique_ptr<Type> &get_elem_type ()
+  Type &get_elem_type ()
   {
     rust_assert (elem_type != nullptr);
-    return elem_type;
+    return *elem_type;
   }
 
 protected:
@@ -824,7 +824,13 @@ public:
   const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
 
   // TODO: would a "vis_type" be better?
-  std::unique_ptr<Type> &get_type ()
+  Type &get_type ()
+  {
+    rust_assert (param_type != nullptr);
+    return *param_type;
+  }
+
+  std::unique_ptr<Type> &get_type_ptr ()
   {
     rust_assert (param_type != nullptr);
     return param_type;
@@ -935,10 +941,10 @@ public:
   }
 
   // TODO: would a "vis_type" be better?
-  std::unique_ptr<TypeNoBounds> &get_return_type ()
+  TypeNoBounds &get_return_type ()
   {
     rust_assert (has_return_type ());
-    return return_type;
+    return *return_type;
   }
 
   FunctionQualifiers &get_function_qualifiers () { return function_qualifiers; }
diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc
index d5892087889..e219fba5ce8 100644
--- a/gcc/rust/checks/errors/rust-ast-validation.cc
+++ b/gcc/rust/checks/errors/rust-ast-validation.cc
@@ -125,8 +125,8 @@ ASTValidation::visit (AST::Function &function)
 	  // if functional parameter
 	  if (!it->get ()->is_self () && !it->get ()->is_variadic ())
 	    {
-	      auto param = static_cast<AST::FunctionParam *> (it->get ());
-	      auto kind = param->get_pattern ()->get_pattern_kind ();
+	      auto &param = static_cast<AST::FunctionParam &> (**it);
+	      auto kind = param.get_pattern ().get_pattern_kind ();
 
 	      if (kind != AST::Pattern::Kind::Identifier
 		  && kind != AST::Pattern::Kind::Wildcard)
diff --git a/gcc/rust/expand/rust-cfg-strip.cc b/gcc/rust/expand/rust-cfg-strip.cc
index 923015fa05e..19f377ea75a 100644
--- a/gcc/rust/expand/rust-cfg-strip.cc
+++ b/gcc/rust/expand/rust-cfg-strip.cc
@@ -184,11 +184,10 @@ CfgStrip::maybe_strip_struct_fields (std::vector<AST::StructField> &fields)
 
       // expand sub-types of type, but can't strip type itself
       auto &type = field.get_field_type ();
-      type->accept_vis (*this);
+      type.accept_vis (*this);
 
-      if (type->is_marked_for_strip ())
-	rust_error_at (type->get_locus (),
-		       "cannot strip type in this position");
+      if (type.is_marked_for_strip ())
+	rust_error_at (type.get_locus (), "cannot strip type in this position");
 
       // if nothing else happens, increment
       ++it;
@@ -212,10 +211,9 @@ CfgStrip::maybe_strip_tuple_fields (std::vector<AST::TupleField> &fields)
 
       // expand sub-types of type, but can't strip type itself
       auto &type = field.get_field_type ();
-      type->accept_vis (*this);
-      if (type->is_marked_for_strip ())
-	rust_error_at (type->get_locus (),
-		       "cannot strip type in this position");
+      type.accept_vis (*this);
+      if (type.is_marked_for_strip ())
+	rust_error_at (type.get_locus (), "cannot strip type in this position");
 
       // if nothing else happens, increment
       ++it;
@@ -242,16 +240,16 @@ CfgStrip::maybe_strip_function_params (
 
 	  // TODO: should an unwanted strip lead to break out of loop?
 	  auto &pattern = param->get_pattern ();
-	  pattern->accept_vis (*this);
-	  if (pattern->is_marked_for_strip ())
-	    rust_error_at (pattern->get_locus (),
+	  pattern.accept_vis (*this);
+	  if (pattern.is_marked_for_strip ())
+	    rust_error_at (pattern.get_locus (),
 			   "cannot strip pattern in this position");
 
 	  auto &type = param->get_type ();
-	  type->accept_vis (*this);
+	  type.accept_vis (*this);
 
-	  if (type->is_marked_for_strip ())
-	    rust_error_at (type->get_locus (),
+	  if (type.is_marked_for_strip ())
+	    rust_error_at (type.get_locus (),
 			   "cannot strip type in this position");
 	}
       // increment
@@ -272,19 +270,19 @@ CfgStrip::maybe_strip_generic_args (AST::GenericArgs &args)
 	{
 	  case AST::GenericArg::Kind::Type: {
 	    auto &type = arg.get_type ();
-	    type->accept_vis (*this);
+	    type.accept_vis (*this);
 
-	    if (type->is_marked_for_strip ())
-	      rust_error_at (type->get_locus (),
+	    if (type.is_marked_for_strip ())
+	      rust_error_at (type.get_locus (),
 			     "cannot strip type in this position");
 	    break;
 	  }
 	  case AST::GenericArg::Kind::Const: {
 	    auto &expr = arg.get_expression ();
-	    expr->accept_vis (*this);
+	    expr.accept_vis (*this);
 
-	    if (expr->is_marked_for_strip ())
-	      rust_error_at (expr->get_locus (),
+	    if (expr.is_marked_for_strip ())
+	      rust_error_at (expr.get_locus (),
 			     "cannot strip expression in this position");
 	    break;
 	  }
@@ -303,11 +301,10 @@ CfgStrip::maybe_strip_generic_args (AST::GenericArgs &args)
   for (auto &binding : args.get_binding_args ())
     {
       auto &type = binding.get_type ();
-      type->accept_vis (*this);
+      type.accept_vis (*this);
 
-      if (type->is_marked_for_strip ())
-	rust_error_at (type->get_locus (),
-		       "cannot strip type in this position");
+      if (type.is_marked_for_strip ())
+	rust_error_at (type.get_locus (), "cannot strip type in this position");
     }
 }
 
@@ -315,10 +312,10 @@ void
 CfgStrip::maybe_strip_qualified_path_type (AST::QualifiedPathType &path_type)
 {
   auto &type = path_type.get_type ();
-  type->accept_vis (*this);
+  type.accept_vis (*this);
 
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   if (path_type.has_as_clause ())
     {
@@ -347,18 +344,18 @@ CfgStrip::CfgStrip::maybe_strip_closure_params (
 	}
 
       auto &pattern = param.get_pattern ();
-      pattern->accept_vis (*this);
-      if (pattern->is_marked_for_strip ())
-	rust_error_at (pattern->get_locus (),
+      pattern.accept_vis (*this);
+      if (pattern.is_marked_for_strip ())
+	rust_error_at (pattern.get_locus (),
 		       "cannot strip pattern in this position");
 
       if (param.has_type_given ())
 	{
 	  auto &type = param.get_type ();
-	  type->accept_vis (*this);
+	  type.accept_vis (*this);
 
-	  if (type->is_marked_for_strip ())
-	    rust_error_at (type->get_locus (),
+	  if (type.is_marked_for_strip ())
+	    rust_error_at (type.get_locus (),
 			   "cannot strip type in this position");
 	}
 
@@ -451,8 +448,8 @@ CfgStrip::visit (AST::TypePathSegmentFunction &segment)
     {
       auto &return_type = type_path_function.get_return_type ();
 
-      if (return_type->is_marked_for_strip ())
-	rust_error_at (return_type->get_locus (),
+      if (return_type.is_marked_for_strip ())
+	rust_error_at (return_type.get_locus (),
 		       "cannot strip type in this position");
     }
 }
@@ -516,8 +513,8 @@ CfgStrip::visit (AST::BorrowExpr &expr)
    * allowed to have external attributes in this position so can't be
    * stripped. */
   auto &borrowed_expr = expr.get_borrowed_expr ();
-  if (borrowed_expr->is_marked_for_strip ())
-    rust_error_at (borrowed_expr->get_locus (),
+  if (borrowed_expr.is_marked_for_strip ())
+    rust_error_at (borrowed_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -536,9 +533,9 @@ CfgStrip::visit (AST::DereferenceExpr &expr)
    * allowed to have external attributes in this position so can't be
    * stripped. */
   auto &dereferenced_expr = expr.get_dereferenced_expr ();
-  dereferenced_expr->accept_vis (*this);
-  if (dereferenced_expr->is_marked_for_strip ())
-    rust_error_at (dereferenced_expr->get_locus (),
+  dereferenced_expr.accept_vis (*this);
+  if (dereferenced_expr.is_marked_for_strip ())
+    rust_error_at (dereferenced_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -559,8 +556,8 @@ CfgStrip::visit (AST::ErrorPropagationExpr &expr)
    * allowed to have external attributes in this position so can't be
    * stripped. */
   auto &propagating_expr = expr.get_propagating_expr ();
-  if (propagating_expr->is_marked_for_strip ())
-    rust_error_at (propagating_expr->get_locus (),
+  if (propagating_expr.is_marked_for_strip ())
+    rust_error_at (propagating_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -580,8 +577,8 @@ CfgStrip::visit (AST::NegationExpr &expr)
    * allowed to have external attributes in this position so can't be
    * stripped. */
   auto &negated_expr = expr.get_negated_expr ();
-  if (negated_expr->is_marked_for_strip ())
-    rust_error_at (negated_expr->get_locus (),
+  if (negated_expr.is_marked_for_strip ())
+    rust_error_at (negated_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -593,13 +590,13 @@ CfgStrip::visit (AST::ArithmeticOrLogicalExpr &expr)
    * two direct descendant expressions, can strip ones below that */
 
   // ensure that they are not marked for strip
-  if (expr.get_left_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_left_expr ()->get_locus (),
+  if (expr.get_left_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_left_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before binary op exprs");
-  if (expr.get_right_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_right_expr ()->get_locus (),
+  if (expr.get_right_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_right_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -612,13 +609,13 @@ CfgStrip::visit (AST::ComparisonExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   // ensure that they are not marked for strip
-  if (expr.get_left_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_left_expr ()->get_locus (),
+  if (expr.get_left_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_left_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before binary op exprs");
-  if (expr.get_right_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_right_expr ()->get_locus (),
+  if (expr.get_right_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_right_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -631,13 +628,13 @@ CfgStrip::visit (AST::LazyBooleanExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   // ensure that they are not marked for strip
-  if (expr.get_left_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_left_expr ()->get_locus (),
+  if (expr.get_left_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_left_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before binary op exprs");
-  if (expr.get_right_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_right_expr ()->get_locus (),
+  if (expr.get_right_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_right_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -651,15 +648,15 @@ CfgStrip::visit (AST::TypeCastExpr &expr)
 
   auto &casted_expr = expr.get_casted_expr ();
   // ensure that they are not marked for strip
-  if (casted_expr->is_marked_for_strip ())
-    rust_error_at (casted_expr->get_locus (),
+  if (casted_expr.is_marked_for_strip ())
+    rust_error_at (casted_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed before cast exprs");
 
   // TODO: strip sub-types of type
   auto &type = expr.get_type_to_cast_to ();
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 }
 void
 CfgStrip::visit (AST::AssignmentExpr &expr)
@@ -673,13 +670,13 @@ CfgStrip::visit (AST::AssignmentExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   // ensure that they are not marked for strip
-  if (expr.get_left_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_left_expr ()->get_locus (),
+  if (expr.get_left_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_left_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before binary op exprs");
-  if (expr.get_right_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_right_expr ()->get_locus (),
+  if (expr.get_right_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_right_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -691,13 +688,13 @@ CfgStrip::visit (AST::CompoundAssignmentExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   // ensure that they are not marked for strip
-  if (expr.get_left_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_left_expr ()->get_locus (),
+  if (expr.get_left_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_left_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before binary op exprs");
-  if (expr.get_right_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_right_expr ()->get_locus (),
+  if (expr.get_right_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_right_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -727,8 +724,8 @@ CfgStrip::visit (AST::GroupedExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   auto &inner_expr = expr.get_expr_in_parens ();
-  if (inner_expr->is_marked_for_strip ())
-    rust_error_at (inner_expr->get_locus (),
+  if (inner_expr.is_marked_for_strip ())
+    rust_error_at (inner_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -750,15 +747,15 @@ CfgStrip::visit (AST::ArrayElemsCopied &elems)
 
   // only intend stripping for internal sub-expressions
   auto &copied_expr = elems.get_elem_to_copy ();
-  if (copied_expr->is_marked_for_strip ())
-    rust_error_at (copied_expr->get_locus (),
+  if (copied_expr.is_marked_for_strip ())
+    rust_error_at (copied_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   auto &copy_count = elems.get_num_copies ();
-  copy_count->accept_vis (*this);
-  if (copy_count->is_marked_for_strip ())
-    rust_error_at (copy_count->get_locus (),
+  copy_count.accept_vis (*this);
+  if (copy_count.is_marked_for_strip ())
+    rust_error_at (copy_count.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -807,14 +804,14 @@ CfgStrip::visit (AST::ArrayIndexExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   const auto &array_expr = expr.get_array_expr ();
-  if (array_expr->is_marked_for_strip ())
-    rust_error_at (array_expr->get_locus (),
+  if (array_expr.is_marked_for_strip ())
+    rust_error_at (array_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   const auto &index_expr = expr.get_index_expr ();
-  if (index_expr->is_marked_for_strip ())
-    rust_error_at (index_expr->get_locus (),
+  if (index_expr.is_marked_for_strip ())
+    rust_error_at (index_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -861,8 +858,8 @@ CfgStrip::visit (AST::TupleIndexExpr &expr)
    * associated with this level), but any sub-expressions would be
    * stripped. Thus, no need to erase when strip check called. */
   auto &tuple_expr = expr.get_tuple_expr ();
-  if (tuple_expr->is_marked_for_strip ())
-    rust_error_at (tuple_expr->get_locus (),
+  if (tuple_expr.is_marked_for_strip ())
+    rust_error_at (tuple_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -903,8 +900,8 @@ CfgStrip::visit (AST::StructExprFieldIdentifierValue &field)
   AST::DefaultASTVisitor::visit (field);
 
   auto &value = field.get_value ();
-  if (value->is_marked_for_strip ())
-    rust_error_at (value->get_locus (),
+  if (value.is_marked_for_strip ())
+    rust_error_at (value.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -916,8 +913,8 @@ CfgStrip::visit (AST::StructExprFieldIndexValue &field)
   AST::DefaultASTVisitor::visit (field);
 
   auto &value = field.get_value ();
-  if (value->is_marked_for_strip ())
-    rust_error_at (value->get_locus (),
+  if (value.is_marked_for_strip ())
+    rust_error_at (value.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -959,9 +956,9 @@ CfgStrip::visit (AST::StructExprStructFields &expr)
   if (expr.has_struct_base ())
     {
       auto &base_struct_expr = expr.get_struct_base ().get_base_struct ();
-      base_struct_expr->accept_vis (*this);
-      if (base_struct_expr->is_marked_for_strip ())
-	rust_error_at (base_struct_expr->get_locus (),
+      base_struct_expr.accept_vis (*this);
+      if (base_struct_expr.is_marked_for_strip ())
+	rust_error_at (base_struct_expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
     }
@@ -998,9 +995,9 @@ CfgStrip::visit (AST::StructExprStructBase &expr)
    * the expression. as such, can only strip sub-expressions. */
   rust_assert (!expr.get_struct_base ().is_invalid ());
   auto &base_struct_expr = expr.get_struct_base ().get_base_struct ();
-  base_struct_expr->accept_vis (*this);
-  if (base_struct_expr->is_marked_for_strip ())
-    rust_error_at (base_struct_expr->get_locus (),
+  base_struct_expr.accept_vis (*this);
+  if (base_struct_expr.is_marked_for_strip ())
+    rust_error_at (base_struct_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1021,8 +1018,8 @@ CfgStrip::visit (AST::CallExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   auto &function = expr.get_function_expr ();
-  if (function->is_marked_for_strip ())
-    rust_error_at (function->get_locus (),
+  if (function.is_marked_for_strip ())
+    rust_error_at (function.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
@@ -1049,8 +1046,8 @@ CfgStrip::visit (AST::MethodCallExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   auto &receiver = expr.get_receiver_expr ();
-  if (receiver->is_marked_for_strip ())
-    rust_error_at (receiver->get_locus (),
+  if (receiver.is_marked_for_strip ())
+    rust_error_at (receiver.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
@@ -1079,8 +1076,8 @@ CfgStrip::visit (AST::FieldAccessExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   auto &receiver = expr.get_receiver_expr ();
-  if (receiver->is_marked_for_strip ())
-    rust_error_at (receiver->get_locus (),
+  if (receiver.is_marked_for_strip ())
+    rust_error_at (receiver.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1103,8 +1100,8 @@ CfgStrip::visit (AST::ClosureExprInner &expr)
 
   // can't strip expression itself, but can strip sub-expressions
   auto &definition_expr = expr.get_definition_expr ();
-  if (definition_expr->is_marked_for_strip ())
-    rust_error_at (definition_expr->get_locus (),
+  if (definition_expr.is_marked_for_strip ())
+    rust_error_at (definition_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1138,7 +1135,7 @@ CfgStrip::visit (AST::BlockExpr &expr)
     {
       auto &tail_expr = expr.get_tail_expr ();
 
-      if (tail_expr->is_marked_for_strip ())
+      if (tail_expr.is_marked_for_strip ())
 	expr.strip_tail_expr ();
     }
 }
@@ -1163,14 +1160,14 @@ CfgStrip::visit (AST::ClosureExprInnerTyped &expr)
   // can't strip return type, but can strip sub-types
   auto &type = expr.get_return_type ();
 
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   // can't strip expression itself, but can strip sub-expressions
   auto &definition_block = expr.get_definition_block ();
-  definition_block->accept_vis (*this);
-  if (definition_block->is_marked_for_strip ())
-    rust_error_at (definition_block->get_locus (),
+  definition_block.accept_vis (*this);
+  if (definition_block.is_marked_for_strip ())
+    rust_error_at (definition_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1204,8 +1201,8 @@ CfgStrip::visit (AST::BreakExpr &expr)
     {
       auto &break_expr = expr.get_break_expr ();
 
-      if (break_expr->is_marked_for_strip ())
-	rust_error_at (break_expr->get_locus (),
+      if (break_expr.is_marked_for_strip ())
+	rust_error_at (break_expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
     }
@@ -1218,13 +1215,13 @@ CfgStrip::visit (AST::RangeFromToExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   // ensure that they are not marked for strip
-  if (expr.get_from_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_from_expr ()->get_locus (),
+  if (expr.get_from_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_from_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before range exprs");
-  if (expr.get_to_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_to_expr ()->get_locus (),
+  if (expr.get_to_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_to_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1238,8 +1235,8 @@ CfgStrip::visit (AST::RangeFromExpr &expr)
   /* should have no possibility for outer attrs as would be parsed
    * with outer expr */
   auto &from_expr = expr.get_from_expr ();
-  if (from_expr->is_marked_for_strip ())
-    rust_error_at (from_expr->get_locus (),
+  if (from_expr.is_marked_for_strip ())
+    rust_error_at (from_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed before range exprs");
 }
@@ -1253,8 +1250,8 @@ CfgStrip::visit (AST::RangeToExpr &expr)
   /* should syntactically not have outer attributes, though this may
    * not have worked in practice */
   auto &to_expr = expr.get_to_expr ();
-  if (to_expr->is_marked_for_strip ())
-    rust_error_at (to_expr->get_locus (),
+  if (to_expr.is_marked_for_strip ())
+    rust_error_at (to_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1268,13 +1265,13 @@ CfgStrip::visit (AST::RangeFromToInclExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
 
   // ensure that they are not marked for strip
-  if (expr.get_from_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_from_expr ()->get_locus (),
+  if (expr.get_from_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_from_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes are never allowed "
 		   "before range exprs");
-  if (expr.get_to_expr ()->is_marked_for_strip ())
-    rust_error_at (expr.get_to_expr ()->get_locus (),
+  if (expr.get_to_expr ().is_marked_for_strip ())
+    rust_error_at (expr.get_to_expr ().get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1288,8 +1285,8 @@ CfgStrip::visit (AST::RangeToInclExpr &expr)
   /* should syntactically not have outer attributes, though this may
    * not have worked in practice */
   auto &to_expr = expr.get_to_expr ();
-  if (to_expr->is_marked_for_strip ())
-    rust_error_at (to_expr->get_locus (),
+  if (to_expr.is_marked_for_strip ())
+    rust_error_at (to_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1312,8 +1309,8 @@ CfgStrip::visit (AST::ReturnExpr &expr)
   if (expr.has_returned_expr ())
     {
       auto &returned_expr = expr.get_returned_expr ();
-      if (returned_expr->is_marked_for_strip ())
-	rust_error_at (returned_expr->get_locus (),
+      if (returned_expr.is_marked_for_strip ())
+	rust_error_at (returned_expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
     }
@@ -1338,8 +1335,8 @@ CfgStrip::visit (AST::UnsafeBlockExpr &expr)
 
   // can't strip block itself, but can strip sub-expressions
   auto &block_expr = expr.get_block_expr ();
-  if (block_expr->is_marked_for_strip ())
-    rust_error_at (block_expr->get_locus (),
+  if (block_expr.is_marked_for_strip ())
+    rust_error_at (block_expr.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1358,8 +1355,8 @@ CfgStrip::visit (AST::LoopExpr &expr)
 
   // can't strip block itself, but can strip sub-expressions
   auto &loop_block = expr.get_loop_block ();
-  if (loop_block->is_marked_for_strip ())
-    rust_error_at (loop_block->get_locus (),
+  if (loop_block.is_marked_for_strip ())
+    rust_error_at (loop_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1377,15 +1374,15 @@ CfgStrip::visit (AST::WhileLoopExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
   // can't strip predicate expr itself, but can strip sub-expressions
   auto &predicate_expr = expr.get_predicate_expr ();
-  if (predicate_expr->is_marked_for_strip ())
-    rust_error_at (predicate_expr->get_locus (),
+  if (predicate_expr.is_marked_for_strip ())
+    rust_error_at (predicate_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip block itself, but can strip sub-expressions
   auto &loop_block = expr.get_loop_block ();
-  if (loop_block->is_marked_for_strip ())
-    rust_error_at (loop_block->get_locus (),
+  if (loop_block.is_marked_for_strip ())
+    rust_error_at (loop_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1409,15 +1406,15 @@ CfgStrip::visit (AST::WhileLetLoopExpr &expr)
 
   // can't strip scrutinee expr itself, but can strip sub-expressions
   auto &scrutinee_expr = expr.get_scrutinee_expr ();
-  if (scrutinee_expr->is_marked_for_strip ())
-    rust_error_at (scrutinee_expr->get_locus (),
+  if (scrutinee_expr.is_marked_for_strip ())
+    rust_error_at (scrutinee_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip block itself, but can strip sub-expressions
   auto &loop_block = expr.get_loop_block ();
-  if (loop_block->is_marked_for_strip ())
-    rust_error_at (loop_block->get_locus (),
+  if (loop_block.is_marked_for_strip ())
+    rust_error_at (loop_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1435,21 +1432,21 @@ CfgStrip::visit (AST::ForLoopExpr &expr)
   AST::DefaultASTVisitor::visit (expr);
   // strip sub-patterns of pattern
   auto &pattern = expr.get_pattern ();
-  if (pattern->is_marked_for_strip ())
-    rust_error_at (pattern->get_locus (),
+  if (pattern.is_marked_for_strip ())
+    rust_error_at (pattern.get_locus (),
 		   "cannot strip pattern in this position");
 
   // can't strip scrutinee expr itself, but can strip sub-expressions
   auto &iterator_expr = expr.get_iterator_expr ();
-  if (iterator_expr->is_marked_for_strip ())
-    rust_error_at (iterator_expr->get_locus (),
+  if (iterator_expr.is_marked_for_strip ())
+    rust_error_at (iterator_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip block itself, but can strip sub-expressions
   auto &loop_block = expr.get_loop_block ();
-  if (loop_block->is_marked_for_strip ())
-    rust_error_at (loop_block->get_locus (),
+  if (loop_block.is_marked_for_strip ())
+    rust_error_at (loop_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1471,15 +1468,15 @@ CfgStrip::visit (AST::IfExpr &expr)
 
   // can't strip condition expr itself, but can strip sub-expressions
   auto &condition_expr = expr.get_condition_expr ();
-  if (condition_expr->is_marked_for_strip ())
-    rust_error_at (condition_expr->get_locus (),
+  if (condition_expr.is_marked_for_strip ())
+    rust_error_at (condition_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip if block itself, but can strip sub-expressions
   auto &if_block = expr.get_if_block ();
-  if (if_block->is_marked_for_strip ())
-    rust_error_at (if_block->get_locus (),
+  if (if_block.is_marked_for_strip ())
+    rust_error_at (if_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1499,22 +1496,22 @@ CfgStrip::visit (AST::IfExprConseqElse &expr)
 
   // can't strip condition expr itself, but can strip sub-expressions
   auto &condition_expr = expr.get_condition_expr ();
-  if (condition_expr->is_marked_for_strip ())
-    rust_error_at (condition_expr->get_locus (),
+  if (condition_expr.is_marked_for_strip ())
+    rust_error_at (condition_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip if block itself, but can strip sub-expressions
   auto &if_block = expr.get_if_block ();
-  if (if_block->is_marked_for_strip ())
-    rust_error_at (if_block->get_locus (),
+  if (if_block.is_marked_for_strip ())
+    rust_error_at (if_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip else block itself, but can strip sub-expressions
   auto &else_block = expr.get_else_block ();
-  if (else_block->is_marked_for_strip ())
-    rust_error_at (else_block->get_locus (),
+  if (else_block.is_marked_for_strip ())
+    rust_error_at (else_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1539,15 +1536,15 @@ CfgStrip::visit (AST::IfLetExpr &expr)
 
   // can't strip value expr itself, but can strip sub-expressions
   auto &value_expr = expr.get_value_expr ();
-  if (value_expr->is_marked_for_strip ())
-    rust_error_at (value_expr->get_locus (),
+  if (value_expr.is_marked_for_strip ())
+    rust_error_at (value_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip if block itself, but can strip sub-expressions
   auto &if_block = expr.get_if_block ();
-  if (if_block->is_marked_for_strip ())
-    rust_error_at (if_block->get_locus (),
+  if (if_block.is_marked_for_strip ())
+    rust_error_at (if_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1571,22 +1568,22 @@ CfgStrip::visit (AST::IfLetExprConseqElse &expr)
 
   // can't strip value expr itself, but can strip sub-expressions
   auto &value_expr = expr.get_value_expr ();
-  if (value_expr->is_marked_for_strip ())
-    rust_error_at (value_expr->get_locus (),
+  if (value_expr.is_marked_for_strip ())
+    rust_error_at (value_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip if block itself, but can strip sub-expressions
   auto &if_block = expr.get_if_block ();
-  if (if_block->is_marked_for_strip ())
-    rust_error_at (if_block->get_locus (),
+  if (if_block.is_marked_for_strip ())
+    rust_error_at (if_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 
   // can't strip else block itself, but can strip sub-expressions
   auto &else_block = expr.get_else_block ();
-  if (else_block->is_marked_for_strip ())
-    rust_error_at (else_block->get_locus (),
+  if (else_block.is_marked_for_strip ())
+    rust_error_at (else_block.get_locus (),
 		   "cannot strip block expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1613,8 +1610,8 @@ CfgStrip::visit (AST::MatchExpr &expr)
 
   // can't strip scrutinee expr itself, but can strip sub-expressions
   auto &scrutinee_expr = expr.get_scrutinee_expr ();
-  if (scrutinee_expr->is_marked_for_strip ())
-    rust_error_at (scrutinee_expr->get_locus (),
+  if (scrutinee_expr.is_marked_for_strip ())
+    rust_error_at (scrutinee_expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 
@@ -1646,16 +1643,16 @@ CfgStrip::visit (AST::MatchExpr &expr)
       if (match_arm.has_match_arm_guard ())
 	{
 	  auto &guard_expr = match_arm.get_guard_expr ();
-	  if (guard_expr->is_marked_for_strip ())
-	    rust_error_at (guard_expr->get_locus (),
+	  if (guard_expr.is_marked_for_strip ())
+	    rust_error_at (guard_expr.get_locus (),
 			   "cannot strip expression in this position - outer "
 			   "attributes not allowed");
 	}
 
       // strip sub-expressions from match cases
       auto &case_expr = match_case.get_expr ();
-      if (case_expr->is_marked_for_strip ())
-	rust_error_at (case_expr->get_locus (),
+      if (case_expr.is_marked_for_strip ())
+	rust_error_at (case_expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
 
@@ -1713,8 +1710,8 @@ CfgStrip::visit (AST::TypeParam &param)
 
   AST::DefaultASTVisitor::visit (param);
 
-  if (param.has_type () && param.get_type ()->is_marked_for_strip ())
-    rust_error_at (param.get_type ()->get_locus (),
+  if (param.has_type () && param.get_type ().is_marked_for_strip ())
+    rust_error_at (param.get_type ().get_locus (),
 		   "cannot strip type in this position");
 }
 
@@ -1725,8 +1722,8 @@ CfgStrip::visit (AST::TypeBoundWhereClauseItem &item)
   AST::DefaultASTVisitor::visit (item);
 
   auto &type = item.get_type ();
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 }
 
 void
@@ -1807,8 +1804,8 @@ CfgStrip::visit (AST::Function &function)
   if (function.has_return_type ())
     {
       auto &return_type = function.get_return_type ();
-      if (return_type->is_marked_for_strip ())
-	rust_error_at (return_type->get_locus (),
+      if (return_type.is_marked_for_strip ())
+	rust_error_at (return_type.get_locus (),
 		       "cannot strip type in this position");
     }
 
@@ -1839,8 +1836,8 @@ CfgStrip::visit (AST::TypeAlias &type_alias)
   AST::DefaultASTVisitor::visit (type_alias);
 
   auto &type = type_alias.get_type_aliased ();
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 }
 
 void
@@ -1933,8 +1930,8 @@ CfgStrip::visit (AST::EnumItemDiscriminant &item)
    * allowed to have external attributes in this position so can't be
    * stripped. */
   auto &expr = item.get_expr ();
-  if (expr->is_marked_for_strip ())
-    rust_error_at (expr->get_locus (),
+  if (expr.is_marked_for_strip ())
+    rust_error_at (expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -1987,8 +1984,8 @@ CfgStrip::visit (AST::ConstantItem &const_item)
 
   // strip any sub-types
   auto &type = const_item.get_type ();
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   /* strip any internal sub-expressions - expression itself isn't
    * allowed to have external attributes in this position so can't be
@@ -1996,8 +1993,8 @@ CfgStrip::visit (AST::ConstantItem &const_item)
   if (const_item.has_expr ())
     {
       auto &expr = const_item.get_expr ();
-      if (expr->is_marked_for_strip ())
-	rust_error_at (expr->get_locus (),
+      if (expr.is_marked_for_strip ())
+	rust_error_at (expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
     }
@@ -2018,15 +2015,15 @@ CfgStrip::visit (AST::StaticItem &static_item)
   // strip any sub-types
   auto &type = static_item.get_type ();
 
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   /* strip any internal sub-expressions - expression itself isn't
    * allowed to have external attributes in this position so can't be
    * stripped. */
   auto &expr = static_item.get_expr ();
-  if (expr->is_marked_for_strip ())
-    rust_error_at (expr->get_locus (),
+  if (expr.is_marked_for_strip ())
+    rust_error_at (expr.get_locus (),
 		   "cannot strip expression in this position - outer "
 		   "attributes not allowed");
 }
@@ -2047,8 +2044,8 @@ CfgStrip::visit (AST::TraitItemConst &item)
   // strip any sub-types
   auto &type = item.get_type ();
 
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   /* strip any internal sub-expressions - expression itself isn't
    * allowed to have external attributes in this position so can't be
@@ -2056,8 +2053,8 @@ CfgStrip::visit (AST::TraitItemConst &item)
   if (item.has_expression ())
     {
       auto &expr = item.get_expr ();
-      if (expr->is_marked_for_strip ())
-	rust_error_at (expr->get_locus (),
+      if (expr.is_marked_for_strip ())
+	rust_error_at (expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
     }
@@ -2124,8 +2121,8 @@ CfgStrip::visit (AST::InherentImpl &impl)
 
   auto &type = impl.get_type ();
 
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   maybe_strip_pointer_allow_strip (impl.get_impl_items ());
 }
@@ -2152,8 +2149,8 @@ CfgStrip::visit (AST::TraitImpl &impl)
   AST::DefaultASTVisitor::visit (impl);
 
   auto &type = impl.get_type ();
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 
   auto &trait_path = impl.get_trait_path ();
   visit (trait_path);
@@ -2191,8 +2188,8 @@ CfgStrip::visit (AST::ExternalStaticItem &item)
   AST::DefaultASTVisitor::visit (item);
 
   auto &type = item.get_type ();
-  if (type->is_marked_for_strip ())
-    rust_error_at (type->get_locus (), "cannot strip type in this position");
+  if (type.is_marked_for_strip ())
+    rust_error_at (type.get_locus (), "cannot strip type in this position");
 }
 
 void
@@ -2239,8 +2236,8 @@ CfgStrip::visit (AST::IdentifierPattern &pattern)
   AST::DefaultASTVisitor::visit (pattern);
 
   auto &sub_pattern = pattern.get_pattern_to_bind ();
-  if (sub_pattern->is_marked_for_strip ())
-    rust_error_at (sub_pattern->get_locus (),
+  if (sub_pattern.is_marked_for_strip ())
+    rust_error_at (sub_pattern.get_locus (),
 		   "cannot strip pattern in this position");
 }
 
@@ -2270,8 +2267,8 @@ CfgStrip::visit (AST::ReferencePattern &pattern)
   AST::DefaultASTVisitor::visit (pattern);
 
   auto &sub_pattern = pattern.get_referenced_pattern ();
-  if (sub_pattern->is_marked_for_strip ())
-    rust_error_at (sub_pattern->get_locus (),
+  if (sub_pattern.is_marked_for_strip ())
+    rust_error_at (sub_pattern.get_locus (),
 		   "cannot strip pattern in this position");
 }
 void
@@ -2289,8 +2286,8 @@ CfgStrip::visit (AST::StructPatternFieldTuplePat &field)
 
   // strip sub-patterns (can't strip top-level pattern)
   auto &sub_pattern = field.get_index_pattern ();
-  if (sub_pattern->is_marked_for_strip ())
-    rust_error_at (sub_pattern->get_locus (),
+  if (sub_pattern.is_marked_for_strip ())
+    rust_error_at (sub_pattern.get_locus (),
 		   "cannot strip pattern in this position");
 }
 
@@ -2308,8 +2305,8 @@ CfgStrip::visit (AST::StructPatternFieldIdentPat &field)
   AST::DefaultASTVisitor::visit (field);
   // strip sub-patterns (can't strip top-level pattern)
   auto &sub_pattern = field.get_ident_pattern ();
-  if (sub_pattern->is_marked_for_strip ())
-    rust_error_at (sub_pattern->get_locus (),
+  if (sub_pattern.is_marked_for_strip ())
+    rust_error_at (sub_pattern.get_locus (),
 		   "cannot strip pattern in this position");
 }
 void
@@ -2442,8 +2439,8 @@ CfgStrip::visit (AST::GroupedPattern &pattern)
   // can't strip inner pattern, only sub-patterns
   auto &pattern_in_parens = pattern.get_pattern_in_parens ();
 
-  if (pattern_in_parens->is_marked_for_strip ())
-    rust_error_at (pattern_in_parens->get_locus (),
+  if (pattern_in_parens.is_marked_for_strip ())
+    rust_error_at (pattern_in_parens.get_locus (),
 		   "cannot strip pattern in this position");
 }
 
@@ -2489,8 +2486,8 @@ CfgStrip::visit (AST::LetStmt &stmt)
   AST::DefaultASTVisitor::visit (stmt);
   // can't strip pattern, but call for sub-patterns
   auto &pattern = stmt.get_pattern ();
-  if (pattern->is_marked_for_strip ())
-    rust_error_at (pattern->get_locus (),
+  if (pattern.is_marked_for_strip ())
+    rust_error_at (pattern.get_locus (),
 		   "cannot strip pattern in this position");
 
   // similar for type
@@ -2498,9 +2495,8 @@ CfgStrip::visit (AST::LetStmt &stmt)
     {
       auto &type = stmt.get_type ();
 
-      if (type->is_marked_for_strip ())
-	rust_error_at (type->get_locus (),
-		       "cannot strip type in this position");
+      if (type.is_marked_for_strip ())
+	rust_error_at (type.get_locus (), "cannot strip type in this position");
     }
 
   /* strip any internal sub-expressions - expression itself isn't
@@ -2510,8 +2506,8 @@ CfgStrip::visit (AST::LetStmt &stmt)
     {
       auto &init_expr = stmt.get_init_expr ();
 
-      if (init_expr->is_marked_for_strip ())
-	rust_error_at (init_expr->get_locus (),
+      if (init_expr.is_marked_for_strip ())
+	rust_error_at (init_expr.get_locus (),
 		       "cannot strip expression in this position - outer "
 		       "attributes not allowed");
     }
@@ -2529,7 +2525,7 @@ CfgStrip::visit (AST::ExprStmt &stmt)
   AST::DefaultASTVisitor::visit (stmt);
   // strip if expr is to be stripped
   auto &expr = stmt.get_expr ();
-  if (expr->is_marked_for_strip ())
+  if (expr.is_marked_for_strip ())
     {
       stmt.mark_for_strip ();
       return;
@@ -2580,8 +2576,8 @@ CfgStrip::visit (AST::RawPointerType &type)
   AST::DefaultASTVisitor::visit (type);
   // expand but don't strip type pointed to
   auto &pointed_type = type.get_type_pointed_to ();
-  if (pointed_type->is_marked_for_strip ())
-    rust_error_at (pointed_type->get_locus (),
+  if (pointed_type.is_marked_for_strip ())
+    rust_error_at (pointed_type.get_locus (),
 		   "cannot strip type in this position");
 }
 
@@ -2591,8 +2587,8 @@ CfgStrip::visit (AST::ReferenceType &type)
   AST::DefaultASTVisitor::visit (type);
   // expand but don't strip type referenced
   auto &referenced_type = type.get_type_referenced ();
-  if (referenced_type->is_marked_for_strip ())
-    rust_error_at (referenced_type->get_locus (),
+  if (referenced_type.is_marked_for_strip ())
+    rust_error_at (referenced_type.get_locus (),
 		   "cannot strip type in this position");
 }
 
@@ -2602,14 +2598,14 @@ CfgStrip::visit (AST::ArrayType &type)
   AST::DefaultASTVisitor::visit (type);
   // expand but don't strip type referenced
   auto &base_type = type.get_elem_type ();
-  if (base_type->is_marked_for_strip ())
-    rust_error_at (base_type->get_locus (),
+  if (base_type.is_marked_for_strip ())
+    rust_error_at (base_type.get_locus (),
 		   "cannot strip type in this position");
 
   // same for expression
   auto &size_expr = type.get_size_expr ();
-  if (size_expr->is_marked_for_strip ())
-    rust_error_at (size_expr->get_locus (),
+  if (size_expr.is_marked_for_strip ())
+    rust_error_at (size_expr.get_locus (),
 		   "cannot strip expression in this position");
 }
 void
@@ -2618,8 +2614,8 @@ CfgStrip::visit (AST::SliceType &type)
   AST::DefaultASTVisitor::visit (type);
   // expand but don't strip elem type
   auto &elem_type = type.get_elem_type ();
-  if (elem_type->is_marked_for_strip ())
-    rust_error_at (elem_type->get_locus (),
+  if (elem_type.is_marked_for_strip ())
+    rust_error_at (elem_type.get_locus (),
 		   "cannot strip type in this position");
 }
 
@@ -2644,9 +2640,8 @@ CfgStrip::visit (AST::BareFunctionType &type)
 	}
 
       auto &type = param.get_type ();
-      if (type->is_marked_for_strip ())
-	rust_error_at (type->get_locus (),
-		       "cannot strip type in this position");
+      if (type.is_marked_for_strip ())
+	rust_error_at (type.get_locus (), "cannot strip type in this position");
 
       // increment if nothing else happens
       ++it;
@@ -2661,8 +2656,8 @@ CfgStrip::visit (AST::BareFunctionType &type)
       // In that case, we need to handle AST::TypeNoBounds on top of just
       // AST::Types
       auto &return_type = type.get_return_type ();
-      if (return_type->is_marked_for_strip ())
-	rust_error_at (return_type->get_locus (),
+      if (return_type.is_marked_for_strip ())
+	rust_error_at (return_type.get_locus (),
 		       "cannot strip type in this position");
     }
 
@@ -2677,9 +2672,8 @@ CfgStrip::visit (AST::SelfParam &param)
   if (param.has_type ())
     {
       auto &type = param.get_type ();
-      if (type->is_marked_for_strip ())
-	rust_error_at (type->get_locus (),
-		       "cannot strip type in this position");
+      if (type.is_marked_for_strip ())
+	rust_error_at (type.get_locus (), "cannot strip type in this position");
     }
   /* TODO: maybe check for invariants being violated - e.g. both type and
    * lifetime? */
diff --git a/gcc/rust/expand/rust-expand-visitor.cc b/gcc/rust/expand/rust-expand-visitor.cc
index 6c1efb1d2e0..c840c25994e 100644
--- a/gcc/rust/expand/rust-expand-visitor.cc
+++ b/gcc/rust/expand/rust-expand-visitor.cc
@@ -360,7 +360,7 @@ ExpandVisitor::expand_struct_fields (std::vector<AST::StructField> &fields)
 {
   for (auto &field : fields)
     {
-      maybe_expand_type (field.get_field_type ());
+      maybe_expand_type (field.get_field_type_ptr ());
     }
 }
 
@@ -368,7 +368,7 @@ void
 ExpandVisitor::expand_tuple_fields (std::vector<AST::TupleField> &fields)
 {
   for (auto &field : fields)
-    maybe_expand_type (field.get_field_type ());
+    maybe_expand_type (field.get_field_type_ptr ());
 }
 
 // FIXME: This can definitely be refactored with the method above
@@ -388,10 +388,10 @@ ExpandVisitor::expand_generic_args (AST::GenericArgs &args)
       switch (arg.get_kind ())
 	{
 	case AST::GenericArg::Kind::Type:
-	  maybe_expand_type (arg.get_type ());
+	  maybe_expand_type (arg.get_type_ptr ());
 	  break;
 	case AST::GenericArg::Kind::Const:
-	  maybe_expand_expr (arg.get_expression ());
+	  maybe_expand_expr (arg.get_expression_ptr ());
 	  break;
 	default:
 	  break;
@@ -407,13 +407,13 @@ ExpandVisitor::expand_generic_args (AST::GenericArgs &args)
   // expand binding args - strip sub-types only
   // FIXME: ARTHUR: This needs a test! Foo<Item = macro!()>
   for (auto &binding : args.get_binding_args ())
-    maybe_expand_type (binding.get_type ());
+    maybe_expand_type (binding.get_type_ptr ());
 }
 
 void
 ExpandVisitor::expand_qualified_path_type (AST::QualifiedPathType &path_type)
 {
-  maybe_expand_type (path_type.get_type ());
+  maybe_expand_type (path_type.get_type_ptr ());
 
   // FIXME: ARTHUR: Can we do macro expansion in there? Needs a test!
   if (path_type.has_as_clause ())
@@ -426,7 +426,7 @@ ExpandVisitor::expand_closure_params (std::vector<AST::ClosureParam> &params)
   for (auto &param : params)
     {
       if (param.has_type_given ())
-	maybe_expand_type (param.get_type ());
+	maybe_expand_type (param.get_type_ptr ());
     }
 }
 
@@ -491,7 +491,7 @@ ExpandVisitor::visit (AST::TypePathSegmentFunction &segment)
     visit (type);
 
   if (type_path_function.has_return_type ())
-    maybe_expand_type (type_path_function.get_return_type ());
+    maybe_expand_type (type_path_function.get_return_type_ptr ());
 }
 
 void
@@ -545,42 +545,42 @@ ExpandVisitor::visit (AST::ErrorPropagationExpr &expr)
 void
 ExpandVisitor::visit (AST::ArithmeticOrLogicalExpr &expr)
 {
-  maybe_expand_expr (expr.get_left_expr ());
-  maybe_expand_expr (expr.get_right_expr ());
+  maybe_expand_expr (expr.get_left_expr_ptr ());
+  maybe_expand_expr (expr.get_right_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::ComparisonExpr &expr)
 {
-  maybe_expand_expr (expr.get_left_expr ());
-  maybe_expand_expr (expr.get_right_expr ());
+  maybe_expand_expr (expr.get_left_expr_ptr ());
+  maybe_expand_expr (expr.get_right_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::LazyBooleanExpr &expr)
 {
-  maybe_expand_expr (expr.get_left_expr ());
-  maybe_expand_expr (expr.get_right_expr ());
+  maybe_expand_expr (expr.get_left_expr_ptr ());
+  maybe_expand_expr (expr.get_right_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::AssignmentExpr &expr)
 {
-  maybe_expand_expr (expr.get_left_expr ());
-  maybe_expand_expr (expr.get_right_expr ());
+  maybe_expand_expr (expr.get_left_expr_ptr ());
+  maybe_expand_expr (expr.get_right_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::CompoundAssignmentExpr &expr)
 {
-  maybe_expand_expr (expr.get_left_expr ());
-  maybe_expand_expr (expr.get_right_expr ());
+  maybe_expand_expr (expr.get_left_expr_ptr ());
+  maybe_expand_expr (expr.get_right_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::GroupedExpr &expr)
 {
-  maybe_expand_expr (expr.get_expr_in_parens ());
+  maybe_expand_expr (expr.get_expr_in_parens_ptr ());
 }
 
 void
@@ -620,7 +620,7 @@ ExpandVisitor::visit (AST::BlockExpr &expr)
 
   expand_tail_expr (expr, expander);
   if (expr.has_tail_expr ())
-    maybe_expand_expr (expr.get_tail_expr ());
+    maybe_expand_expr (expr.get_tail_expr_ptr ());
 }
 
 void
@@ -628,7 +628,7 @@ ExpandVisitor::visit (AST::ClosureExprInnerTyped &expr)
 {
   expand_closure_params (expr.get_params ());
 
-  maybe_expand_type (expr.get_return_type ());
+  maybe_expand_type (expr.get_return_type_ptr ());
 
   visit (expr.get_definition_block ());
 }
@@ -640,7 +640,7 @@ ExpandVisitor::visit (AST::ContinueExpr &expr)
 void
 ExpandVisitor::visit (AST::IfExpr &expr)
 {
-  maybe_expand_expr (expr.get_condition_expr ());
+  maybe_expand_expr (expr.get_condition_expr_ptr ());
 
   visit (expr.get_if_block ());
 }
@@ -648,7 +648,7 @@ ExpandVisitor::visit (AST::IfExpr &expr)
 void
 ExpandVisitor::visit (AST::IfExprConseqElse &expr)
 {
-  maybe_expand_expr (expr.get_condition_expr ());
+  maybe_expand_expr (expr.get_condition_expr_ptr ());
 
   visit (expr.get_if_block ());
   visit (expr.get_else_block ());
@@ -657,7 +657,7 @@ ExpandVisitor::visit (AST::IfExprConseqElse &expr)
 void
 ExpandVisitor::visit (AST::IfLetExpr &expr)
 {
-  maybe_expand_expr (expr.get_value_expr ());
+  maybe_expand_expr (expr.get_value_expr_ptr ());
 
   visit (expr.get_if_block ());
 }
@@ -665,7 +665,7 @@ ExpandVisitor::visit (AST::IfLetExpr &expr)
 void
 ExpandVisitor::visit (AST::IfLetExprConseqElse &expr)
 {
-  maybe_expand_expr (expr.get_value_expr ());
+  maybe_expand_expr (expr.get_value_expr_ptr ());
 
   visit (expr.get_if_block ());
   visit (expr.get_else_block ());
@@ -684,9 +684,9 @@ ExpandVisitor::visit (AST::MatchExpr &expr)
 	visit (pattern);
 
       if (arm.has_match_arm_guard ())
-	maybe_expand_expr (arm.get_guard_expr ());
+	maybe_expand_expr (arm.get_guard_expr_ptr ());
 
-      maybe_expand_expr (match_case.get_expr ());
+      maybe_expand_expr (match_case.get_expr_ptr ());
     }
 }
 
@@ -697,7 +697,7 @@ ExpandVisitor::visit (AST::TypeParam &param)
     visit (bound);
 
   if (param.has_type ())
-    maybe_expand_type (param.get_type ());
+    maybe_expand_type (param.get_type_ptr ());
 }
 
 void
@@ -707,7 +707,7 @@ ExpandVisitor::visit (AST::LifetimeWhereClauseItem &)
 void
 ExpandVisitor::visit (AST::TypeBoundWhereClauseItem &item)
 {
-  maybe_expand_type (item.get_type ());
+  maybe_expand_type (item.get_type_ptr ());
 
   for (auto &bound : item.get_type_param_bounds ())
     visit (bound);
@@ -745,7 +745,7 @@ ExpandVisitor::visit (AST::Function &function)
   expand_function_params (function.get_function_params ());
 
   if (function.has_return_type ())
-    maybe_expand_type (function.get_return_type ());
+    maybe_expand_type (function.get_return_type_ptr ());
 
   if (function.has_where_clause ())
     expand_where_clause (function.get_where_clause ());
@@ -797,7 +797,7 @@ ExpandVisitor::visit (AST::EnumItemStruct &item)
 void
 ExpandVisitor::visit (AST::EnumItemDiscriminant &item)
 {
-  maybe_expand_expr (item.get_expr ());
+  maybe_expand_expr (item.get_expr_ptr ());
 }
 
 void
@@ -812,27 +812,27 @@ ExpandVisitor::visit (AST::Union &union_item)
 void
 ExpandVisitor::visit (AST::ConstantItem &const_item)
 {
-  maybe_expand_type (const_item.get_type ());
+  maybe_expand_type (const_item.get_type_ptr ());
 
   if (const_item.has_expr ())
-    maybe_expand_expr (const_item.get_expr ());
+    maybe_expand_expr (const_item.get_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::StaticItem &static_item)
 {
-  maybe_expand_type (static_item.get_type ());
+  maybe_expand_type (static_item.get_type_ptr ());
 
-  maybe_expand_expr (static_item.get_expr ());
+  maybe_expand_expr (static_item.get_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::TraitItemConst &const_item)
 {
-  maybe_expand_type (const_item.get_type ());
+  maybe_expand_type (const_item.get_type_ptr ());
 
   if (const_item.has_expr ())
-    maybe_expand_expr (const_item.get_expr ());
+    maybe_expand_expr (const_item.get_expr_ptr ());
 }
 
 void
@@ -870,7 +870,7 @@ ExpandVisitor::visit (AST::InherentImpl &impl)
   // FIXME: Is that correct? How do we test that?
   expander.push_context (MacroExpander::ContextType::ITEM);
 
-  maybe_expand_type (impl.get_type ());
+  maybe_expand_type (impl.get_type_ptr ());
 
   expander.pop_context ();
 
@@ -895,7 +895,7 @@ ExpandVisitor::visit (AST::TraitImpl &impl)
   // FIXME: Is that correct? How do we test that?
   expander.push_context (MacroExpander::ContextType::ITEM);
 
-  maybe_expand_type (impl.get_type ());
+  maybe_expand_type (impl.get_type_ptr ());
 
   expander.pop_context ();
 
@@ -919,7 +919,7 @@ ExpandVisitor::visit (AST::ExternalTypeItem &item)
 void
 ExpandVisitor::visit (AST::ExternalStaticItem &static_item)
 {
-  maybe_expand_type (static_item.get_type ());
+  maybe_expand_type (static_item.get_type_ptr ());
 }
 
 void
@@ -978,16 +978,16 @@ ExpandVisitor::visit (AST::LetStmt &stmt)
   visit (stmt.get_pattern ());
 
   if (stmt.has_type ())
-    maybe_expand_type (stmt.get_type ());
+    maybe_expand_type (stmt.get_type_ptr ());
 
   if (stmt.has_init_expr ())
-    maybe_expand_expr (stmt.get_init_expr ());
+    maybe_expand_expr (stmt.get_init_expr_ptr ());
 }
 
 void
 ExpandVisitor::visit (AST::ExprStmt &stmt)
 {
-  maybe_expand_expr (stmt.get_expr ());
+  maybe_expand_expr (stmt.get_expr_ptr ());
 }
 
 void
@@ -995,7 +995,7 @@ ExpandVisitor::visit (AST::BareFunctionType &type)
 {
   for (auto &param : type.get_function_params ())
     {
-      maybe_expand_type (param.get_type ());
+      maybe_expand_type (param.get_type_ptr ());
     }
 
   if (type.has_return_type ())
@@ -1005,7 +1005,7 @@ ExpandVisitor::visit (AST::BareFunctionType &type)
 void
 ExpandVisitor::visit (AST::FunctionParam &param)
 {
-  maybe_expand_type (param.get_type ());
+  maybe_expand_type (param.get_type_ptr ());
 }
 
 void
@@ -1014,7 +1014,7 @@ ExpandVisitor::visit (AST::SelfParam &param)
   /* TODO: maybe check for invariants being violated - e.g. both type and
    * lifetime? */
   if (param.has_type ())
-    maybe_expand_type (param.get_type ());
+    maybe_expand_type (param.get_type_ptr ());
 }
 
 template <typename T>
diff --git a/gcc/rust/expand/rust-expand-visitor.h b/gcc/rust/expand/rust-expand-visitor.h
index 034aeede2f4..8885b3876f2 100644
--- a/gcc/rust/expand/rust-expand-visitor.h
+++ b/gcc/rust/expand/rust-expand-visitor.h
@@ -47,10 +47,16 @@ public:
 
   using AST::DefaultASTVisitor::visit;
 
-  /* Maybe expand a macro invocation in lieu of an expression */
+  /*
+     Maybe expand a macro invocation in lieu of an expression
+     expr : Core guidelines R33, this function reseat the pointer.
+  */
   void maybe_expand_expr (std::unique_ptr<AST::Expr> &expr);
 
-  /* Maybe expand a macro invocation in lieu of a type */
+  /*
+     Maybe expand a macro invocation in lieu of a type
+     type : Core guidelines R33, this function reseat the pointer.
+   */
   void maybe_expand_type (std::unique_ptr<AST::Type> &type);
 
   /**
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index 652530ae7a5..bd26e7019c3 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -568,7 +568,7 @@ ASTLoweringBase::lower_generic_params (
   std::vector<std::unique_ptr<HIR::GenericParam>> lowered;
   for (auto &ast_param : params)
     {
-      auto hir_param = ASTLowerGenericParam::translate (ast_param.get ());
+      auto hir_param = ASTLowerGenericParam::translate (*ast_param);
       lowered.push_back (std::unique_ptr<HIR::GenericParam> (hir_param));
     }
 
@@ -593,8 +593,7 @@ ASTLoweringBase::lower_path_expr_seg (AST::PathExprSegment &s)
 HIR::GenericArgsBinding
 ASTLoweringBase::lower_binding (AST::GenericArgsBinding &binding)
 {
-  HIR::Type *lowered_type
-    = ASTLoweringType::translate (binding.get_type ().get ());
+  HIR::Type *lowered_type = ASTLoweringType::translate (binding.get_type ());
   return HIR::GenericArgsBinding (binding.get_identifier (),
 				  std::unique_ptr<HIR::Type> (lowered_type),
 				  binding.get_locus ());
@@ -625,13 +624,12 @@ ASTLoweringBase::lower_generic_args (AST::GenericArgs &args)
       switch (arg.get_kind ())
 	{
 	  case AST::GenericArg::Kind::Type: {
-	    auto type = ASTLoweringType::translate (arg.get_type ().get ());
+	    auto type = ASTLoweringType::translate (arg.get_type ());
 	    type_args.emplace_back (std::unique_ptr<HIR::Type> (type));
 	    break;
 	  }
 	  case AST::GenericArg::Kind::Const: {
-	    auto expr
-	      = ASTLoweringExpr::translate (arg.get_expression ().get ());
+	    auto expr = ASTLoweringExpr::translate (arg.get_expression ());
 	    const_args.emplace_back (
 	      HIR::ConstGenericArg (std::unique_ptr<HIR::Expr> (expr),
 				    expr->get_locus ()));
@@ -660,7 +658,7 @@ ASTLoweringBase::lower_self (AST::Param &param)
 
   if (self.has_type ())
     {
-      HIR::Type *type = ASTLoweringType::translate (self.get_type ().get ());
+      HIR::Type *type = ASTLoweringType::translate (self.get_type ());
       return HIR::SelfParam (mapping, std::unique_ptr<HIR::Type> (type),
 			     self.get_is_mut (), self.get_locus ());
     }
@@ -676,13 +674,13 @@ ASTLoweringBase::lower_self (AST::Param &param)
 }
 
 HIR::Type *
-ASTLoweringBase::lower_type_no_bounds (AST::TypeNoBounds *type)
+ASTLoweringBase::lower_type_no_bounds (AST::TypeNoBounds &type)
 {
   return ASTLoweringType::translate (type);
 }
 
 HIR::TypeParamBound *
-ASTLoweringBase::lower_bound (AST::TypeParamBound *bound)
+ASTLoweringBase::lower_bound (AST::TypeParamBound &bound)
 {
   return ASTLoweringTypeBounds::translate (bound);
 }
@@ -828,7 +826,7 @@ ASTLoweringBase::lower_tuple_pattern_multiple (
   std::vector<std::unique_ptr<HIR::Pattern>> patterns;
   for (auto &p : pattern.get_patterns ())
     {
-      HIR::Pattern *translated = ASTLoweringPattern::translate (p.get ());
+      HIR::Pattern *translated = ASTLoweringPattern::translate (*p);
       patterns.push_back (std::unique_ptr<HIR::Pattern> (translated));
     }
 
@@ -845,13 +843,13 @@ ASTLoweringBase::lower_tuple_pattern_ranged (
 
   for (auto &p : pattern.get_lower_patterns ())
     {
-      HIR::Pattern *translated = ASTLoweringPattern::translate (p.get ());
+      HIR::Pattern *translated = ASTLoweringPattern::translate (*p);
       lower_patterns.push_back (std::unique_ptr<HIR::Pattern> (translated));
     }
 
   for (auto &p : pattern.get_upper_patterns ())
     {
-      HIR::Pattern *translated = ASTLoweringPattern::translate (p.get ());
+      HIR::Pattern *translated = ASTLoweringPattern::translate (*p);
       upper_patterns.push_back (std::unique_ptr<HIR::Pattern> (translated));
     }
 
@@ -861,14 +859,14 @@ ASTLoweringBase::lower_tuple_pattern_ranged (
 }
 
 std::unique_ptr<HIR::RangePatternBound>
-ASTLoweringBase::lower_range_pattern_bound (AST::RangePatternBound *bound)
+ASTLoweringBase::lower_range_pattern_bound (AST::RangePatternBound &bound)
 {
   std::unique_ptr<HIR::RangePatternBound> hir_bound = nullptr;
-  switch (bound->get_bound_type ())
+  switch (bound.get_bound_type ())
     {
       case AST::RangePatternBound::RangePatternBoundType::LITERAL: {
 	AST::RangePatternBoundLiteral &ref
-	  = *static_cast<AST::RangePatternBoundLiteral *> (bound);
+	  = static_cast<AST::RangePatternBoundLiteral &> (bound);
 
 	HIR::Literal literal = lower_literal (ref.get_literal ());
 
@@ -878,23 +876,20 @@ ASTLoweringBase::lower_range_pattern_bound (AST::RangePatternBound *bound)
       }
       break;
       case AST::RangePatternBound::RangePatternBoundType::PATH: {
-	AST::RangePatternBoundPath &ref
-	  = *static_cast<AST::RangePatternBoundPath *> (bound);
+	auto &ref = static_cast<AST::RangePatternBoundPath &> (bound);
 
 	HIR::PathInExpression *path
-	  = ASTLowerPathInExpression::translate (&ref.get_path ());
+	  = ASTLowerPathInExpression::translate (ref.get_path ());
 
 	hir_bound = std::unique_ptr<HIR::RangePatternBound> (
 	  new HIR::RangePatternBoundPath (*path));
       }
       break;
       case AST::RangePatternBound::RangePatternBoundType::QUALPATH: {
-	AST::RangePatternBoundQualPath &ref
-	  = *static_cast<AST::RangePatternBoundQualPath *> (bound);
+	auto &ref = static_cast<AST::RangePatternBoundQualPath &> (bound);
 
 	HIR::QualifiedPathInExpression *qualpath
-	  = ASTLowerQualPathInExpression::translate (
-	    &ref.get_qualified_path ());
+	  = ASTLowerQualPathInExpression::translate (ref.get_qualified_path ());
 
 	hir_bound = std::unique_ptr<HIR::RangePatternBound> (
 	  new HIR::RangePatternBoundQualPath (*qualpath));
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index c01c7c85767..59cb244419f 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -280,9 +280,9 @@ protected:
 
   HIR::SelfParam lower_self (AST::Param &self);
 
-  HIR::Type *lower_type_no_bounds (AST::TypeNoBounds *type);
+  HIR::Type *lower_type_no_bounds (AST::TypeNoBounds &type);
 
-  HIR::TypeParamBound *lower_bound (AST::TypeParamBound *bound);
+  HIR::TypeParamBound *lower_bound (AST::TypeParamBound &bound);
 
   HIR::QualifiedPathType
   lower_qual_path_type (AST::QualifiedPathType &qual_path_type);
@@ -310,7 +310,7 @@ protected:
   lower_tuple_pattern_ranged (AST::TuplePatternItemsRanged &pattern);
 
   std::unique_ptr<HIR::RangePatternBound>
-  lower_range_pattern_bound (AST::RangePatternBound *bound);
+  lower_range_pattern_bound (AST::RangePatternBound &bound);
 
   HIR::Literal lower_literal (const AST::Literal &literal);
 
diff --git a/gcc/rust/hir/rust-ast-lower-block.h b/gcc/rust/hir/rust-ast-lower-block.h
index 300c24e0ab6..e15776a733f 100644
--- a/gcc/rust/hir/rust-ast-lower-block.h
+++ b/gcc/rust/hir/rust-ast-lower-block.h
@@ -30,11 +30,11 @@ class ASTLoweringBlock : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::BlockExpr *translate (AST::BlockExpr *expr, bool *terminated)
+  static HIR::BlockExpr *translate (AST::BlockExpr &expr, bool *terminated)
   {
     ASTLoweringBlock resolver;
-    expr->normalize_tail_expr ();
-    expr->accept_vis (resolver);
+    expr.normalize_tail_expr ();
+    expr.accept_vis (resolver);
     if (resolver.translated != nullptr)
       {
 	resolver.mappings->insert_hir_expr (resolver.translated);
@@ -44,16 +44,15 @@ public:
     return resolver.translated;
   }
 
-  static HIR::UnsafeBlockExpr *translate (AST::UnsafeBlockExpr *expr,
+  static HIR::UnsafeBlockExpr *translate (AST::UnsafeBlockExpr &expr,
 					  bool *terminated)
   {
     ASTLoweringBlock resolver;
 
     HIR::BlockExpr *block
-      = ASTLoweringBlock::translate (expr->get_block_expr ().get (),
-				     terminated);
+      = ASTLoweringBlock::translate (expr.get_block_expr (), terminated);
     auto crate_num = resolver.mappings->get_current_crate ();
-    Analysis::NodeMapping mapping (crate_num, expr->get_node_id (),
+    Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
 				   resolver.mappings->get_next_hir_id (
 				     crate_num),
 				   UNKNOWN_LOCAL_DEFID);
@@ -61,7 +60,7 @@ public:
     HIR::UnsafeBlockExpr *translated
       = new HIR::UnsafeBlockExpr (mapping,
 				  std::unique_ptr<HIR::BlockExpr> (block),
-				  expr->get_outer_attrs (), expr->get_locus ());
+				  expr.get_outer_attrs (), expr.get_locus ());
 
     resolver.mappings->insert_hir_expr (translated);
 
@@ -84,10 +83,10 @@ class ASTLoweringIfBlock : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::IfExpr *translate (AST::IfExpr *expr, bool *terminated)
+  static HIR::IfExpr *translate (AST::IfExpr &expr, bool *terminated)
   {
     ASTLoweringIfBlock resolver;
-    expr->accept_vis (resolver);
+    expr.accept_vis (resolver);
     if (resolver.translated != nullptr)
       {
 	resolver.mappings->insert_hir_expr (resolver.translated);
@@ -116,10 +115,10 @@ class ASTLoweringIfLetBlock : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::IfLetExpr *translate (AST::IfLetExpr *expr)
+  static HIR::IfLetExpr *translate (AST::IfLetExpr &expr)
   {
     ASTLoweringIfLetBlock resolver;
-    expr->accept_vis (resolver);
+    expr.accept_vis (resolver);
     if (resolver.translated != nullptr)
       {
 	resolver.mappings->insert_hir_expr (resolver.translated);
@@ -144,11 +143,11 @@ class ASTLoweringExprWithBlock : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::ExprWithBlock *translate (AST::ExprWithBlock *expr,
+  static HIR::ExprWithBlock *translate (AST::ExprWithBlock &expr,
 					bool *terminated)
   {
     ASTLoweringExprWithBlock resolver;
-    expr->accept_vis (resolver);
+    expr.accept_vis (resolver);
     if (resolver.translated != nullptr)
       {
 	resolver.mappings->insert_hir_expr (resolver.translated);
@@ -162,39 +161,38 @@ public:
 
   void visit (AST::IfExpr &expr) override
   {
-    translated = ASTLoweringIfBlock::translate (&expr, &terminated);
+    translated = ASTLoweringIfBlock::translate (expr, &terminated);
   }
 
   void visit (AST::IfExprConseqElse &expr) override
   {
-    translated = ASTLoweringIfBlock::translate (&expr, &terminated);
+    translated = ASTLoweringIfBlock::translate (expr, &terminated);
   }
 
   void visit (AST::IfLetExpr &expr) override
   {
-    translated = ASTLoweringIfLetBlock::translate (&expr);
+    translated = ASTLoweringIfLetBlock::translate (expr);
   }
 
   void visit (AST::IfLetExprConseqElse &expr) override
   {
-    translated = ASTLoweringIfLetBlock::translate (&expr);
+    translated = ASTLoweringIfLetBlock::translate (expr);
   }
 
   void visit (AST::BlockExpr &expr) override
   {
-    translated = ASTLoweringBlock::translate (&expr, &terminated);
+    translated = ASTLoweringBlock::translate (expr, &terminated);
   }
 
   void visit (AST::UnsafeBlockExpr &expr) override
   {
-    translated = ASTLoweringBlock::translate (&expr, &terminated);
+    translated = ASTLoweringBlock::translate (expr, &terminated);
   }
 
   void visit (AST::LoopExpr &expr) override
   {
     HIR::BlockExpr *loop_block
-      = ASTLoweringBlock::translate (expr.get_loop_block ().get (),
-				     &terminated);
+      = ASTLoweringBlock::translate (expr.get_loop_block (), &terminated);
 
     HIR::LoopLabel loop_label = lower_loop_label (expr.get_loop_label ());
 
diff --git a/gcc/rust/hir/rust-ast-lower-enumitem.h b/gcc/rust/hir/rust-ast-lower-enumitem.h
index d78d8b17a61..3cbf6e88661 100644
--- a/gcc/rust/hir/rust-ast-lower-enumitem.h
+++ b/gcc/rust/hir/rust-ast-lower-enumitem.h
@@ -83,8 +83,7 @@ public:
     for (auto &field : item.get_tuple_fields ())
       {
 	HIR::Visibility vis = translate_visibility (field.get_visibility ());
-	HIR::Type *type
-	  = ASTLoweringType::translate (field.get_field_type ().get ());
+	HIR::Type *type = ASTLoweringType::translate (field.get_field_type ());
 
 	auto crate_num = mappings->get_current_crate ();
 	Analysis::NodeMapping field_mapping (
@@ -121,8 +120,7 @@ public:
     for (auto &field : item.get_struct_fields ())
       {
 	HIR::Visibility vis = translate_visibility (field.get_visibility ());
-	HIR::Type *type
-	  = ASTLoweringType::translate (field.get_field_type ().get ());
+	HIR::Type *type = ASTLoweringType::translate (field.get_field_type ());
 
 	auto crate_num = mappings->get_current_crate ();
 	Analysis::NodeMapping field_mapping (
@@ -160,7 +158,7 @@ public:
 		     "visibility qualifier %qs not allowed on enum item",
 		     item.get_visibility ().as_string ().c_str ());
 
-    HIR::Expr *expr = ASTLoweringExpr::translate (item.get_expr ().get ());
+    HIR::Expr *expr = ASTLoweringExpr::translate (item.get_expr ());
     translated
       = new HIR::EnumItemDiscriminant (mapping, item.get_identifier (),
 				       std::unique_ptr<HIR::Expr> (expr),
diff --git a/gcc/rust/hir/rust-ast-lower-expr.cc b/gcc/rust/hir/rust-ast-lower-expr.cc
index ece15529b5f..6944db9b9cc 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.cc
+++ b/gcc/rust/hir/rust-ast-lower-expr.cc
@@ -35,20 +35,20 @@ ASTLoweringExpr::ASTLoweringExpr ()
 {}
 
 HIR::Expr *
-ASTLoweringExpr::translate (AST::Expr *expr, bool *terminated)
+ASTLoweringExpr::translate (AST::Expr &expr, bool *terminated)
 {
   ASTLoweringExpr resolver;
-  expr->accept_vis (resolver);
+  expr.accept_vis (resolver);
   if (resolver.translated == nullptr)
     {
-      rust_fatal_error (expr->get_locus (), "Failed to lower expr: [%s]",
-			expr->as_string ().c_str ());
+      rust_fatal_error (expr.get_locus (), "Failed to lower expr: [%s]",
+			expr.as_string ().c_str ());
       return nullptr;
     }
 
   resolver.mappings->insert_hir_expr (resolver.translated);
   resolver.mappings->insert_location (
-    resolver.translated->get_mappings ().get_hirid (), expr->get_locus ());
+    resolver.translated->get_mappings ().get_hirid (), expr.get_locus ());
 
   if (terminated != nullptr)
     *terminated = resolver.terminated;
@@ -60,7 +60,7 @@ void
 ASTLoweringExpr::visit (AST::TupleIndexExpr &expr)
 {
   HIR::Expr *tuple_expr
-    = ASTLoweringExpr::translate (expr.get_tuple_expr ().get (), &terminated);
+    = ASTLoweringExpr::translate (expr.get_tuple_expr (), &terminated);
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -79,7 +79,7 @@ ASTLoweringExpr::visit (AST::TupleExpr &expr)
   std::vector<std::unique_ptr<HIR::Expr> > tuple_elements;
   for (auto &e : expr.get_tuple_elems ())
     {
-      HIR::Expr *t = ASTLoweringExpr::translate (e.get ());
+      HIR::Expr *t = ASTLoweringExpr::translate (*e);
       tuple_elements.push_back (std::unique_ptr<HIR::Expr> (t));
     }
 
@@ -97,49 +97,49 @@ ASTLoweringExpr::visit (AST::TupleExpr &expr)
 void
 ASTLoweringExpr::visit (AST::IfExpr &expr)
 {
-  translated = ASTLoweringIfBlock::translate (&expr, &terminated);
+  translated = ASTLoweringIfBlock::translate (expr, &terminated);
 }
 
 void
 ASTLoweringExpr::visit (AST::IfExprConseqElse &expr)
 {
-  translated = ASTLoweringIfBlock::translate (&expr, &terminated);
+  translated = ASTLoweringIfBlock::translate (expr, &terminated);
 }
 
 void
 ASTLoweringExpr::visit (AST::IfLetExpr &expr)
 {
-  translated = ASTLoweringIfLetBlock::translate (&expr);
+  translated = ASTLoweringIfLetBlock::translate (expr);
 }
 
 void
 ASTLoweringExpr::visit (AST::IfLetExprConseqElse &expr)
 {
-  translated = ASTLoweringIfLetBlock::translate (&expr);
+  translated = ASTLoweringIfLetBlock::translate (expr);
 }
 
 void
 ASTLoweringExpr::visit (AST::BlockExpr &expr)
 {
-  translated = ASTLoweringBlock::translate (&expr, &terminated);
+  translated = ASTLoweringBlock::translate (expr, &terminated);
 }
 
 void
 ASTLoweringExpr::visit (AST::UnsafeBlockExpr &expr)
 {
-  translated = ASTLoweringBlock::translate (&expr, &terminated);
+  translated = ASTLoweringBlock::translate (expr, &terminated);
 }
 
 void
 ASTLoweringExpr::visit (AST::PathInExpression &expr)
 {
-  translated = ASTLowerPathInExpression::translate (&expr);
+  translated = ASTLowerPathInExpression::translate (expr);
 }
 
 void
 ASTLoweringExpr::visit (AST::QualifiedPathInExpression &expr)
 {
-  translated = ASTLowerQualPathInExpression::translate (&expr);
+  translated = ASTLowerQualPathInExpression::translate (expr);
 }
 
 void
@@ -148,7 +148,7 @@ ASTLoweringExpr::visit (AST::ReturnExpr &expr)
   terminated = true;
   HIR::Expr *return_expr
     = expr.has_returned_expr ()
-	? ASTLoweringExpr::translate (expr.get_returned_expr ().get ())
+	? ASTLoweringExpr::translate (expr.get_returned_expr ())
 	: nullptr;
 
   auto crate_num = mappings->get_current_crate ();
@@ -163,14 +163,13 @@ ASTLoweringExpr::visit (AST::ReturnExpr &expr)
 void
 ASTLoweringExpr::visit (AST::CallExpr &expr)
 {
-  HIR::Expr *func
-    = ASTLoweringExpr::translate (expr.get_function_expr ().get ());
+  HIR::Expr *func = ASTLoweringExpr::translate (expr.get_function_expr ());
 
   auto const &in_params = expr.get_params ();
   std::vector<std::unique_ptr<HIR::Expr> > params;
   for (auto &param : in_params)
     {
-      auto trans = ASTLoweringExpr::translate (param.get ());
+      auto trans = ASTLoweringExpr::translate (*param);
       params.push_back (std::unique_ptr<HIR::Expr> (trans));
     }
 
@@ -190,14 +189,13 @@ ASTLoweringExpr::visit (AST::MethodCallExpr &expr)
   HIR::PathExprSegment method_path
     = lower_path_expr_seg (expr.get_method_name ());
 
-  HIR::Expr *receiver
-    = ASTLoweringExpr::translate (expr.get_receiver_expr ().get ());
+  HIR::Expr *receiver = ASTLoweringExpr::translate (expr.get_receiver_expr ());
 
   auto const &in_params = expr.get_params ();
   std::vector<std::unique_ptr<HIR::Expr> > params;
   for (auto &param : in_params)
     {
-      auto trans = ASTLoweringExpr::translate (param.get ());
+      auto trans = ASTLoweringExpr::translate (*param);
       params.push_back (std::unique_ptr<HIR::Expr> (trans));
     }
 
@@ -215,8 +213,8 @@ ASTLoweringExpr::visit (AST::MethodCallExpr &expr)
 void
 ASTLoweringExpr::visit (AST::AssignmentExpr &expr)
 {
-  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ().get ());
-  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ().get ());
+  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ());
+  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -266,10 +264,9 @@ ASTLoweringExpr::visit (AST::ArrayExpr &expr)
 void
 ASTLoweringExpr::visit (AST::ArrayIndexExpr &expr)
 {
-  HIR::Expr *array_expr
-    = ASTLoweringExpr::translate (expr.get_array_expr ().get ());
+  HIR::Expr *array_expr = ASTLoweringExpr::translate (expr.get_array_expr ());
   HIR::Expr *array_index_expr
-    = ASTLoweringExpr::translate (expr.get_index_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_index_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -288,7 +285,7 @@ ASTLoweringExpr::visit (AST::ArrayElemsValues &elems)
   std::vector<std::unique_ptr<HIR::Expr> > elements;
   for (auto &elem : elems.get_values ())
     {
-      HIR::Expr *translated_elem = ASTLoweringExpr::translate (elem.get ());
+      HIR::Expr *translated_elem = ASTLoweringExpr::translate (*elem);
       elements.push_back (std::unique_ptr<HIR::Expr> (translated_elem));
     }
 
@@ -305,10 +302,8 @@ ASTLoweringExpr::visit (AST::ArrayElemsValues &elems)
 void
 ASTLoweringExpr::visit (AST::ArrayElemsCopied &elems)
 {
-  HIR::Expr *element
-    = ASTLoweringExpr::translate (elems.get_elem_to_copy ().get ());
-  HIR::Expr *num_copies
-    = ASTLoweringExpr::translate (elems.get_num_copies ().get ());
+  HIR::Expr *element = ASTLoweringExpr::translate (elems.get_elem_to_copy ());
+  HIR::Expr *num_copies = ASTLoweringExpr::translate (elems.get_num_copies ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (mappings->get_current_crate (),
@@ -337,9 +332,9 @@ ASTLoweringExpr::visit (AST::LiteralExpr &expr)
 void
 ASTLoweringExpr::visit (AST::ArithmeticOrLogicalExpr &expr)
 {
-  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ().get ());
+  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ());
   rust_assert (lhs != nullptr);
-  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ().get ());
+  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ());
   rust_assert (rhs != nullptr);
 
   auto crate_num = mappings->get_current_crate ();
@@ -355,9 +350,9 @@ ASTLoweringExpr::visit (AST::ArithmeticOrLogicalExpr &expr)
 void
 ASTLoweringExpr::visit (AST::ComparisonExpr &expr)
 {
-  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ().get ());
+  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ());
   rust_assert (lhs != nullptr);
-  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ().get ());
+  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ());
   rust_assert (rhs != nullptr);
 
   auto crate_num = mappings->get_current_crate ();
@@ -374,9 +369,9 @@ ASTLoweringExpr::visit (AST::ComparisonExpr &expr)
 void
 ASTLoweringExpr::visit (AST::LazyBooleanExpr &expr)
 {
-  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ().get ());
+  HIR::Expr *lhs = ASTLoweringExpr::translate (expr.get_left_expr ());
   rust_assert (lhs != nullptr);
-  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ().get ());
+  HIR::Expr *rhs = ASTLoweringExpr::translate (expr.get_right_expr ());
   rust_assert (rhs != nullptr);
 
   auto crate_num = mappings->get_current_crate ();
@@ -394,7 +389,7 @@ void
 ASTLoweringExpr::visit (AST::NegationExpr &expr)
 {
   HIR::Expr *negated_value
-    = ASTLoweringExpr::translate (expr.get_negated_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_negated_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -411,9 +406,9 @@ void
 ASTLoweringExpr::visit (AST::TypeCastExpr &expr)
 {
   HIR::Expr *expr_to_cast_to
-    = ASTLoweringExpr::translate (expr.get_casted_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_casted_expr ());
   HIR::Type *type_to_cast_to
-    = lower_type_no_bounds (expr.get_type_to_cast_to ().get ());
+    = lower_type_no_bounds (expr.get_type_to_cast_to ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -467,9 +462,8 @@ ASTLoweringExpr::visit (AST::CompoundAssignmentExpr &expr)
       rust_unreachable ();
     }
 
-  HIR::Expr *asignee_expr
-    = ASTLoweringExpr::translate (expr.get_left_expr ().get ());
-  HIR::Expr *value = ASTLoweringExpr::translate (expr.get_right_expr ().get ());
+  HIR::Expr *asignee_expr = ASTLoweringExpr::translate (expr.get_left_expr ());
+  HIR::Expr *value = ASTLoweringExpr::translate (expr.get_right_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -485,7 +479,7 @@ void
 ASTLoweringExpr::visit (AST::StructExprStruct &struct_expr)
 {
   HIR::PathInExpression *path
-    = ASTLowerPathInExpression::translate (&struct_expr.get_struct_name ());
+    = ASTLowerPathInExpression::translate (struct_expr.get_struct_name ());
   HIR::PathInExpression copied_path (*path);
   delete path;
 
@@ -505,7 +499,7 @@ ASTLoweringExpr::visit (AST::StructExprStructFields &struct_expr)
 {
   // bit of a hack for now
   HIR::PathInExpression *path
-    = ASTLowerPathInExpression::translate (&struct_expr.get_struct_name ());
+    = ASTLowerPathInExpression::translate (struct_expr.get_struct_name ());
   HIR::PathInExpression copied_path (*path);
   delete path;
 
@@ -513,7 +507,7 @@ ASTLoweringExpr::visit (AST::StructExprStructFields &struct_expr)
   if (struct_expr.has_struct_base ())
     {
       HIR::Expr *translated_base = ASTLoweringExpr::translate (
-	struct_expr.get_struct_base ().get_base_struct ().get ());
+	struct_expr.get_struct_base ().get_base_struct ());
       base = new HIR::StructBase (std::unique_ptr<HIR::Expr> (translated_base));
     }
 
@@ -522,7 +516,7 @@ ASTLoweringExpr::visit (AST::StructExprStructFields &struct_expr)
   for (auto &field : in_fields)
     {
       HIR::StructExprField *translated
-	= ASTLowerStructExprField::translate (field.get ());
+	= ASTLowerStructExprField::translate (*field);
       fields.push_back (std::unique_ptr<HIR::StructExprField> (translated));
     }
 
@@ -542,7 +536,7 @@ void
 ASTLoweringExpr::visit (AST::GroupedExpr &expr)
 {
   HIR::Expr *paren_expr
-    = ASTLoweringExpr::translate (expr.get_expr_in_parens ().get ());
+    = ASTLoweringExpr::translate (expr.get_expr_in_parens ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -558,8 +552,7 @@ ASTLoweringExpr::visit (AST::GroupedExpr &expr)
 void
 ASTLoweringExpr::visit (AST::FieldAccessExpr &expr)
 {
-  HIR::Expr *receiver
-    = ASTLoweringExpr::translate (expr.get_receiver_expr ().get ());
+  HIR::Expr *receiver = ASTLoweringExpr::translate (expr.get_receiver_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -574,19 +567,19 @@ ASTLoweringExpr::visit (AST::FieldAccessExpr &expr)
 void
 ASTLoweringExpr::visit (AST::LoopExpr &expr)
 {
-  translated = ASTLoweringExprWithBlock::translate (&expr, &terminated);
+  translated = ASTLoweringExprWithBlock::translate (expr, &terminated);
 }
 
 void
 ASTLoweringExpr::visit (AST::WhileLoopExpr &expr)
 {
-  translated = ASTLoweringExprWithBlock::translate (&expr, &terminated);
+  translated = ASTLoweringExprWithBlock::translate (expr, &terminated);
 }
 
 void
 ASTLoweringExpr::visit (AST::ForLoopExpr &expr)
 {
-  translated = ASTLoweringExprWithBlock::translate (&expr, &terminated);
+  translated = ASTLoweringExprWithBlock::translate (expr, &terminated);
 }
 
 void
@@ -596,7 +589,7 @@ ASTLoweringExpr::visit (AST::BreakExpr &expr)
     = lower_lifetime (expr.get_label ().get_lifetime ());
   HIR::Expr *break_expr
     = expr.has_break_expr ()
-	? ASTLoweringExpr::translate (expr.get_break_expr ().get ())
+	? ASTLoweringExpr::translate (expr.get_break_expr ())
 	: nullptr;
 
   auto crate_num = mappings->get_current_crate ();
@@ -629,7 +622,7 @@ void
 ASTLoweringExpr::visit (AST::BorrowExpr &expr)
 {
   HIR::Expr *borrow_lvalue
-    = ASTLoweringExpr::translate (expr.get_borrowed_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_borrowed_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -664,7 +657,7 @@ void
 ASTLoweringExpr::visit (AST::DereferenceExpr &expr)
 {
   HIR::Expr *dref_lvalue
-    = ASTLoweringExpr::translate (expr.get_dereferenced_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_dereferenced_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -681,7 +674,7 @@ void
 ASTLoweringExpr::visit (AST::ErrorPropagationExpr &expr)
 {
   HIR::Expr *propagating_expr
-    = ASTLoweringExpr::translate (expr.get_propagating_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_propagating_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -695,7 +688,7 @@ ASTLoweringExpr::visit (AST::ErrorPropagationExpr &expr)
 void
 ASTLoweringExpr::visit (AST::MatchExpr &expr)
 {
-  translated = ASTLoweringExprWithBlock::translate (&expr, &terminated);
+  translated = ASTLoweringExprWithBlock::translate (expr, &terminated);
 }
 
 void
@@ -706,9 +699,8 @@ ASTLoweringExpr::visit (AST::RangeFromToExpr &expr)
 				 mappings->get_next_hir_id (crate_num),
 				 UNKNOWN_LOCAL_DEFID);
 
-  HIR::Expr *range_from
-    = ASTLoweringExpr::translate (expr.get_from_expr ().get ());
-  HIR::Expr *range_to = ASTLoweringExpr::translate (expr.get_to_expr ().get ());
+  HIR::Expr *range_from = ASTLoweringExpr::translate (expr.get_from_expr ());
+  HIR::Expr *range_to = ASTLoweringExpr::translate (expr.get_to_expr ());
 
   translated
     = new HIR::RangeFromToExpr (mapping,
@@ -725,8 +717,7 @@ ASTLoweringExpr::visit (AST::RangeFromExpr &expr)
 				 mappings->get_next_hir_id (crate_num),
 				 UNKNOWN_LOCAL_DEFID);
 
-  HIR::Expr *range_from
-    = ASTLoweringExpr::translate (expr.get_from_expr ().get ());
+  HIR::Expr *range_from = ASTLoweringExpr::translate (expr.get_from_expr ());
 
   translated
     = new HIR::RangeFromExpr (mapping, std::unique_ptr<HIR::Expr> (range_from),
@@ -741,7 +732,7 @@ ASTLoweringExpr::visit (AST::RangeToExpr &expr)
 				 mappings->get_next_hir_id (crate_num),
 				 UNKNOWN_LOCAL_DEFID);
 
-  HIR::Expr *range_to = ASTLoweringExpr::translate (expr.get_to_expr ().get ());
+  HIR::Expr *range_to = ASTLoweringExpr::translate (expr.get_to_expr ());
 
   translated
     = new HIR::RangeToExpr (mapping, std::unique_ptr<HIR::Expr> (range_to),
@@ -767,9 +758,8 @@ ASTLoweringExpr::visit (AST::RangeFromToInclExpr &expr)
 				 mappings->get_next_hir_id (crate_num),
 				 UNKNOWN_LOCAL_DEFID);
 
-  HIR::Expr *range_from
-    = ASTLoweringExpr::translate (expr.get_from_expr ().get ());
-  HIR::Expr *range_to = ASTLoweringExpr::translate (expr.get_to_expr ().get ());
+  HIR::Expr *range_from = ASTLoweringExpr::translate (expr.get_from_expr ());
+  HIR::Expr *range_to = ASTLoweringExpr::translate (expr.get_to_expr ());
 
   translated
     = new HIR::RangeFromToInclExpr (mapping,
@@ -782,7 +772,7 @@ void
 ASTLoweringExpr::visit (AST::ClosureExprInner &expr)
 {
   HIR::Expr *closure_expr
-    = ASTLoweringExpr::translate (expr.get_definition_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_definition_expr ());
 
   std::vector<HIR::ClosureParam> closure_params;
   for (auto &param : expr.get_params ())
@@ -809,7 +799,7 @@ ASTLoweringExpr::visit (AST::ClosureExprInnerTyped &expr)
 {
   HIR::Type *closure_return_type = nullptr;
   HIR::Expr *closure_expr
-    = ASTLoweringExpr::translate (expr.get_definition_block ().get ());
+    = ASTLoweringExpr::translate (expr.get_definition_block ());
 
   std::vector<HIR::ClosureParam> closure_params;
   for (auto &param : expr.get_params ())
diff --git a/gcc/rust/hir/rust-ast-lower-expr.h b/gcc/rust/hir/rust-ast-lower-expr.h
index 168dd014002..ab3ae0a8b5f 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.h
+++ b/gcc/rust/hir/rust-ast-lower-expr.h
@@ -30,10 +30,10 @@ class ASTLowerPathInExpression : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::PathInExpression *translate (AST::PathInExpression *expr)
+  static HIR::PathInExpression *translate (AST::PathInExpression &expr)
   {
     ASTLowerPathInExpression compiler;
-    expr->accept_vis (compiler);
+    expr.accept_vis (compiler);
     rust_assert (compiler.translated);
     return compiler.translated;
   }
@@ -52,10 +52,10 @@ class ASTLowerQualPathInExpression : public ASTLoweringBase
 
 public:
   static HIR::QualifiedPathInExpression *
-  translate (AST::QualifiedPathInExpression *expr)
+  translate (AST::QualifiedPathInExpression &expr)
   {
     ASTLowerQualPathInExpression compiler;
-    expr->accept_vis (compiler);
+    expr.accept_vis (compiler);
     rust_assert (compiler.translated);
     return compiler.translated;
   }
@@ -73,7 +73,7 @@ class ASTLoweringExpr : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::Expr *translate (AST::Expr *expr, bool *terminated = nullptr);
+  static HIR::Expr *translate (AST::Expr &expr, bool *terminated = nullptr);
 
   void visit (AST::TupleIndexExpr &expr) override;
   void visit (AST::TupleExpr &expr) override;
diff --git a/gcc/rust/hir/rust-ast-lower-extern.h b/gcc/rust/hir/rust-ast-lower-extern.h
index ad7d75422d6..e92acdc44a1 100644
--- a/gcc/rust/hir/rust-ast-lower-extern.h
+++ b/gcc/rust/hir/rust-ast-lower-extern.h
@@ -51,8 +51,7 @@ public:
   void visit (AST::ExternalStaticItem &item) override
   {
     HIR::Visibility vis = translate_visibility (item.get_visibility ());
-    HIR::Type *static_type
-      = ASTLoweringType::translate (item.get_type ().get ());
+    HIR::Type *static_type = ASTLoweringType::translate (item.get_type ());
 
     auto crate_num = mappings->get_current_crate ();
     Analysis::NodeMapping mapping (crate_num, item.get_node_id (),
@@ -77,7 +76,7 @@ public:
 
     HIR::Type *return_type
       = function.has_return_type ()
-	  ? ASTLoweringType::translate (function.get_return_type ().get ())
+	  ? ASTLoweringType::translate (function.get_return_type ())
 	  : nullptr;
 
     bool is_variadic = function.is_variadic ();
@@ -88,25 +87,24 @@ public:
     std::vector<HIR::NamedFunctionParam> function_params;
     for (auto it = begin; it != end; it++)
       {
-	auto param = static_cast<AST::FunctionParam *> (it->get ());
+	auto &param = static_cast<AST::FunctionParam &> (**it);
 
-	if (param->is_variadic () || param->is_self ())
+	if (param.is_variadic () || param.is_self ())
 	  continue;
-	auto param_kind = param->get_pattern ()->get_pattern_kind ();
+	auto param_kind = param.get_pattern ().get_pattern_kind ();
 
 	rust_assert (param_kind == AST::Pattern::Kind::Identifier
 		     || param_kind == AST::Pattern::Kind::Wildcard);
-	auto param_ident = static_cast<AST::IdentifierPattern *> (
-	  param->get_pattern ().get ());
+	auto &param_ident
+	  = static_cast<AST::IdentifierPattern &> (param.get_pattern ());
 	Identifier param_name = param_kind == AST::Pattern::Kind::Identifier
-				  ? param_ident->get_ident ()
+				  ? param_ident.get_ident ()
 				  : std::string ("_");
 
-	HIR::Type *param_type
-	  = ASTLoweringType::translate (param->get_type ().get ());
+	HIR::Type *param_type = ASTLoweringType::translate (param.get_type ());
 
 	auto crate_num = mappings->get_current_crate ();
-	Analysis::NodeMapping mapping (crate_num, param->get_node_id (),
+	Analysis::NodeMapping mapping (crate_num, param.get_node_id (),
 				       mappings->get_next_hir_id (crate_num),
 				       mappings->get_next_localdef_id (
 					 crate_num));
diff --git a/gcc/rust/hir/rust-ast-lower-implitem.cc b/gcc/rust/hir/rust-ast-lower-implitem.cc
index 38bac5de703..41761bbce32 100644
--- a/gcc/rust/hir/rust-ast-lower-implitem.cc
+++ b/gcc/rust/hir/rust-ast-lower-implitem.cc
@@ -28,10 +28,10 @@ namespace Rust {
 namespace HIR {
 
 HIR::ImplItem *
-ASTLowerImplItem::translate (AST::AssociatedItem *item, HirId parent_impl_id)
+ASTLowerImplItem::translate (AST::AssociatedItem &item, HirId parent_impl_id)
 {
   ASTLowerImplItem resolver;
-  item->accept_vis (resolver);
+  item.accept_vis (resolver);
 
   if (resolver.translated != nullptr)
     {
@@ -63,7 +63,7 @@ ASTLowerImplItem::visit (AST::TypeAlias &alias)
     generic_params = lower_generic_params (alias.get_generic_params ());
 
   HIR::Type *existing_type
-    = ASTLoweringType::translate (alias.get_type_aliased ().get ());
+    = ASTLoweringType::translate (alias.get_type_aliased ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, alias.get_node_id (),
@@ -86,9 +86,8 @@ ASTLowerImplItem::visit (AST::ConstantItem &constant)
 {
   HIR::Visibility vis = translate_visibility (constant.get_visibility ());
 
-  HIR::Type *type
-    = ASTLoweringType::translate (constant.get_type ().get (), true);
-  HIR::Expr *expr = ASTLoweringExpr::translate (constant.get_expr ().get ());
+  HIR::Type *type = ASTLoweringType::translate (constant.get_type (), true);
+  HIR::Expr *expr = ASTLoweringExpr::translate (constant.get_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, constant.get_node_id (),
@@ -138,7 +137,7 @@ ASTLowerImplItem::visit (AST::Function &function)
 
   std::unique_ptr<HIR::Type> return_type
     = function.has_return_type () ? std::unique_ptr<HIR::Type> (
-	ASTLoweringType::translate (function.get_return_type ().get ()))
+	ASTLoweringType::translate (function.get_return_type ()))
 				  : nullptr;
 
   std::vector<HIR::FunctionParam> function_params;
@@ -146,28 +145,28 @@ ASTLowerImplItem::visit (AST::Function &function)
     {
       if (p->is_self () || p->is_variadic ())
 	continue;
-      auto param = static_cast<AST::FunctionParam *> (p.get ());
+      auto param = static_cast<AST::FunctionParam &> (*p);
 
       auto translated_pattern = std::unique_ptr<HIR::Pattern> (
-	ASTLoweringPattern::translate (param->get_pattern ().get ()));
+	ASTLoweringPattern::translate (param.get_pattern ()));
       auto translated_type = std::unique_ptr<HIR::Type> (
-	ASTLoweringType::translate (param->get_type ().get ()));
+	ASTLoweringType::translate (param.get_type ()));
 
       auto crate_num = mappings->get_current_crate ();
-      Analysis::NodeMapping mapping (crate_num, param->get_node_id (),
+      Analysis::NodeMapping mapping (crate_num, param.get_node_id (),
 				     mappings->get_next_hir_id (crate_num),
 				     UNKNOWN_LOCAL_DEFID);
 
       auto hir_param
 	= HIR::FunctionParam (mapping, std::move (translated_pattern),
-			      std::move (translated_type), param->get_locus ());
+			      std::move (translated_type), param.get_locus ());
       function_params.push_back (std::move (hir_param));
     }
 
   bool terminated = false;
   std::unique_ptr<HIR::BlockExpr> function_body
     = std::unique_ptr<HIR::BlockExpr> (
-      ASTLoweringBlock::translate (function.get_definition ()->get (),
+      ASTLoweringBlock::translate (*function.get_definition ().value (),
 				   &terminated));
 
   auto crate_num = mappings->get_current_crate ();
@@ -207,10 +206,10 @@ ASTLowerImplItem::visit (AST::Function &function)
 }
 
 HIR::TraitItem *
-ASTLowerTraitItem::translate (AST::AssociatedItem *item)
+ASTLowerTraitItem::translate (AST::AssociatedItem &item)
 {
   ASTLowerTraitItem resolver;
-  item->accept_vis (resolver);
+  item.accept_vis (resolver);
 
   if (resolver.translated != nullptr)
     {
@@ -241,7 +240,7 @@ ASTLowerTraitItem::visit (AST::Function &func)
 
   std::unique_ptr<HIR::Type> return_type
     = func.has_return_type () ? std::unique_ptr<HIR::Type> (
-	ASTLoweringType::translate (func.get_return_type ().get ()))
+	ASTLoweringType::translate (func.get_return_type ()))
 			      : nullptr;
 
   // set self parameter to error if this is a method
@@ -256,21 +255,21 @@ ASTLowerTraitItem::visit (AST::Function &func)
       if (p->is_variadic () || p->is_self ())
 	continue;
 
-      auto param = static_cast<AST::FunctionParam *> (p.get ());
+      auto param = static_cast<AST::FunctionParam &> (*p);
 
       auto translated_pattern = std::unique_ptr<HIR::Pattern> (
-	ASTLoweringPattern::translate (param->get_pattern ().get ()));
+	ASTLoweringPattern::translate (param.get_pattern ()));
       auto translated_type = std::unique_ptr<HIR::Type> (
-	ASTLoweringType::translate (param->get_type ().get ()));
+	ASTLoweringType::translate (param.get_type ()));
 
       auto crate_num = mappings->get_current_crate ();
-      Analysis::NodeMapping mapping (crate_num, param->get_node_id (),
+      Analysis::NodeMapping mapping (crate_num, param.get_node_id (),
 				     mappings->get_next_hir_id (crate_num),
 				     UNKNOWN_LOCAL_DEFID);
 
       auto hir_param
 	= HIR::FunctionParam (mapping, std::move (translated_pattern),
-			      std::move (translated_type), param->get_locus ());
+			      std::move (translated_type), param.get_locus ());
       function_params.push_back (hir_param);
     }
 
@@ -284,7 +283,7 @@ ASTLowerTraitItem::visit (AST::Function &func)
   bool terminated = false;
   std::unique_ptr<HIR::BlockExpr> block_expr
     = func.has_body () ? std::unique_ptr<HIR::BlockExpr> (
-	ASTLoweringBlock::translate (func.get_definition ()->get (),
+	ASTLoweringBlock::translate (*func.get_definition ().value (),
 				     &terminated))
 		       : nullptr;
 
@@ -316,9 +315,9 @@ ASTLowerTraitItem::visit (AST::Function &func)
 void
 ASTLowerTraitItem::visit (AST::TraitItemConst &constant)
 {
-  HIR::Type *type = ASTLoweringType::translate (constant.get_type ().get ());
+  HIR::Type *type = ASTLoweringType::translate (constant.get_type ());
   HIR::Expr *expr = constant.has_expression ()
-		      ? ASTLoweringExpr::translate (constant.get_expr ().get ())
+		      ? ASTLoweringExpr::translate (constant.get_expr ())
 		      : nullptr;
 
   auto crate_num = mappings->get_current_crate ();
diff --git a/gcc/rust/hir/rust-ast-lower-implitem.h b/gcc/rust/hir/rust-ast-lower-implitem.h
index bbde9f6878c..bd511b7d1d5 100644
--- a/gcc/rust/hir/rust-ast-lower-implitem.h
+++ b/gcc/rust/hir/rust-ast-lower-implitem.h
@@ -29,7 +29,7 @@ class ASTLowerImplItem : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::ImplItem *translate (AST::AssociatedItem *item,
+  static HIR::ImplItem *translate (AST::AssociatedItem &item,
 				   HirId parent_impl_id);
   void visit (AST::TypeAlias &alias) override;
   void visit (AST::ConstantItem &constant) override;
@@ -47,7 +47,7 @@ class ASTLowerTraitItem : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::TraitItem *translate (AST::AssociatedItem *item);
+  static HIR::TraitItem *translate (AST::AssociatedItem &item);
   void visit (AST::Function &func) override;
   void visit (AST::TraitItemConst &constant) override;
   void visit (AST::TraitItemType &type) override;
diff --git a/gcc/rust/hir/rust-ast-lower-item.cc b/gcc/rust/hir/rust-ast-lower-item.cc
index 7ef556fee0d..bfcdb986527 100644
--- a/gcc/rust/hir/rust-ast-lower-item.cc
+++ b/gcc/rust/hir/rust-ast-lower-item.cc
@@ -32,10 +32,10 @@ namespace Rust {
 namespace HIR {
 
 HIR::Item *
-ASTLoweringItem::translate (AST::Item *item)
+ASTLoweringItem::translate (AST::Item &item)
 {
   ASTLoweringItem resolver;
-  item->accept_vis (resolver);
+  item.accept_vis (resolver);
 
   if (resolver.translated != nullptr)
     {
@@ -44,7 +44,7 @@ ASTLoweringItem::translate (AST::Item *item)
       auto locus = resolver.translated->get_locus ();
 
       resolver.handle_outer_attributes (*resolver.translated);
-      resolver.mappings->insert_ast_item (item);
+      resolver.mappings->insert_ast_item (&item);
       resolver.mappings->insert_hir_item (resolver.translated);
       resolver.mappings->insert_location (id, locus);
       resolver.mappings->insert_defid_mapping (defid, resolver.translated);
@@ -68,7 +68,7 @@ ASTLoweringItem::visit (AST::Module &module)
 
   for (auto &item : module.get_items ())
     {
-      auto transitem = translate (item.get ());
+      auto transitem = translate (*item);
       // The item may be null if it doesn't need to live in the HIR - for
       // example, macro rules definitions
       if (transitem)
@@ -105,7 +105,7 @@ ASTLoweringItem::visit (AST::TypeAlias &alias)
     generic_params = lower_generic_params (alias.get_generic_params ());
 
   HIR::Type *existing_type
-    = ASTLoweringType::translate (alias.get_type_aliased ().get ());
+    = ASTLoweringType::translate (alias.get_type_aliased ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, alias.get_node_id (),
@@ -143,13 +143,12 @@ ASTLoweringItem::visit (AST::TupleStruct &struct_decl)
   std::vector<HIR::TupleField> fields;
   for (AST::TupleField &field : struct_decl.get_fields ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
       // FIXME: How do we get the visibility from here?
       HIR::Visibility vis = translate_visibility (field.get_visibility ());
-      HIR::Type *type
-	= ASTLoweringType::translate (field.get_field_type ().get ());
+      HIR::Type *type = ASTLoweringType::translate (field.get_field_type ());
 
       auto crate_num = mappings->get_current_crate ();
       Analysis::NodeMapping mapping (crate_num, field.get_node_id (),
@@ -202,12 +201,11 @@ ASTLoweringItem::visit (AST::StructStruct &struct_decl)
   std::vector<HIR::StructField> fields;
   for (AST::StructField &field : struct_decl.get_fields ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
       HIR::Visibility vis = translate_visibility (field.get_visibility ());
-      HIR::Type *type
-	= ASTLoweringType::translate (field.get_field_type ().get ());
+      HIR::Type *type = ASTLoweringType::translate (field.get_field_type ());
 
       auto crate_num = mappings->get_current_crate ();
       Analysis::NodeMapping mapping (crate_num, field.get_node_id (),
@@ -309,13 +307,12 @@ ASTLoweringItem::visit (AST::Union &union_decl)
   std::vector<HIR::StructField> variants;
   for (AST::StructField &variant : union_decl.get_variants ())
     {
-      if (variant.get_field_type ()->is_marked_for_strip ())
+      if (variant.get_field_type ().is_marked_for_strip ())
 	continue;
 
       // FIXME: Does visibility apply here?
       HIR::Visibility vis = translate_visibility (variant.get_visibility ());
-      HIR::Type *type
-	= ASTLoweringType::translate (variant.get_field_type ().get ());
+      HIR::Type *type = ASTLoweringType::translate (variant.get_field_type ());
 
       auto crate_num = mappings->get_current_crate ();
       Analysis::NodeMapping mapping (crate_num, variant.get_node_id (),
@@ -351,8 +348,8 @@ ASTLoweringItem::visit (AST::StaticItem &var)
 {
   HIR::Visibility vis = translate_visibility (var.get_visibility ());
 
-  HIR::Type *type = ASTLoweringType::translate (var.get_type ().get (), true);
-  HIR::Expr *expr = ASTLoweringExpr::translate (var.get_expr ().get ());
+  HIR::Type *type = ASTLoweringType::translate (var.get_type (), true);
+  HIR::Expr *expr = ASTLoweringExpr::translate (var.get_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, var.get_node_id (),
@@ -372,9 +369,8 @@ ASTLoweringItem::visit (AST::ConstantItem &constant)
 {
   HIR::Visibility vis = translate_visibility (constant.get_visibility ());
 
-  HIR::Type *type
-    = ASTLoweringType::translate (constant.get_type ().get (), true);
-  HIR::Expr *expr = ASTLoweringExpr::translate (constant.get_expr ().get ());
+  HIR::Type *type = ASTLoweringType::translate (constant.get_type (), true);
+  HIR::Expr *expr = ASTLoweringExpr::translate (constant.get_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, constant.get_node_id (),
@@ -418,7 +414,7 @@ ASTLoweringItem::visit (AST::Function &function)
 
   std::unique_ptr<HIR::Type> return_type
     = function.has_return_type () ? std::unique_ptr<HIR::Type> (
-	ASTLoweringType::translate (function.get_return_type ().get ()))
+	ASTLoweringType::translate (function.get_return_type ()))
 				  : nullptr;
 
   std::vector<HIR::FunctionParam> function_params;
@@ -426,28 +422,28 @@ ASTLoweringItem::visit (AST::Function &function)
     {
       if (p->is_variadic () || p->is_self ())
 	continue;
-      auto param = static_cast<AST::FunctionParam *> (p.get ());
+      auto param = static_cast<AST::FunctionParam &> (*p);
 
       auto translated_pattern = std::unique_ptr<HIR::Pattern> (
-	ASTLoweringPattern::translate (param->get_pattern ().get ()));
+	ASTLoweringPattern::translate (param.get_pattern ()));
       auto translated_type = std::unique_ptr<HIR::Type> (
-	ASTLoweringType::translate (param->get_type ().get ()));
+	ASTLoweringType::translate (param.get_type ()));
 
       auto crate_num = mappings->get_current_crate ();
-      Analysis::NodeMapping mapping (crate_num, param->get_node_id (),
+      Analysis::NodeMapping mapping (crate_num, param.get_node_id (),
 				     mappings->get_next_hir_id (crate_num),
 				     UNKNOWN_LOCAL_DEFID);
 
       auto hir_param
 	= HIR::FunctionParam (mapping, std::move (translated_pattern),
-			      std::move (translated_type), param->get_locus ());
+			      std::move (translated_type), param.get_locus ());
       function_params.push_back (std::move (hir_param));
     }
 
   bool terminated = false;
   std::unique_ptr<HIR::BlockExpr> function_body
     = std::unique_ptr<HIR::BlockExpr> (
-      ASTLoweringBlock::translate (function.get_definition ()->get (),
+      ASTLoweringBlock::translate (*function.get_definition ().value (),
 				   &terminated));
 
   auto crate_num = mappings->get_current_crate ();
@@ -482,8 +478,7 @@ ASTLoweringItem::visit (AST::InherentImpl &impl_block)
   std::vector<std::unique_ptr<HIR::WhereClauseItem>> where_clause_items;
   for (auto &item : impl_block.get_where_clause ().get_items ())
     {
-      HIR::WhereClauseItem *i
-	= ASTLowerWhereClauseItem::translate (*item.get ());
+      HIR::WhereClauseItem *i = ASTLowerWhereClauseItem::translate (*item);
       where_clause_items.push_back (std::unique_ptr<HIR::WhereClauseItem> (i));
     }
 
@@ -524,8 +519,7 @@ ASTLoweringItem::visit (AST::InherentImpl &impl_block)
 	}
     }
 
-  HIR::Type *impl_type
-    = ASTLoweringType::translate (impl_block.get_type ().get ());
+  HIR::Type *impl_type = ASTLoweringType::translate (impl_block.get_type ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, impl_block.get_node_id (),
@@ -540,7 +534,7 @@ ASTLoweringItem::visit (AST::InherentImpl &impl_block)
 	continue;
 
       HIR::ImplItem *lowered
-	= ASTLowerImplItem::translate (impl_item.get (), mapping.get_hirid ());
+	= ASTLowerImplItem::translate (*impl_item, mapping.get_hirid ());
       rust_assert (lowered != nullptr);
       impl_items.push_back (std::unique_ptr<HIR::ImplItem> (lowered));
       impl_item_ids.push_back (lowered->get_impl_mappings ().get_hirid ());
@@ -586,7 +580,7 @@ ASTLoweringItem::visit (AST::Trait &trait)
     {
       for (auto &bound : trait.get_type_param_bounds ())
 	{
-	  HIR::TypeParamBound *b = lower_bound (bound.get ());
+	  HIR::TypeParamBound *b = lower_bound (*bound);
 	  type_param_bounds.push_back (
 	    std::unique_ptr<HIR::TypeParamBound> (b));
 	}
@@ -599,7 +593,7 @@ ASTLoweringItem::visit (AST::Trait &trait)
       if (item->is_marked_for_strip ())
 	continue;
 
-      HIR::TraitItem *lowered = ASTLowerTraitItem::translate (item.get ());
+      HIR::TraitItem *lowered = ASTLowerTraitItem::translate (*item);
       trait_items.push_back (std::unique_ptr<HIR::TraitItem> (lowered));
       trait_item_ids.push_back (lowered->get_mappings ().get_hirid ());
     }
@@ -634,8 +628,7 @@ ASTLoweringItem::visit (AST::TraitImpl &impl_block)
   std::vector<std::unique_ptr<HIR::WhereClauseItem>> where_clause_items;
   for (auto &item : impl_block.get_where_clause ().get_items ())
     {
-      HIR::WhereClauseItem *i
-	= ASTLowerWhereClauseItem::translate (*item.get ());
+      HIR::WhereClauseItem *i = ASTLowerWhereClauseItem::translate (*item);
       where_clause_items.push_back (std::unique_ptr<HIR::WhereClauseItem> (i));
     }
   HIR::WhereClause where_clause (std::move (where_clause_items));
@@ -675,8 +668,7 @@ ASTLoweringItem::visit (AST::TraitImpl &impl_block)
 	}
     }
 
-  HIR::Type *impl_type
-    = ASTLoweringType::translate (impl_block.get_type ().get ());
+  HIR::Type *impl_type = ASTLoweringType::translate (impl_block.get_type ());
   HIR::TypePath *trait_ref
     = ASTLowerTypePath::translate (impl_block.get_trait_path ());
 
@@ -693,7 +685,7 @@ ASTLoweringItem::visit (AST::TraitImpl &impl_block)
 	continue;
 
       HIR::ImplItem *lowered
-	= ASTLowerImplItem::translate (impl_item.get (), mapping.get_hirid ());
+	= ASTLowerImplItem::translate (*impl_item, mapping.get_hirid ());
       rust_assert (lowered != nullptr);
       impl_items.push_back (std::unique_ptr<HIR::ImplItem> (lowered));
       impl_item_ids.push_back (lowered->get_impl_mappings ().get_hirid ());
diff --git a/gcc/rust/hir/rust-ast-lower-item.h b/gcc/rust/hir/rust-ast-lower-item.h
index 0b66084cf4d..522d38f2f2e 100644
--- a/gcc/rust/hir/rust-ast-lower-item.h
+++ b/gcc/rust/hir/rust-ast-lower-item.h
@@ -29,7 +29,7 @@ class ASTLoweringItem : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::Item *translate (AST::Item *item);
+  static HIR::Item *translate (AST::Item &item);
 
   void visit (AST::Module &module) override;
   void visit (AST::TypeAlias &alias) override;
diff --git a/gcc/rust/hir/rust-ast-lower-pattern.cc b/gcc/rust/hir/rust-ast-lower-pattern.cc
index d534b829517..96266dc0c60 100644
--- a/gcc/rust/hir/rust-ast-lower-pattern.cc
+++ b/gcc/rust/hir/rust-ast-lower-pattern.cc
@@ -25,17 +25,17 @@ namespace HIR {
 ASTLoweringPattern::ASTLoweringPattern () : translated (nullptr) {}
 
 HIR::Pattern *
-ASTLoweringPattern::translate (AST::Pattern *pattern, bool is_let_top_level)
+ASTLoweringPattern::translate (AST::Pattern &pattern, bool is_let_top_level)
 {
   ASTLoweringPattern resolver;
   resolver.is_let_top_level = is_let_top_level;
-  pattern->accept_vis (resolver);
+  pattern.accept_vis (resolver);
 
   rust_assert (resolver.translated != nullptr);
 
   resolver.mappings->insert_hir_pattern (resolver.translated);
   resolver.mappings->insert_location (
-    resolver.translated->get_mappings ().get_hirid (), pattern->get_locus ());
+    resolver.translated->get_mappings ().get_hirid (), pattern.get_locus ());
 
   return resolver.translated;
 }
@@ -60,18 +60,18 @@ ASTLoweringPattern::visit (AST::IdentifierPattern &pattern)
 void
 ASTLoweringPattern::visit (AST::PathInExpression &pattern)
 {
-  translated = ASTLowerPathInExpression::translate (&pattern);
+  translated = ASTLowerPathInExpression::translate (pattern);
 }
 
 void
 ASTLoweringPattern::visit (AST::TupleStructPattern &pattern)
 {
   HIR::PathInExpression *path
-    = ASTLowerPathInExpression::translate (&pattern.get_path ());
+    = ASTLowerPathInExpression::translate (pattern.get_path ());
 
   TupleStructItems *lowered = nullptr;
   auto &items = pattern.get_items ();
-  switch (items->get_item_type ())
+  switch (items.get_item_type ())
     {
       case AST::TupleStructItems::RANGE: {
 	// TODO
@@ -81,13 +81,12 @@ ASTLoweringPattern::visit (AST::TupleStructPattern &pattern)
 
       case AST::TupleStructItems::NO_RANGE: {
 	AST::TupleStructItemsNoRange &items_no_range
-	  = static_cast<AST::TupleStructItemsNoRange &> (*items.get ());
+	  = static_cast<AST::TupleStructItemsNoRange &> (items);
 
 	std::vector<std::unique_ptr<HIR::Pattern>> patterns;
 	for (auto &inner_pattern : items_no_range.get_patterns ())
 	  {
-	    HIR::Pattern *p
-	      = ASTLoweringPattern::translate (inner_pattern.get ());
+	    HIR::Pattern *p = ASTLoweringPattern::translate (*inner_pattern);
 	    patterns.push_back (std::unique_ptr<HIR::Pattern> (p));
 	  }
 
@@ -109,7 +108,7 @@ void
 ASTLoweringPattern::visit (AST::StructPattern &pattern)
 {
   HIR::PathInExpression *path
-    = ASTLowerPathInExpression::translate (&pattern.get_path ());
+    = ASTLowerPathInExpression::translate (pattern.get_path ());
 
   auto &raw_elems = pattern.get_struct_pattern_elems ();
   rust_assert (!raw_elems.has_etc ());
@@ -121,7 +120,7 @@ ASTLoweringPattern::visit (AST::StructPattern &pattern)
       switch (field->get_item_type ())
 	{
 	  case AST::StructPatternField::ItemType::TUPLE_PAT: {
-	    AST::StructPatternFieldTuplePat &tuple
+	    auto &tuple
 	      = static_cast<AST::StructPatternFieldTuplePat &> (*field);
 
 	    auto crate_num = mappings->get_current_crate ();
@@ -130,8 +129,8 @@ ASTLoweringPattern::visit (AST::StructPattern &pattern)
 					     crate_num),
 					   UNKNOWN_LOCAL_DEFID);
 
-	    std::unique_ptr<HIR::Pattern> pat (ASTLoweringPattern::translate (
-	      tuple.get_index_pattern ().get ()));
+	    std::unique_ptr<HIR::Pattern> pat (
+	      ASTLoweringPattern::translate (tuple.get_index_pattern ()));
 
 	    f = new HIR::StructPatternFieldTuplePat (mapping,
 						     tuple.get_index (),
@@ -151,8 +150,8 @@ ASTLoweringPattern::visit (AST::StructPattern &pattern)
 					     crate_num),
 					   UNKNOWN_LOCAL_DEFID);
 
-	    std::unique_ptr<HIR::Pattern> pat (ASTLoweringPattern::translate (
-	      ident.get_ident_pattern ().get ()));
+	    std::unique_ptr<HIR::Pattern> pat (
+	      ASTLoweringPattern::translate (ident.get_ident_pattern ()));
 
 	    f = new HIR::StructPatternFieldIdentPat (mapping,
 						     ident.get_identifier (),
@@ -214,20 +213,19 @@ void
 ASTLoweringPattern::visit (AST::TuplePattern &pattern)
 {
   std::unique_ptr<HIR::TuplePatternItems> items;
-  switch (pattern.get_items ()->get_pattern_type ())
+  switch (pattern.get_items ().get_pattern_type ())
     {
       case AST::TuplePatternItems::TuplePatternItemType::MULTIPLE: {
 	AST::TuplePatternItemsMultiple &ref
-	  = *static_cast<AST::TuplePatternItemsMultiple *> (
-	    pattern.get_items ().get ());
+	  = static_cast<AST::TuplePatternItemsMultiple &> (
+	    pattern.get_items ());
 	items = lower_tuple_pattern_multiple (ref);
       }
       break;
 
       case AST::TuplePatternItems::TuplePatternItemType::RANGED: {
 	AST::TuplePatternItemsRanged &ref
-	  = *static_cast<AST::TuplePatternItemsRanged *> (
-	    pattern.get_items ().get ());
+	  = static_cast<AST::TuplePatternItemsRanged &> (pattern.get_items ());
 	items = lower_tuple_pattern_ranged (ref);
       }
       break;
@@ -258,10 +256,8 @@ ASTLoweringPattern::visit (AST::LiteralPattern &pattern)
 void
 ASTLoweringPattern::visit (AST::RangePattern &pattern)
 {
-  auto upper_bound
-    = lower_range_pattern_bound (pattern.get_upper_bound ().get ());
-  auto lower_bound
-    = lower_range_pattern_bound (pattern.get_lower_bound ().get ());
+  auto upper_bound = lower_range_pattern_bound (pattern.get_upper_bound ());
+  auto lower_bound = lower_range_pattern_bound (pattern.get_lower_bound ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, pattern.get_node_id (),
@@ -277,7 +273,7 @@ void
 ASTLoweringPattern::visit (AST::GroupedPattern &pattern)
 {
   is_let_top_level = false;
-  pattern.get_pattern_in_parens ()->accept_vis (*this);
+  pattern.get_pattern_in_parens ().accept_vis (*this);
 }
 
 void
@@ -289,7 +285,7 @@ ASTLoweringPattern::visit (AST::ReferencePattern &pattern)
 				 UNKNOWN_LOCAL_DEFID);
 
   HIR::Pattern *inner
-    = ASTLoweringPattern::translate (pattern.get_referenced_pattern ().get ());
+    = ASTLoweringPattern::translate (pattern.get_referenced_pattern ());
 
   translated
     = new HIR::ReferencePattern (mapping, std::unique_ptr<HIR::Pattern> (inner),
@@ -315,7 +311,7 @@ ASTLoweringPattern::visit (AST::SlicePattern &pattern)
   std::vector<std::unique_ptr<HIR::Pattern>> items;
   for (auto &p : pattern.get_items ())
     {
-      HIR::Pattern *item = ASTLoweringPattern::translate (p.get ());
+      HIR::Pattern *item = ASTLoweringPattern::translate (*p);
       items.push_back (std::unique_ptr<HIR::Pattern> (item));
     }
 
@@ -340,8 +336,8 @@ ASTLoweringPattern::visit (AST::AltPattern &pattern)
 
   for (auto &alt : pattern.get_alts ())
     {
-      alts.push_back (std::unique_ptr<HIR::Pattern> (
-	ASTLoweringPattern::translate (alt.get ())));
+      alts.push_back (
+	std::unique_ptr<HIR::Pattern> (ASTLoweringPattern::translate (*alt)));
     }
 
   translated
diff --git a/gcc/rust/hir/rust-ast-lower-pattern.h b/gcc/rust/hir/rust-ast-lower-pattern.h
index 155308ef385..f750108894e 100644
--- a/gcc/rust/hir/rust-ast-lower-pattern.h
+++ b/gcc/rust/hir/rust-ast-lower-pattern.h
@@ -29,7 +29,7 @@ class ASTLoweringPattern : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::Pattern *translate (AST::Pattern *pattern,
+  static HIR::Pattern *translate (AST::Pattern &pattern,
 				  bool is_let_top_level = false);
 
   void visit (AST::IdentifierPattern &pattern) override;
diff --git a/gcc/rust/hir/rust-ast-lower-stmt.cc b/gcc/rust/hir/rust-ast-lower-stmt.cc
index 6bd1a241b6d..8c68e5678ad 100644
--- a/gcc/rust/hir/rust-ast-lower-stmt.cc
+++ b/gcc/rust/hir/rust-ast-lower-stmt.cc
@@ -46,8 +46,7 @@ ASTLoweringStmt::translate (AST::Stmt *stmt, bool *terminated)
 void
 ASTLoweringStmt::visit (AST::ExprStmt &stmt)
 {
-  HIR::Expr *expr
-    = ASTLoweringExpr::translate (stmt.get_expr ().get (), &terminated);
+  HIR::Expr *expr = ASTLoweringExpr::translate (stmt.get_expr (), &terminated);
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, stmt.get_node_id (),
@@ -61,21 +60,20 @@ ASTLoweringStmt::visit (AST::ExprStmt &stmt)
 void
 ASTLoweringStmt::visit (AST::ConstantItem &constant)
 {
-  translated = ASTLoweringItem::translate (&constant);
+  translated = ASTLoweringItem::translate (constant);
 }
 
 void
 ASTLoweringStmt::visit (AST::LetStmt &stmt)
 {
   HIR::Pattern *variables
-    = ASTLoweringPattern::translate (stmt.get_pattern ().get (), true);
+    = ASTLoweringPattern::translate (stmt.get_pattern (), true);
   HIR::Type *type = stmt.has_type ()
-		      ? ASTLoweringType::translate (stmt.get_type ().get ())
+		      ? ASTLoweringType::translate (stmt.get_type ())
 		      : nullptr;
   HIR::Expr *init_expression
-    = stmt.has_init_expr ()
-	? ASTLoweringExpr::translate (stmt.get_init_expr ().get ())
-	: nullptr;
+    = stmt.has_init_expr () ? ASTLoweringExpr::translate (stmt.get_init_expr ())
+			    : nullptr;
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, stmt.get_node_id (),
@@ -91,25 +89,25 @@ ASTLoweringStmt::visit (AST::LetStmt &stmt)
 void
 ASTLoweringStmt::visit (AST::TupleStruct &struct_decl)
 {
-  translated = ASTLoweringItem::translate (&struct_decl);
+  translated = ASTLoweringItem::translate (struct_decl);
 }
 
 void
 ASTLoweringStmt::visit (AST::StructStruct &struct_decl)
 {
-  translated = ASTLoweringItem::translate (&struct_decl);
+  translated = ASTLoweringItem::translate (struct_decl);
 }
 
 void
 ASTLoweringStmt::visit (AST::Union &union_decl)
 {
-  translated = ASTLoweringItem::translate (&union_decl);
+  translated = ASTLoweringItem::translate (union_decl);
 }
 
 void
 ASTLoweringStmt::visit (AST::Enum &enum_decl)
 {
-  translated = ASTLoweringItem::translate (&enum_decl);
+  translated = ASTLoweringItem::translate (enum_decl);
 }
 
 void
@@ -126,7 +124,7 @@ ASTLoweringStmt::visit (AST::EmptyStmt &empty)
 void
 ASTLoweringStmt::visit (AST::Function &function)
 {
-  translated = ASTLoweringItem::translate (&function);
+  translated = ASTLoweringItem::translate (function);
 }
 
 void
@@ -144,19 +142,19 @@ ASTLoweringStmt::visit (AST::MacroRulesDefinition &def)
 void
 ASTLoweringStmt::visit (AST::Trait &trait)
 {
-  translated = ASTLoweringItem::translate (&trait);
+  translated = ASTLoweringItem::translate (trait);
 }
 
 void
 ASTLoweringStmt::visit (AST::InherentImpl &impl_block)
 {
-  translated = ASTLoweringItem::translate (&impl_block);
+  translated = ASTLoweringItem::translate (impl_block);
 }
 
 void
 ASTLoweringStmt::visit (AST::TraitImpl &impl_block)
 {
-  translated = ASTLoweringItem::translate (&impl_block);
+  translated = ASTLoweringItem::translate (impl_block);
 }
 
 } // namespace HIR
diff --git a/gcc/rust/hir/rust-ast-lower-struct-field-expr.h b/gcc/rust/hir/rust-ast-lower-struct-field-expr.h
index 933347affb7..2beba05b2ea 100644
--- a/gcc/rust/hir/rust-ast-lower-struct-field-expr.h
+++ b/gcc/rust/hir/rust-ast-lower-struct-field-expr.h
@@ -30,15 +30,15 @@ class ASTLowerStructExprField : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::StructExprField *translate (AST::StructExprField *field)
+  static HIR::StructExprField *translate (AST::StructExprField &field)
   {
     ASTLowerStructExprField compiler;
-    field->accept_vis (compiler);
+    field.accept_vis (compiler);
     rust_assert (compiler.translated != nullptr);
 
     compiler.mappings->insert_hir_struct_field (compiler.translated);
     compiler.mappings->insert_location (
-      compiler.translated->get_mappings ().get_hirid (), field->get_locus ());
+      compiler.translated->get_mappings ().get_hirid (), field.get_locus ());
 
     return compiler.translated;
   }
diff --git a/gcc/rust/hir/rust-ast-lower-type.cc b/gcc/rust/hir/rust-ast-lower-type.cc
index 504ca051f59..50ec3f905b0 100644
--- a/gcc/rust/hir/rust-ast-lower-type.cc
+++ b/gcc/rust/hir/rust-ast-lower-type.cc
@@ -44,14 +44,13 @@ ASTLowerTypePath::visit (AST::TypePathSegmentFunction &segment)
   std::vector<std::unique_ptr<HIR::Type>> inputs;
   for (auto &param : fn.get_params ())
     {
-      HIR::Type *hir_type = ASTLoweringType::translate (param.get ());
+      HIR::Type *hir_type = ASTLoweringType::translate (*param);
       inputs.push_back (std::unique_ptr<HIR::Type> (hir_type));
     }
 
   HIR::Type *result_type
-    = fn.has_return_type ()
-	? ASTLoweringType::translate (fn.get_return_type ().get ())
-	: nullptr;
+    = fn.has_return_type () ? ASTLoweringType::translate (fn.get_return_type ())
+			    : nullptr;
 
   HIR::TypePathFunction function_path (std::move (inputs),
 				       std::unique_ptr<HIR::Type> (
@@ -143,8 +142,8 @@ ASTLowerQualifiedPathInType::visit (AST::QualifiedPathInType &path)
     crate_num, path.get_qualified_path_type ().get_node_id (), hirid,
     UNKNOWN_LOCAL_DEFID);
 
-  HIR::Type *qual_type = ASTLoweringType::translate (
-    path.get_qualified_path_type ().get_type ().get ());
+  HIR::Type *qual_type
+    = ASTLoweringType::translate (path.get_qualified_path_type ().get_type ());
   HIR::TypePath *qual_trait = ASTLowerTypePath::translate (
     path.get_qualified_path_type ().get_as_type_path ());
 
@@ -180,10 +179,10 @@ ASTLowerQualifiedPathInType::visit (AST::QualifiedPathInType &path)
 }
 
 HIR::Type *
-ASTLoweringType::translate (AST::Type *type, bool default_to_static_lifetime)
+ASTLoweringType::translate (AST::Type &type, bool default_to_static_lifetime)
 {
   ASTLoweringType resolver (default_to_static_lifetime);
-  type->accept_vis (resolver);
+  type.accept_vis (resolver);
 
   rust_assert (resolver.translated != nullptr);
   resolver.mappings->insert_hir_type (resolver.translated);
@@ -201,7 +200,7 @@ ASTLoweringType::visit (AST::BareFunctionType &fntype)
   std::vector<HIR::LifetimeParam> lifetime_params;
   for (auto &lifetime_param : fntype.get_for_lifetimes ())
     {
-      auto generic_param = ASTLowerGenericParam::translate (&lifetime_param);
+      auto generic_param = ASTLowerGenericParam::translate (lifetime_param);
       lifetime_params.push_back (
 	*static_cast<HIR::LifetimeParam *> (generic_param));
     }
@@ -229,7 +228,7 @@ ASTLoweringType::visit (AST::BareFunctionType &fntype)
 	}
 
       HIR::Type *param_type
-	= ASTLoweringType::translate (param.get_type ().get (),
+	= ASTLoweringType::translate (param.get_type (),
 				      default_to_static_lifetime);
 
       HIR::MaybeNamedParam p (param.get_name (), kind,
@@ -241,9 +240,8 @@ ASTLoweringType::visit (AST::BareFunctionType &fntype)
   HIR::Type *return_type = nullptr;
   if (fntype.has_return_type ())
     {
-      return_type
-	= ASTLoweringType::translate (fntype.get_return_type ().get (),
-				      default_to_static_lifetime);
+      return_type = ASTLoweringType::translate (fntype.get_return_type (),
+						default_to_static_lifetime);
     }
 
   auto crate_num = mappings->get_current_crate ();
@@ -264,7 +262,7 @@ ASTLoweringType::visit (AST::TupleType &tuple)
   for (auto &e : tuple.get_elems ())
     {
       HIR::Type *t
-	= ASTLoweringType::translate (e.get (), default_to_static_lifetime);
+	= ASTLoweringType::translate (*e, default_to_static_lifetime);
       elems.push_back (std::unique_ptr<HIR::Type> (t));
     }
 
@@ -293,10 +291,9 @@ void
 ASTLoweringType::visit (AST::ArrayType &type)
 {
   HIR::Type *translated_type
-    = ASTLoweringType::translate (type.get_elem_type ().get (),
+    = ASTLoweringType::translate (type.get_elem_type (),
 				  default_to_static_lifetime);
-  HIR::Expr *array_size
-    = ASTLoweringExpr::translate (type.get_size_expr ().get ());
+  HIR::Expr *array_size = ASTLoweringExpr::translate (type.get_size_expr ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, type.get_node_id (),
@@ -316,7 +313,7 @@ ASTLoweringType::visit (AST::ReferenceType &type)
     = lower_lifetime (type.get_lifetime (), default_to_static_lifetime);
 
   HIR::Type *base_type
-    = ASTLoweringType::translate (type.get_base_type ().get (),
+    = ASTLoweringType::translate (type.get_base_type (),
 				  default_to_static_lifetime);
 
   auto crate_num = mappings->get_current_crate ();
@@ -335,7 +332,7 @@ void
 ASTLoweringType::visit (AST::RawPointerType &type)
 {
   HIR::Type *base_type
-    = ASTLoweringType::translate (type.get_type_pointed_to ().get (),
+    = ASTLoweringType::translate (type.get_type_pointed_to (),
 				  default_to_static_lifetime);
 
   auto crate_num = mappings->get_current_crate ();
@@ -357,7 +354,7 @@ void
 ASTLoweringType::visit (AST::SliceType &type)
 {
   HIR::Type *base_type
-    = ASTLoweringType::translate (type.get_elem_type ().get (),
+    = ASTLoweringType::translate (type.get_elem_type (),
 				  default_to_static_lifetime);
 
   auto crate_num = mappings->get_current_crate ();
@@ -397,7 +394,7 @@ ASTLoweringType::visit (AST::TraitObjectTypeOneBound &type)
 {
   std::vector<std::unique_ptr<HIR::TypeParamBound>> bounds;
   HIR::TypeParamBound *translated_bound
-    = ASTLoweringTypeBounds::translate (&type.get_trait_bound ());
+    = ASTLoweringTypeBounds::translate (type.get_trait_bound ());
   bounds.push_back (std::unique_ptr<HIR::TypeParamBound> (translated_bound));
 
   auto crate_num = mappings->get_current_crate ();
@@ -417,7 +414,7 @@ ASTLoweringType::visit (AST::TraitObjectType &type)
   for (auto &bound : type.get_type_param_bounds ())
     {
       HIR::TypeParamBound *translated_bound
-	= ASTLoweringTypeBounds::translate (bound.get ());
+	= ASTLoweringTypeBounds::translate (*bound);
       bounds.push_back (
 	std::unique_ptr<HIR::TypeParamBound> (translated_bound));
     }
@@ -432,14 +429,14 @@ ASTLoweringType::visit (AST::TraitObjectType &type)
 }
 
 HIR::GenericParam *
-ASTLowerGenericParam::translate (AST::GenericParam *param)
+ASTLowerGenericParam::translate (AST::GenericParam &param)
 {
   ASTLowerGenericParam resolver;
-  param->accept_vis (resolver);
+  param.accept_vis (resolver);
 
   rust_assert (resolver.translated != nullptr);
   resolver.mappings->insert_location (
-    resolver.translated->get_mappings ().get_hirid (), param->get_locus ());
+    resolver.translated->get_mappings ().get_hirid (), param.get_locus ());
   resolver.mappings->insert_hir_generic_param (resolver.translated);
 
   return resolver.translated;
@@ -469,12 +466,12 @@ ASTLowerGenericParam::visit (AST::ConstGenericParam &param)
 				 mappings->get_next_hir_id (crate_num),
 				 mappings->get_next_localdef_id (crate_num));
 
-  auto type = ASTLoweringType::translate (param.get_type ().get ());
+  auto type = ASTLoweringType::translate (param.get_type ());
 
   HIR::Expr *default_expr = nullptr;
   if (param.has_default_value ())
     default_expr = ASTLoweringExpr::translate (
-      param.get_default_value ().get_expression ().get ());
+      param.get_default_value ().get_expression ());
 
   translated = new HIR::ConstGenericParam (param.get_name ().as_string (),
 					   std::unique_ptr<Type> (type),
@@ -491,14 +488,14 @@ ASTLowerGenericParam::visit (AST::TypeParam &param)
     {
       for (auto &bound : param.get_type_param_bounds ())
 	{
-	  HIR::TypeParamBound *lowered_bound = lower_bound (bound.get ());
+	  HIR::TypeParamBound *lowered_bound = lower_bound (*bound);
 	  type_param_bounds.push_back (
 	    std::unique_ptr<HIR::TypeParamBound> (lowered_bound));
 	}
     }
 
   HIR::Type *type = param.has_type ()
-		      ? ASTLoweringType::translate (param.get_type ().get ())
+		      ? ASTLoweringType::translate (param.get_type ())
 		      : nullptr;
 
   auto crate_num = mappings->get_current_crate ();
@@ -513,10 +510,10 @@ ASTLowerGenericParam::visit (AST::TypeParam &param)
 }
 
 HIR::TypeParamBound *
-ASTLoweringTypeBounds::translate (AST::TypeParamBound *type)
+ASTLoweringTypeBounds::translate (AST::TypeParamBound &type)
 {
   ASTLoweringTypeBounds resolver;
-  type->accept_vis (resolver);
+  type.accept_vis (resolver);
 
   rust_assert (resolver.translated != nullptr);
   resolver.mappings->insert_location (
@@ -532,7 +529,7 @@ ASTLoweringTypeBounds::visit (AST::TraitBound &bound)
   std::vector<HIR::LifetimeParam> for_lifetimes;
   for (auto &lifetime_param : bound.get_for_lifetimes ())
     {
-      auto generic_param = ASTLowerGenericParam::translate (&lifetime_param);
+      auto generic_param = ASTLowerGenericParam::translate (lifetime_param);
       for_lifetimes.push_back (
 	*static_cast<HIR::LifetimeParam *> (generic_param));
     }
@@ -604,18 +601,18 @@ ASTLowerWhereClauseItem::visit (AST::TypeBoundWhereClauseItem &item)
 
   for (auto &lifetime_param : item.get_for_lifetimes ())
     {
-      auto generic_param = ASTLowerGenericParam::translate (&lifetime_param);
+      auto generic_param = ASTLowerGenericParam::translate (lifetime_param);
       for_lifetimes.push_back (
 	*static_cast<HIR::LifetimeParam *> (generic_param));
     }
 
   std::unique_ptr<HIR::Type> bound_type = std::unique_ptr<HIR::Type> (
-    ASTLoweringType::translate (item.get_type ().get ()));
+    ASTLoweringType::translate (item.get_type ()));
 
   std::vector<std::unique_ptr<HIR::TypeParamBound>> type_param_bounds;
   for (auto &bound : item.get_type_param_bounds ())
     {
-      HIR::TypeParamBound *b = ASTLoweringTypeBounds::translate (bound.get ());
+      HIR::TypeParamBound *b = ASTLoweringTypeBounds::translate (*bound);
       type_param_bounds.push_back (std::unique_ptr<HIR::TypeParamBound> (b));
     }
 
diff --git a/gcc/rust/hir/rust-ast-lower-type.h b/gcc/rust/hir/rust-ast-lower-type.h
index ed90c17bb0f..5207ce27b55 100644
--- a/gcc/rust/hir/rust-ast-lower-type.h
+++ b/gcc/rust/hir/rust-ast-lower-type.h
@@ -63,7 +63,7 @@ class ASTLoweringType : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::Type *translate (AST::Type *type,
+  static HIR::Type *translate (AST::Type &type,
 			       bool default_to_static_lifetime = false);
 
   void visit (AST::BareFunctionType &fntype) override;
@@ -97,7 +97,7 @@ class ASTLowerGenericParam : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::GenericParam *translate (AST::GenericParam *param);
+  static HIR::GenericParam *translate (AST::GenericParam &param);
 
   void visit (AST::LifetimeParam &param) override;
   void visit (AST::ConstGenericParam &param) override;
@@ -114,7 +114,7 @@ class ASTLoweringTypeBounds : public ASTLoweringBase
   using Rust::HIR::ASTLoweringBase::visit;
 
 public:
-  static HIR::TypeParamBound *translate (AST::TypeParamBound *type);
+  static HIR::TypeParamBound *translate (AST::TypeParamBound &type);
 
   void visit (AST::TraitBound &bound) override;
   void visit (AST::Lifetime &bound) override;
diff --git a/gcc/rust/hir/rust-ast-lower.cc b/gcc/rust/hir/rust-ast-lower.cc
index d730f29b13a..1c2db3b8134 100644
--- a/gcc/rust/hir/rust-ast-lower.cc
+++ b/gcc/rust/hir/rust-ast-lower.cc
@@ -74,9 +74,9 @@ ASTLowering::go ()
 {
   std::vector<std::unique_ptr<HIR::Item>> items;
 
-  for (auto it = astCrate.items.begin (); it != astCrate.items.end (); it++)
+  for (auto &item : astCrate.items)
     {
-      auto translated = ASTLoweringItem::translate (it->get ());
+      auto translated = ASTLoweringItem::translate (*item);
       if (translated != nullptr)
 	items.push_back (std::unique_ptr<HIR::Item> (translated));
     }
@@ -123,7 +123,7 @@ ASTLoweringBlock::visit (AST::BlockExpr &expr)
   if (expr.has_tail_expr () && block_did_terminate)
     {
       // warning unreachable tail expressions
-      rust_warning_at (expr.get_tail_expr ()->get_locus (), 0,
+      rust_warning_at (expr.get_tail_expr ().get_locus (), 0,
 		       "unreachable expression");
     }
 
@@ -132,7 +132,7 @@ ASTLoweringBlock::visit (AST::BlockExpr &expr)
     {
       bool terminated = false;
       tail_expr = (HIR::ExprWithoutBlock *)
-	ASTLoweringExpr::translate (expr.get_tail_expr ().get (), &terminated);
+	ASTLoweringExpr::translate (expr.get_tail_expr (), &terminated);
       block_did_terminate |= terminated;
     }
 
@@ -155,12 +155,10 @@ void
 ASTLoweringIfBlock::visit (AST::IfExpr &expr)
 {
   bool ignored_terminated = false;
-  HIR::Expr *condition
-    = ASTLoweringExpr::translate (expr.get_condition_expr ().get (),
-				  &ignored_terminated);
+  HIR::Expr *condition = ASTLoweringExpr::translate (expr.get_condition_expr (),
+						     &ignored_terminated);
   HIR::BlockExpr *block
-    = ASTLoweringBlock::translate (expr.get_if_block ().get (),
-				   &ignored_terminated);
+    = ASTLoweringBlock::translate (expr.get_if_block (), &ignored_terminated);
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -176,16 +174,15 @@ void
 ASTLoweringIfBlock::visit (AST::IfExprConseqElse &expr)
 {
   HIR::Expr *condition
-    = ASTLoweringExpr::translate (expr.get_condition_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_condition_expr ());
 
   bool if_block_terminated = false;
   bool else_block_termianted = false;
 
   HIR::BlockExpr *if_block
-    = ASTLoweringBlock::translate (expr.get_if_block ().get (),
-				   &if_block_terminated);
+    = ASTLoweringBlock::translate (expr.get_if_block (), &if_block_terminated);
   HIR::ExprWithBlock *else_block
-    = ASTLoweringExprWithBlock::translate (expr.get_else_block ().get (),
+    = ASTLoweringExprWithBlock::translate (expr.get_else_block (),
 					   &else_block_termianted);
 
   terminated = if_block_terminated && else_block_termianted;
@@ -207,16 +204,14 @@ ASTLoweringIfLetBlock::visit (AST::IfLetExpr &expr)
   std::vector<std::unique_ptr<HIR::Pattern>> patterns;
   for (auto &pattern : expr.get_patterns ())
     {
-      HIR::Pattern *ptrn = ASTLoweringPattern::translate (pattern.get ());
+      HIR::Pattern *ptrn = ASTLoweringPattern::translate (*pattern);
       patterns.push_back (std::unique_ptr<HIR::Pattern> (ptrn));
     }
-  HIR::Expr *value_ptr
-    = ASTLoweringExpr::translate (expr.get_value_expr ().get ());
+  HIR::Expr *value_ptr = ASTLoweringExpr::translate (expr.get_value_expr ());
 
   bool ignored_terminated = false;
   HIR::BlockExpr *block
-    = ASTLoweringBlock::translate (expr.get_if_block ().get (),
-				   &ignored_terminated);
+    = ASTLoweringBlock::translate (expr.get_if_block (), &ignored_terminated);
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -235,19 +230,17 @@ ASTLoweringIfLetBlock::visit (AST::IfLetExprConseqElse &expr)
   std::vector<std::unique_ptr<HIR::Pattern>> patterns;
   for (auto &pattern : expr.get_patterns ())
     {
-      HIR::Pattern *ptrn = ASTLoweringPattern::translate (pattern.get ());
+      HIR::Pattern *ptrn = ASTLoweringPattern::translate (*pattern);
       patterns.push_back (std::unique_ptr<HIR::Pattern> (ptrn));
     }
-  HIR::Expr *value_ptr
-    = ASTLoweringExpr::translate (expr.get_value_expr ().get ());
+  HIR::Expr *value_ptr = ASTLoweringExpr::translate (expr.get_value_expr ());
 
   bool ignored_terminated = false;
   HIR::BlockExpr *block
-    = ASTLoweringBlock::translate (expr.get_if_block ().get (),
-				   &ignored_terminated);
+    = ASTLoweringBlock::translate (expr.get_if_block (), &ignored_terminated);
 
   HIR::ExprWithBlock *else_block
-    = ASTLoweringExprWithBlock::translate (expr.get_else_block ().get (),
+    = ASTLoweringExprWithBlock::translate (expr.get_else_block (),
 					   &ignored_terminated);
 
   rust_assert (else_block);
@@ -268,7 +261,7 @@ ASTLoweringIfLetBlock::visit (AST::IfLetExprConseqElse &expr)
 void
 ASTLowerStructExprField::visit (AST::StructExprFieldIdentifierValue &field)
 {
-  HIR::Expr *value = ASTLoweringExpr::translate (field.get_value ().get ());
+  HIR::Expr *value = ASTLoweringExpr::translate (field.get_value ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, field.get_node_id (),
@@ -283,7 +276,7 @@ ASTLowerStructExprField::visit (AST::StructExprFieldIdentifierValue &field)
 void
 ASTLowerStructExprField::visit (AST::StructExprFieldIndexValue &field)
 {
-  HIR::Expr *value = ASTLoweringExpr::translate (field.get_value ().get ());
+  HIR::Expr *value = ASTLoweringExpr::translate (field.get_value ());
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, field.get_node_id (),
@@ -315,12 +308,11 @@ void
 ASTLoweringExprWithBlock::visit (AST::WhileLoopExpr &expr)
 {
   HIR::BlockExpr *loop_block
-    = ASTLoweringBlock::translate (expr.get_loop_block ().get (), &terminated);
+    = ASTLoweringBlock::translate (expr.get_loop_block (), &terminated);
 
   HIR::LoopLabel loop_label = lower_loop_label (expr.get_loop_label ());
   HIR::Expr *loop_condition
-    = ASTLoweringExpr::translate (expr.get_predicate_expr ().get (),
-				  &terminated);
+    = ASTLoweringExpr::translate (expr.get_predicate_expr (), &terminated);
 
   auto crate_num = mappings->get_current_crate ();
   Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
@@ -362,25 +354,25 @@ void
 ASTLoweringExprWithBlock::visit (AST::MatchExpr &expr)
 {
   HIR::Expr *branch_value
-    = ASTLoweringExpr::translate (expr.get_scrutinee_expr ().get ());
+    = ASTLoweringExpr::translate (expr.get_scrutinee_expr ());
 
   std::vector<HIR::MatchCase> match_arms;
   for (auto &match_case : expr.get_match_cases ())
     {
       HIR::Expr *kase_expr
-	= ASTLoweringExpr::translate (match_case.get_expr ().get ());
+	= ASTLoweringExpr::translate (match_case.get_expr ());
 
       HIR::Expr *kase_guard_expr = nullptr;
       if (match_case.get_arm ().has_match_arm_guard ())
 	{
 	  kase_guard_expr = ASTLoweringExpr::translate (
-	    match_case.get_arm ().get_guard_expr ().get ());
+	    match_case.get_arm ().get_guard_expr ());
 	}
 
       std::vector<std::unique_ptr<HIR::Pattern>> match_arm_patterns;
       for (auto &pattern : match_case.get_arm ().get_patterns ())
 	{
-	  HIR::Pattern *ptrn = ASTLoweringPattern::translate (pattern.get ());
+	  HIR::Pattern *ptrn = ASTLoweringPattern::translate (*pattern);
 	  match_arm_patterns.push_back (std::unique_ptr<HIR::Pattern> (ptrn));
 	}
 
@@ -437,8 +429,7 @@ ASTLowerPathInExpression::visit (AST::PathInExpression &expr)
 HIR::QualifiedPathType
 ASTLoweringBase::lower_qual_path_type (AST::QualifiedPathType &qualified_type)
 {
-  HIR::Type *type
-    = ASTLoweringType::translate (qualified_type.get_type ().get ());
+  HIR::Type *type = ASTLoweringType::translate (qualified_type.get_type ());
   HIR::TypePath *trait
     = qualified_type.has_as_clause ()
 	? ASTLowerTypePath::translate (qualified_type.get_as_type_path ())
@@ -486,12 +477,11 @@ ClosureParam
 ASTLoweringBase::lower_closure_param (AST::ClosureParam &param)
 {
   HIR::Pattern *param_pattern
-    = ASTLoweringPattern::translate (param.get_pattern ().get ());
+    = ASTLoweringPattern::translate (param.get_pattern ());
 
-  HIR::Type *param_type
-    = param.has_type_given ()
-	? ASTLoweringType::translate (param.get_type ().get ())
-	: nullptr;
+  HIR::Type *param_type = param.has_type_given ()
+			    ? ASTLoweringType::translate (param.get_type ())
+			    : nullptr;
 
   return HIR::ClosureParam (std::unique_ptr<HIR::Pattern> (param_pattern),
 			    param.get_locus (),
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc
index 1ef162d37e0..1939a2056e4 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-base.cc
@@ -30,7 +30,7 @@ ResolverBase::resolve_visibility (const AST::Visibility &vis)
   if (vis.has_path ())
     {
       auto path = vis.get_path ();
-      ResolvePath::go (&path);
+      ResolvePath::go (path);
 
       // Do we need to lookup something here?
       // Is it just about resolving the names correctly so we can look them up
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc
index 741d900460c..1bb3fc60153 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc
@@ -28,17 +28,17 @@ namespace Rust {
 namespace Resolver {
 
 void
-ResolveExpr::go (AST::Expr *expr, const CanonicalPath &prefix,
+ResolveExpr::go (AST::Expr &expr, const CanonicalPath &prefix,
 		 const CanonicalPath &canonical_prefix, bool funny_error)
 {
   ResolveExpr resolver (prefix, canonical_prefix, funny_error);
-  expr->accept_vis (resolver);
+  expr.accept_vis (resolver);
 }
 
 void
 ResolveExpr::visit (AST::TupleIndexExpr &expr)
 {
-  ResolveExpr::go (expr.get_tuple_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_tuple_expr (), prefix, canonical_prefix);
 }
 
 void
@@ -48,41 +48,40 @@ ResolveExpr::visit (AST::TupleExpr &expr)
     return;
 
   for (auto &elem : expr.get_tuple_elems ())
-    ResolveExpr::go (elem.get (), prefix, canonical_prefix);
+    ResolveExpr::go (*elem, prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::PathInExpression &expr)
 {
-  ResolvePath::go (&expr);
+  ResolvePath::go (expr);
 }
 
 void
 ResolveExpr::visit (AST::QualifiedPathInExpression &expr)
 {
-  ResolvePath::go (&expr);
+  ResolvePath::go (expr);
 }
 
 void
 ResolveExpr::visit (AST::ReturnExpr &expr)
 {
   if (expr.has_returned_expr ())
-    ResolveExpr::go (expr.get_returned_expr ().get (), prefix,
-		     canonical_prefix);
+    ResolveExpr::go (expr.get_returned_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::CallExpr &expr)
 {
-  ResolveExpr::go (expr.get_function_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_function_expr (), prefix, canonical_prefix);
   for (auto &param : expr.get_params ())
-    ResolveExpr::go (param.get (), prefix, canonical_prefix);
+    ResolveExpr::go (*param, prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::MethodCallExpr &expr)
 {
-  ResolveExpr::go (expr.get_receiver_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_receiver_expr (), prefix, canonical_prefix);
 
   if (expr.get_method_name ().has_generic_args ())
     {
@@ -92,14 +91,14 @@ ResolveExpr::visit (AST::MethodCallExpr &expr)
 
   auto const &in_params = expr.get_params ();
   for (auto &param : in_params)
-    ResolveExpr::go (param.get (), prefix, canonical_prefix);
+    ResolveExpr::go (*param, prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::AssignmentExpr &expr)
 {
-  ResolveExpr::go (expr.get_left_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_left_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_right_expr (), prefix, canonical_prefix);
 }
 
 /* The "break rust" Easter egg.
@@ -178,63 +177,63 @@ ResolveExpr::visit (AST::IdentifierExpr &expr)
 void
 ResolveExpr::visit (AST::ArithmeticOrLogicalExpr &expr)
 {
-  ResolveExpr::go (expr.get_left_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_left_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_right_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::CompoundAssignmentExpr &expr)
 {
-  ResolveExpr::go (expr.get_left_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_left_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_right_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::ComparisonExpr &expr)
 {
-  ResolveExpr::go (expr.get_left_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_left_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_right_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::LazyBooleanExpr &expr)
 {
-  ResolveExpr::go (expr.get_left_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_right_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_left_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_right_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::NegationExpr &expr)
 {
-  ResolveExpr::go (expr.get_negated_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_negated_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::TypeCastExpr &expr)
 {
-  ResolveType::go (expr.get_type_to_cast_to ().get ());
-  ResolveExpr::go (expr.get_casted_expr ().get (), prefix, canonical_prefix);
+  ResolveType::go (expr.get_type_to_cast_to ());
+  ResolveExpr::go (expr.get_casted_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::IfExpr &expr)
 {
-  ResolveExpr::go (expr.get_condition_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_if_block ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_condition_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_if_block (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::IfExprConseqElse &expr)
 {
-  ResolveExpr::go (expr.get_condition_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_if_block ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_else_block ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_condition_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_if_block (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_else_block (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::IfLetExpr &expr)
 {
-  ResolveExpr::go (expr.get_value_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_value_expr (), prefix, canonical_prefix);
 
   NodeId scope_node_id = expr.get_node_id ();
   resolver->get_name_scope ().push (scope_node_id);
@@ -251,10 +250,10 @@ ResolveExpr::visit (AST::IfLetExpr &expr)
 
   for (auto &pattern : expr.get_patterns ())
     {
-      PatternDeclaration::go (pattern.get (), Rib::ItemType::Var, bindings);
+      PatternDeclaration::go (*pattern, Rib::ItemType::Var, bindings);
     }
 
-  ResolveExpr::go (expr.get_if_block ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_if_block (), prefix, canonical_prefix);
 
   resolver->get_name_scope ().pop ();
   resolver->get_type_scope ().pop ();
@@ -264,7 +263,7 @@ ResolveExpr::visit (AST::IfLetExpr &expr)
 void
 ResolveExpr::visit (AST::IfLetExprConseqElse &expr)
 {
-  ResolveExpr::go (expr.get_value_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_value_expr (), prefix, canonical_prefix);
 
   NodeId scope_node_id = expr.get_node_id ();
   resolver->get_name_scope ().push (scope_node_id);
@@ -281,11 +280,11 @@ ResolveExpr::visit (AST::IfLetExprConseqElse &expr)
 
   for (auto &pattern : expr.get_patterns ())
     {
-      PatternDeclaration::go (pattern.get (), Rib::ItemType::Var, bindings);
+      PatternDeclaration::go (*pattern, Rib::ItemType::Var, bindings);
     }
 
-  ResolveExpr::go (expr.get_if_block ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_else_block ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_if_block (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_else_block (), prefix, canonical_prefix);
 
   resolver->get_name_scope ().pop ();
   resolver->get_type_scope ().pop ();
@@ -328,19 +327,19 @@ ResolveExpr::visit (AST::BlockExpr &expr)
   for (auto &s : expr.get_statements ())
     {
       if (s->is_item ())
-	ResolveStmt::go (s.get (), prefix, canonical_prefix,
+	ResolveStmt::go (*s, prefix, canonical_prefix,
 			 CanonicalPath::create_empty ());
     }
 
   for (auto &s : expr.get_statements ())
     {
       if (!s->is_item ())
-	ResolveStmt::go (s.get (), prefix, canonical_prefix,
+	ResolveStmt::go (*s, prefix, canonical_prefix,
 			 CanonicalPath::create_empty ());
     }
 
   if (expr.has_tail_expr ())
-    ResolveExpr::go (expr.get_tail_expr ().get (), prefix, canonical_prefix);
+    ResolveExpr::go (expr.get_tail_expr (), prefix, canonical_prefix);
 
   resolver->get_name_scope ().pop ();
   resolver->get_type_scope ().pop ();
@@ -350,14 +349,14 @@ ResolveExpr::visit (AST::BlockExpr &expr)
 void
 ResolveExpr::visit (AST::UnsafeBlockExpr &expr)
 {
-  expr.get_block_expr ()->accept_vis (*this);
+  expr.get_block_expr ().accept_vis (*this);
 }
 
 void
 ResolveExpr::visit (AST::ArrayElemsValues &elems)
 {
   for (auto &elem : elems.get_values ())
-    ResolveExpr::go (elem.get (), prefix, canonical_prefix);
+    ResolveExpr::go (*elem, prefix, canonical_prefix);
 }
 
 void
@@ -369,55 +368,53 @@ ResolveExpr::visit (AST::ArrayExpr &expr)
 void
 ResolveExpr::visit (AST::ArrayIndexExpr &expr)
 {
-  ResolveExpr::go (expr.get_array_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_index_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_array_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_index_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::ArrayElemsCopied &expr)
 {
-  ResolveExpr::go (expr.get_num_copies ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_elem_to_copy ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_num_copies (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_elem_to_copy (), prefix, canonical_prefix);
 }
 
 // this this an empty struct constructor like 'S {}'
 void
 ResolveExpr::visit (AST::StructExprStruct &struct_expr)
 {
-  ResolveExpr::go (&struct_expr.get_struct_name (), prefix, canonical_prefix);
+  ResolveExpr::go (struct_expr.get_struct_name (), prefix, canonical_prefix);
 }
 
 // this this a struct constructor with fields
 void
 ResolveExpr::visit (AST::StructExprStructFields &struct_expr)
 {
-  ResolveExpr::go (&struct_expr.get_struct_name (), prefix, canonical_prefix);
+  ResolveExpr::go (struct_expr.get_struct_name (), prefix, canonical_prefix);
 
   if (struct_expr.has_struct_base ())
     {
       AST::StructBase &base = struct_expr.get_struct_base ();
-      ResolveExpr::go (base.get_base_struct ().get (), prefix,
-		       canonical_prefix);
+      ResolveExpr::go (base.get_base_struct (), prefix, canonical_prefix);
     }
 
   auto const &struct_fields = struct_expr.get_fields ();
   for (auto &struct_field : struct_fields)
     {
-      ResolveStructExprField::go (struct_field.get (), prefix,
-				  canonical_prefix);
+      ResolveStructExprField::go (*struct_field, prefix, canonical_prefix);
     }
 }
 
 void
 ResolveExpr::visit (AST::GroupedExpr &expr)
 {
-  ResolveExpr::go (expr.get_expr_in_parens ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_expr_in_parens (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::FieldAccessExpr &expr)
 {
-  ResolveExpr::go (expr.get_receiver_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_receiver_expr (), prefix, canonical_prefix);
 }
 
 void
@@ -444,7 +441,7 @@ ResolveExpr::visit (AST::LoopExpr &expr)
 	  rust_error_at (locus, "was defined here");
 	});
     }
-  ResolveExpr::go (expr.get_loop_block ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_loop_block (), prefix, canonical_prefix);
 }
 
 void
@@ -477,7 +474,7 @@ ResolveExpr::visit (AST::BreakExpr &expr)
   if (expr.has_break_expr ())
     {
       bool funny_error = false;
-      AST::Expr &break_expr = *expr.get_break_expr ().get ();
+      auto &break_expr = expr.get_break_expr ();
       if (break_expr.get_ast_kind () == AST::Kind::IDENTIFIER)
 	{
 	  /* This is a break with an expression, and the expression is just a
@@ -491,7 +488,7 @@ ResolveExpr::visit (AST::BreakExpr &expr)
 	  if (ident == "rust" || ident == "gcc")
 	    funny_error = true;
 	}
-      ResolveExpr::go (&break_expr, prefix, canonical_prefix, funny_error);
+      ResolveExpr::go (break_expr, prefix, canonical_prefix, funny_error);
     }
 }
 
@@ -520,8 +517,8 @@ ResolveExpr::visit (AST::WhileLoopExpr &expr)
 	});
     }
 
-  ResolveExpr::go (expr.get_predicate_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_loop_block ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_predicate_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_loop_block (), prefix, canonical_prefix);
 }
 
 void
@@ -559,9 +556,9 @@ ResolveExpr::visit (AST::ForLoopExpr &expr)
   resolver->push_new_label_rib (resolver->get_type_scope ().peek ());
 
   // resolve the expression
-  PatternDeclaration::go (expr.get_pattern ().get (), Rib::ItemType::Var);
-  ResolveExpr::go (expr.get_iterator_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_loop_block ().get (), prefix, canonical_prefix);
+  PatternDeclaration::go (expr.get_pattern (), Rib::ItemType::Var);
+  ResolveExpr::go (expr.get_iterator_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_loop_block (), prefix, canonical_prefix);
 
   // done
   resolver->get_name_scope ().pop ();
@@ -600,20 +597,19 @@ ResolveExpr::visit (AST::ContinueExpr &expr)
 void
 ResolveExpr::visit (AST::BorrowExpr &expr)
 {
-  ResolveExpr::go (expr.get_borrowed_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_borrowed_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::DereferenceExpr &expr)
 {
-  ResolveExpr::go (expr.get_dereferenced_expr ().get (), prefix,
-		   canonical_prefix);
+  ResolveExpr::go (expr.get_dereferenced_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::MatchExpr &expr)
 {
-  ResolveExpr::go (expr.get_scrutinee_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_scrutinee_expr (), prefix, canonical_prefix);
   for (auto &match_case : expr.get_match_cases ())
     {
       // each arm is in its own scope
@@ -628,8 +624,7 @@ ResolveExpr::visit (AST::MatchExpr &expr)
       // resolve
       AST::MatchArm &arm = match_case.get_arm ();
       if (arm.has_match_arm_guard ())
-	ResolveExpr::go (arm.get_guard_expr ().get (), prefix,
-			 canonical_prefix);
+	ResolveExpr::go (arm.get_guard_expr (), prefix, canonical_prefix);
 
       // We know expr.get_patterns () has one pattern at most
       // so there's no reason to handle it like an AltPattern.
@@ -639,11 +634,11 @@ ResolveExpr::visit (AST::MatchExpr &expr)
       // insert any possible new patterns
       for (auto &pattern : arm.get_patterns ())
 	{
-	  PatternDeclaration::go (pattern.get (), Rib::ItemType::Var, bindings);
+	  PatternDeclaration::go (*pattern, Rib::ItemType::Var, bindings);
 	}
 
       // resolve the body
-      ResolveExpr::go (match_case.get_expr ().get (), prefix, canonical_prefix);
+      ResolveExpr::go (match_case.get_expr (), prefix, canonical_prefix);
 
       // done
       resolver->get_name_scope ().pop ();
@@ -655,20 +650,20 @@ ResolveExpr::visit (AST::MatchExpr &expr)
 void
 ResolveExpr::visit (AST::RangeFromToExpr &expr)
 {
-  ResolveExpr::go (expr.get_from_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_to_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_from_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_to_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::RangeFromExpr &expr)
 {
-  ResolveExpr::go (expr.get_from_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_from_expr (), prefix, canonical_prefix);
 }
 
 void
 ResolveExpr::visit (AST::RangeToExpr &expr)
 {
-  ResolveExpr::go (expr.get_to_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_to_expr (), prefix, canonical_prefix);
 }
 
 void
@@ -680,8 +675,8 @@ ResolveExpr::visit (AST::RangeFullExpr &)
 void
 ResolveExpr::visit (AST::RangeFromToInclExpr &expr)
 {
-  ResolveExpr::go (expr.get_from_expr ().get (), prefix, canonical_prefix);
-  ResolveExpr::go (expr.get_to_expr ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_from_expr (), prefix, canonical_prefix);
+  ResolveExpr::go (expr.get_to_expr (), prefix, canonical_prefix);
 }
 
 void
@@ -705,8 +700,7 @@ ResolveExpr::visit (AST::ClosureExprInner &expr)
 
   resolver->push_closure_context (expr.get_node_id ());
 
-  ResolveExpr::go (expr.get_definition_expr ().get (), prefix,
-		   canonical_prefix);
+  ResolveExpr::go (expr.get_definition_expr (), prefix, canonical_prefix);
 
   resolver->pop_closure_context ();
 
@@ -734,12 +728,11 @@ ResolveExpr::visit (AST::ClosureExprInnerTyped &expr)
       resolve_closure_param (p, bindings);
     }
 
-  ResolveType::go (expr.get_return_type ().get ());
+  ResolveType::go (expr.get_return_type ());
 
   resolver->push_closure_context (expr.get_node_id ());
 
-  ResolveExpr::go (expr.get_definition_block ().get (), prefix,
-		   canonical_prefix);
+  ResolveExpr::go (expr.get_definition_block (), prefix, canonical_prefix);
 
   resolver->pop_closure_context ();
 
@@ -752,11 +745,10 @@ void
 ResolveExpr::resolve_closure_param (AST::ClosureParam &param,
 				    std::vector<PatternBinding> &bindings)
 {
-  PatternDeclaration::go (param.get_pattern ().get (), Rib::ItemType::Param,
-			  bindings);
+  PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param, bindings);
 
   if (param.has_type_given ())
-    ResolveType::go (param.get_type ().get ());
+    ResolveType::go (param.get_type ());
 }
 
 ResolveExpr::ResolveExpr (const CanonicalPath &prefix,
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h
index 86ae70ffbd8..4897650396d 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.h
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.h
@@ -30,7 +30,7 @@ class ResolveExpr : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::Expr *expr, const CanonicalPath &prefix,
+  static void go (AST::Expr &expr, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix,
 		  bool funny_error = false);
 
diff --git a/gcc/rust/resolve/rust-ast-resolve-implitem.h b/gcc/rust/resolve/rust-ast-resolve-implitem.h
index fa344effe67..641a6cfa754 100644
--- a/gcc/rust/resolve/rust-ast-resolve-implitem.h
+++ b/gcc/rust/resolve/rust-ast-resolve-implitem.h
@@ -31,13 +31,13 @@ class ResolveToplevelImplItem : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::AssociatedItem *item, const CanonicalPath &prefix)
+  static void go (AST::AssociatedItem &item, const CanonicalPath &prefix)
   {
-    if (item->is_marked_for_strip ())
+    if (item.is_marked_for_strip ())
       return;
 
     ResolveToplevelImplItem resolver (prefix);
-    item->accept_vis (resolver);
+    item.accept_vis (resolver);
   }
 
   void visit (AST::TypeAlias &type) override
@@ -183,10 +183,10 @@ class ResolveToplevelExternItem : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::ExternalItem *item, const CanonicalPath &prefix)
+  static void go (AST::ExternalItem &item, const CanonicalPath &prefix)
   {
     ResolveToplevelExternItem resolver (prefix);
-    item->accept_vis (resolver);
+    item.accept_vis (resolver);
   };
 
   void visit (AST::Function &function) override
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc
index c65f112ea3b..d11a78859ef 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-item.cc
@@ -65,10 +65,10 @@ ResolveTraitItems::visit (AST::Function &function)
 
   if (function.has_generics ())
     for (auto &generic : function.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   if (function.has_return_type ())
-    ResolveType::go (function.get_return_type ().get ());
+    ResolveType::go (function.get_return_type ());
 
   // self turns into (self: Self) as a function param
   std::vector<PatternBinding> bindings
@@ -80,45 +80,45 @@ ResolveTraitItems::visit (AST::Function &function)
     {
       if (p->is_variadic ())
 	{
-	  auto param = static_cast<AST::VariadicParam *> (p.get ());
-	  PatternDeclaration::go (param->get_pattern ().get (),
-				  Rib::ItemType::Param, bindings);
+	  auto param = static_cast<AST::VariadicParam &> (*p);
+	  PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param,
+				  bindings);
 	}
       else if (p->is_self ())
 	{
-	  auto param = static_cast<AST::SelfParam *> (p.get ());
+	  auto &param = static_cast<AST::SelfParam &> (*p);
 	  // FIXME: which location should be used for Rust::Identifier `self`?
 	  AST::IdentifierPattern self_pattern (
-	    param->get_node_id (), {"self"}, param->get_locus (),
-	    param->get_has_ref (), param->get_is_mut (),
+	    param.get_node_id (), {"self"}, param.get_locus (),
+	    param.get_has_ref (), param.get_is_mut (),
 	    std::unique_ptr<AST::Pattern> (nullptr));
 
-	  PatternDeclaration::go (&self_pattern, Rib::ItemType::Param);
+	  PatternDeclaration::go (self_pattern, Rib::ItemType::Param);
 
-	  if (param->has_type ())
+	  if (param.has_type ())
 	    {
 	      // This shouldn't happen the parser should already error for this
-	      rust_assert (!param->get_has_ref ());
-	      ResolveType::go (param->get_type ().get ());
+	      rust_assert (!param.get_has_ref ());
+	      ResolveType::go (param.get_type ());
 	    }
 	  else
 	    {
 	      // here we implicitly make self have a type path of Self
 	      std::vector<std::unique_ptr<AST::TypePathSegment>> segments;
 	      segments.push_back (std::unique_ptr<AST::TypePathSegment> (
-		new AST::TypePathSegment ("Self", false, param->get_locus ())));
+		new AST::TypePathSegment ("Self", false, param.get_locus ())));
 
 	      AST::TypePath self_type_path (std::move (segments),
-					    param->get_locus ());
-	      ResolveType::go (&self_type_path);
+					    param.get_locus ());
+	      ResolveType::go (self_type_path);
 	    }
 	}
       else
 	{
-	  auto param = static_cast<AST::FunctionParam *> (p.get ());
-	  ResolveType::go (param->get_type ().get ());
-	  PatternDeclaration::go (param->get_pattern ().get (),
-				  Rib::ItemType::Param, bindings);
+	  auto &param = static_cast<AST::FunctionParam &> (*p);
+	  ResolveType::go (param.get_type ());
+	  PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param,
+				  bindings);
 	}
     }
 
@@ -127,7 +127,7 @@ ResolveTraitItems::visit (AST::Function &function)
 
   // trait items have an optional body
   if (function.has_body ())
-    ResolveExpr::go (function.get_definition ()->get (), path, cpath);
+    ResolveExpr::go (*function.get_definition ().value (), path, cpath);
 
   resolver->get_name_scope ().pop ();
   resolver->get_type_scope ().pop ();
@@ -143,7 +143,7 @@ ResolveTraitItems::visit (AST::TraitItemType &type)
   mappings->insert_canonical_path (type.get_node_id (), cpath);
 
   for (auto &bound : type.get_type_param_bounds ())
-    ResolveTypeBound::go (bound.get ());
+    ResolveTypeBound::go (*bound);
 }
 
 void
@@ -155,10 +155,10 @@ ResolveTraitItems::visit (AST::TraitItemConst &constant)
   auto cpath = canonical_prefix.append (decl);
   mappings->insert_canonical_path (constant.get_node_id (), cpath);
 
-  ResolveType::go (constant.get_type ().get ());
+  ResolveType::go (constant.get_type ());
 
   if (constant.has_expr ())
-    ResolveExpr::go (constant.get_expr ().get (), path, cpath);
+    ResolveExpr::go (constant.get_expr (), path, cpath);
 }
 
 ResolveItem::ResolveItem (const CanonicalPath &prefix,
@@ -167,11 +167,11 @@ ResolveItem::ResolveItem (const CanonicalPath &prefix,
 {}
 
 void
-ResolveItem::go (AST::Item *item, const CanonicalPath &prefix,
+ResolveItem::go (AST::Item &item, const CanonicalPath &prefix,
 		 const CanonicalPath &canonical_prefix)
 {
   ResolveItem resolver (prefix, canonical_prefix);
-  item->accept_vis (resolver);
+  item.accept_vis (resolver);
 }
 
 void
@@ -189,12 +189,12 @@ ResolveItem::visit (AST::TypeAlias &alias)
 
   if (alias.has_generics ())
     for (auto &generic : alias.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   if (alias.has_where_clause ())
     ResolveWhereClause::Resolve (alias.get_where_clause ());
 
-  ResolveType::go (alias.get_type_aliased ().get ());
+  ResolveType::go (alias.get_type_aliased ());
 
   resolver->get_type_scope ().pop ();
 }
@@ -221,11 +221,11 @@ ResolveItem::visit (AST::Module &module)
   // FIXME: Should we reinsert a child here? Any reason we ResolveTopLevel::go
   // in ResolveTopLevel::visit (AST::Module) as well as here?
   for (auto &item : module.get_items ())
-    ResolveTopLevel::go (item.get (), CanonicalPath::create_empty (), cpath);
+    ResolveTopLevel::go (*item, CanonicalPath::create_empty (), cpath);
 
   resolver->push_new_module_scope (module.get_node_id ());
   for (auto &item : module.get_items ())
-    ResolveItem::go (item.get (), path, cpath);
+    ResolveItem::go (*item, path, cpath);
 
   resolver->pop_module_scope ();
 
@@ -251,19 +251,19 @@ ResolveItem::visit (AST::TupleStruct &struct_decl)
 
   if (struct_decl.has_generics ())
     for (auto &generic : struct_decl.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   if (struct_decl.has_where_clause ())
     ResolveWhereClause::Resolve (struct_decl.get_where_clause ());
 
   for (AST::TupleField &field : struct_decl.get_fields ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
       resolve_visibility (field.get_visibility ());
 
-      ResolveType::go (field.get_field_type ().get ());
+      ResolveType::go (field.get_field_type ());
     }
 
   resolver->get_type_scope ().pop ();
@@ -285,14 +285,14 @@ ResolveItem::visit (AST::Enum &enum_decl)
 
   if (enum_decl.has_generics ())
     for (auto &generic : enum_decl.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, cpath);
+      ResolveGenericParam::go (*generic, prefix, cpath);
 
   if (enum_decl.has_where_clause ())
     ResolveWhereClause::Resolve (enum_decl.get_where_clause ());
 
   /* The actual fields are inside the variants.  */
   for (auto &variant : enum_decl.get_variants ())
-    ResolveItem::go (variant.get (), path, cpath);
+    ResolveItem::go (*variant, path, cpath);
 
   resolver->get_type_scope ().pop ();
 }
@@ -322,10 +322,10 @@ ResolveItem::visit (AST::EnumItemTuple &item)
 
   for (auto &field : item.get_tuple_fields ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
-      ResolveType::go (field.get_field_type ().get ());
+      ResolveType::go (field.get_field_type ());
     }
 }
 
@@ -340,10 +340,10 @@ ResolveItem::visit (AST::EnumItemStruct &item)
 
   for (auto &field : item.get_struct_fields ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
-      ResolveType::go (field.get_field_type ().get ());
+      ResolveType::go (field.get_field_type ());
     }
 }
 
@@ -375,19 +375,19 @@ ResolveItem::visit (AST::StructStruct &struct_decl)
 
   if (struct_decl.has_generics ())
     for (auto &generic : struct_decl.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   if (struct_decl.has_where_clause ())
     ResolveWhereClause::Resolve (struct_decl.get_where_clause ());
 
   for (AST::StructField &field : struct_decl.get_fields ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
       resolve_visibility (field.get_visibility ());
 
-      ResolveType::go (field.get_field_type ().get ());
+      ResolveType::go (field.get_field_type ());
     }
 
   resolver->get_type_scope ().pop ();
@@ -410,17 +410,17 @@ ResolveItem::visit (AST::Union &union_decl)
 
   if (union_decl.has_generics ())
     for (auto &generic : union_decl.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   if (union_decl.has_where_clause ())
     ResolveWhereClause::Resolve (union_decl.get_where_clause ());
 
   for (AST::StructField &field : union_decl.get_variants ())
     {
-      if (field.get_field_type ()->is_marked_for_strip ())
+      if (field.get_field_type ().is_marked_for_strip ())
 	continue;
 
-      ResolveType::go (field.get_field_type ().get ());
+      ResolveType::go (field.get_field_type ());
     }
 
   resolver->get_type_scope ().pop ();
@@ -435,8 +435,8 @@ ResolveItem::visit (AST::StaticItem &var)
   auto cpath = canonical_prefix.append (decl);
   mappings->insert_canonical_path (var.get_node_id (), cpath);
 
-  ResolveType::go (var.get_type ().get ());
-  ResolveExpr::go (var.get_expr ().get (), path, cpath);
+  ResolveType::go (var.get_type ());
+  ResolveExpr::go (var.get_expr (), path, cpath);
 }
 
 void
@@ -450,8 +450,8 @@ ResolveItem::visit (AST::ConstantItem &constant)
 
   resolve_visibility (constant.get_visibility ());
 
-  ResolveType::go (constant.get_type ().get ());
-  ResolveExpr::go (constant.get_expr ().get (), path, cpath);
+  ResolveType::go (constant.get_type ());
+  ResolveExpr::go (constant.get_expr (), path, cpath);
 }
 
 void
@@ -477,14 +477,14 @@ ResolveItem::visit (AST::Function &function)
 
   if (function.has_generics ())
     for (auto &generic : function.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   // resolve any where clause items
   if (function.has_where_clause ())
     ResolveWhereClause::Resolve (function.get_where_clause ());
 
   if (function.has_return_type ())
-    ResolveType::go (function.get_return_type ().get ());
+    ResolveType::go (function.get_return_type ());
 
   if (function.has_self_param ())
     {
@@ -497,13 +497,13 @@ ResolveItem::visit (AST::Function &function)
 	self_param.get_node_id (), {"self"}, self_param.get_locus (),
 	self_param.get_has_ref (), self_param.get_is_mut (),
 	std::unique_ptr<AST::Pattern> (nullptr));
-      PatternDeclaration::go (&self_pattern, Rib::ItemType::Param);
+      PatternDeclaration::go (self_pattern, Rib::ItemType::Param);
 
       if (self_param.has_type ())
 	{
 	  // This shouldn't happen the parser should already error for this
 	  rust_assert (!self_param.get_has_ref ());
-	  ResolveType::go (self_param.get_type ().get ());
+	  ResolveType::go (self_param.get_type ());
 	}
       else
 	{
@@ -514,7 +514,7 @@ ResolveItem::visit (AST::Function &function)
 
 	  AST::TypePath self_type_path (std::move (segments),
 					self_param.get_locus ());
-	  ResolveType::go (&self_type_path);
+	  ResolveType::go (self_type_path);
 	}
     }
 
@@ -527,28 +527,28 @@ ResolveItem::visit (AST::Function &function)
     {
       if (p->is_variadic ())
 	{
-	  auto param = static_cast<AST::VariadicParam *> (p.get ());
-	  if (param->has_pattern ())
-	    PatternDeclaration::go (param->get_pattern ().get (),
-				    Rib::ItemType::Param, bindings);
+	  auto &param = static_cast<AST::VariadicParam &> (*p);
+	  if (param.has_pattern ())
+	    PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param,
+				    bindings);
 	}
       else if (p->is_self ())
 	{
-	  auto param = static_cast<AST::SelfParam *> (p.get ());
-	  if (param->has_type ())
-	    ResolveType::go (param->get_type ().get ());
+	  auto &param = static_cast<AST::SelfParam &> (*p);
+	  if (param.has_type ())
+	    ResolveType::go (param.get_type ());
 	}
       else
 	{
-	  auto param = static_cast<AST::FunctionParam *> (p.get ());
-	  ResolveType::go (param->get_type ().get ());
-	  PatternDeclaration::go (param->get_pattern ().get (),
-				  Rib::ItemType::Param, bindings);
+	  auto &param = static_cast<AST::FunctionParam &> (*p);
+	  ResolveType::go (param.get_type ());
+	  PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param,
+				  bindings);
 	}
     }
 
   // resolve the function body
-  ResolveExpr::go (function.get_definition ()->get (), path, cpath);
+  ResolveExpr::go (*function.get_definition ().value (), path, cpath);
 
   resolver->get_name_scope ().pop ();
   resolver->get_type_scope ().pop ();
@@ -568,7 +568,7 @@ ResolveItem::visit (AST::InherentImpl &impl_block)
 
   if (impl_block.has_generics ())
     for (auto &generic : impl_block.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   // resolve any where clause items
   if (impl_block.has_where_clause ())
@@ -577,12 +577,11 @@ ResolveItem::visit (AST::InherentImpl &impl_block)
   // FIXME this needs to be protected behind nominal type-checks see:
   // rustc --explain E0118
   // issue #2634
-  ResolveType::go (impl_block.get_type ().get ());
+  ResolveType::go (impl_block.get_type ());
 
   // Setup paths
   CanonicalPath self_cpath = CanonicalPath::create_empty ();
-  bool ok = ResolveTypeToCanonicalPath::go (impl_block.get_type ().get (),
-					    self_cpath);
+  bool ok = ResolveTypeToCanonicalPath::go (impl_block.get_type (), self_cpath);
   rust_assert (ok);
   rust_debug ("AST::InherentImpl resolve Self: {%s}",
 	      self_cpath.get ().c_str ());
@@ -609,22 +608,22 @@ ResolveItem::visit (AST::InherentImpl &impl_block)
   // done setup paths
 
   auto Self
-    = CanonicalPath::get_big_self (impl_block.get_type ()->get_node_id ());
+    = CanonicalPath::get_big_self (impl_block.get_type ().get_node_id ());
 
   resolver->get_type_scope ().insert (Self,
-				      impl_block.get_type ()->get_node_id (),
-				      impl_block.get_type ()->get_locus ());
+				      impl_block.get_type ().get_node_id (),
+				      impl_block.get_type ().get_locus ());
 
   for (auto &impl_item : impl_block.get_impl_items ())
     {
       rust_debug (
 	"AST::InherentImpl resolve_impl_item: impl_prefix={%s} cpath={%s}",
 	impl_prefix.get ().c_str (), cpath.get ().c_str ());
-      resolve_impl_item (impl_item.get (), impl_prefix, cpath);
+      resolve_impl_item (*impl_item, impl_prefix, cpath);
     }
 
   resolver->get_type_scope ().peek ()->clear_name (
-    Self, impl_block.get_type ()->get_node_id ());
+    Self, impl_block.get_type ().get_node_id ());
 
   resolver->get_type_scope ().pop ();
   resolver->get_name_scope ().pop ();
@@ -646,14 +645,14 @@ ResolveItem::visit (AST::TraitImpl &impl_block)
 
   if (impl_block.has_generics ())
     for (auto &generic : impl_block.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   // resolve any where clause items
   if (impl_block.has_where_clause ())
     ResolveWhereClause::Resolve (impl_block.get_where_clause ());
 
   // CanonicalPath canonical_trait_type = CanonicalPath::create_empty ();
-  NodeId trait_resolved_node = ResolveType::go (&impl_block.get_trait_path ());
+  NodeId trait_resolved_node = ResolveType::go (impl_block.get_trait_path ());
   if (trait_resolved_node == UNKNOWN_NODEID)
     {
       resolver->get_name_scope ().pop ();
@@ -663,7 +662,7 @@ ResolveItem::visit (AST::TraitImpl &impl_block)
     }
 
   //   CanonicalPath canonical_impl_type = CanonicalPath::create_empty ();
-  NodeId type_resolved_node = ResolveType::go (impl_block.get_type ().get ());
+  NodeId type_resolved_node = ResolveType::go (impl_block.get_type ());
   if (type_resolved_node == UNKNOWN_NODEID)
     {
       resolver->get_name_scope ().pop ();
@@ -675,7 +674,7 @@ ResolveItem::visit (AST::TraitImpl &impl_block)
   bool ok;
   // setup paths
   CanonicalPath canonical_trait_type = CanonicalPath::create_empty ();
-  ok = ResolveTypeToCanonicalPath::go (&impl_block.get_trait_path (),
+  ok = ResolveTypeToCanonicalPath::go (impl_block.get_trait_path (),
 				       canonical_trait_type);
   rust_assert (ok);
 
@@ -683,7 +682,7 @@ ResolveItem::visit (AST::TraitImpl &impl_block)
 	      canonical_trait_type.get ().c_str ());
 
   CanonicalPath canonical_impl_type = CanonicalPath::create_empty ();
-  ok = ResolveTypeToCanonicalPath::go (impl_block.get_type ().get (),
+  ok = ResolveTypeToCanonicalPath::go (impl_block.get_type (),
 				       canonical_impl_type);
   rust_assert (ok);
 
@@ -722,22 +721,22 @@ ResolveItem::visit (AST::TraitImpl &impl_block)
   // DONE setup canonical-path
 
   auto Self
-    = CanonicalPath::get_big_self (impl_block.get_type ()->get_node_id ());
+    = CanonicalPath::get_big_self (impl_block.get_type ().get_node_id ());
 
   resolver->get_type_scope ().insert (Self,
-				      impl_block.get_type ()->get_node_id (),
-				      impl_block.get_type ()->get_locus ());
+				      impl_block.get_type ().get_node_id (),
+				      impl_block.get_type ().get_locus ());
 
   for (auto &impl_item : impl_block.get_impl_items ())
     {
       rust_debug (
 	"AST::TraitImpl resolve_impl_item: impl_prefix={%s} cpath={%s}",
 	impl_prefix.get ().c_str (), cpath.get ().c_str ());
-      resolve_impl_item (impl_item.get (), impl_prefix, cpath);
+      resolve_impl_item (*impl_item, impl_prefix, cpath);
     }
 
   Rib *r = resolver->get_type_scope ().peek ();
-  r->clear_name (Self, impl_block.get_type ()->get_node_id ());
+  r->clear_name (Self, impl_block.get_type ().get_node_id ());
 
   resolver->get_name_scope ().pop ();
   resolver->get_type_scope ().pop ();
@@ -765,7 +764,7 @@ ResolveItem::visit (AST::Trait &trait)
   CanonicalPath Self = CanonicalPath::get_big_self (trait.get_node_id ());
 
   for (auto &generic : trait.get_generic_params ())
-    ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+    ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   // Self is an implicit TypeParam so lets mark it as such
   resolver->get_type_scope ().append_reference_for_def (
@@ -775,7 +774,7 @@ ResolveItem::visit (AST::Trait &trait)
     {
       for (auto &bound : trait.get_type_param_bounds ())
 	{
-	  ResolveTypeBound::go (bound.get ());
+	  ResolveTypeBound::go (*bound);
 	}
     }
 
@@ -804,12 +803,12 @@ ResolveItem::visit (AST::ExternBlock &extern_block)
 
   for (auto &item : extern_block.get_extern_items ())
     {
-      resolve_extern_item (item.get ());
+      resolve_extern_item (*item);
     }
 }
 
 void
-ResolveItem::resolve_impl_item (AST::AssociatedItem *item,
+ResolveItem::resolve_impl_item (AST::AssociatedItem &item,
 				const CanonicalPath &prefix,
 				const CanonicalPath &canonical_prefix)
 {
@@ -817,7 +816,7 @@ ResolveItem::resolve_impl_item (AST::AssociatedItem *item,
 }
 
 void
-ResolveItem::resolve_extern_item (AST::ExternalItem *item)
+ResolveItem::resolve_extern_item (AST::ExternalItem &item)
 {
   ResolveExternItem::go (item, prefix, canonical_prefix);
 }
@@ -953,7 +952,7 @@ ResolveItem::visit (AST::UseDeclaration &use_item)
       auto &path = import.get_path ();
 
       rust_debug ("resolving use-decl path: [%s]", path.as_string ().c_str ());
-      NodeId resolved_node_id = ResolvePath::go (&path);
+      NodeId resolved_node_id = ResolvePath::go (path);
       bool ok = resolved_node_id != UNKNOWN_NODEID;
       if (!ok)
 	continue;
@@ -977,14 +976,14 @@ ResolveImplItems::ResolveImplItems (const CanonicalPath &prefix,
 {}
 
 void
-ResolveImplItems::go (AST::AssociatedItem *item, const CanonicalPath &prefix,
+ResolveImplItems::go (AST::AssociatedItem &item, const CanonicalPath &prefix,
 		      const CanonicalPath &canonical_prefix)
 {
-  if (item->is_marked_for_strip ())
+  if (item.is_marked_for_strip ())
     return;
 
   ResolveImplItems resolver (prefix, canonical_prefix);
-  item->accept_vis (resolver);
+  item.accept_vis (resolver);
 }
 
 void
@@ -1000,11 +999,11 @@ ResolveImplItems::visit (AST::TypeAlias &alias)
 }
 
 void
-ResolveExternItem::go (AST::ExternalItem *item, const CanonicalPath &prefix,
+ResolveExternItem::go (AST::ExternalItem &item, const CanonicalPath &prefix,
 		       const CanonicalPath &canonical_prefix)
 {
   ResolveExternItem resolver (prefix, canonical_prefix);
-  item->accept_vis (resolver);
+  item.accept_vis (resolver);
 }
 
 void
@@ -1031,18 +1030,18 @@ ResolveExternItem::visit (AST::Function &function)
   // resolve the generics
   if (function.has_generics ())
     for (auto &generic : function.get_generic_params ())
-      ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+      ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
   if (function.has_return_type ())
-    ResolveType::go (function.get_return_type ().get ());
+    ResolveType::go (function.get_return_type ());
 
   // we make a new scope so the names of parameters are resolved and shadowed
   // correctly
-  for (auto &it : function.get_function_params ())
-    if (!it->is_variadic ())
+  for (auto &param : function.get_function_params ())
+    if (!param->is_variadic ())
       {
-	auto param = static_cast<AST::FunctionParam *> (it.get ());
-	ResolveType::go (param->get_type ().get ());
+	auto &p = static_cast<AST::FunctionParam &> (*param);
+	ResolveType::go (p.get_type ());
       }
 
   // done
@@ -1056,7 +1055,7 @@ ResolveExternItem::visit (AST::ExternalStaticItem &item)
 {
   resolve_visibility (item.get_visibility ());
 
-  ResolveType::go (item.get_type ().get ());
+  ResolveType::go (item.get_type ());
 }
 
 } // namespace Resolver
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h
index 0133d2ca27f..1fd2647b0e3 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.h
+++ b/gcc/rust/resolve/rust-ast-resolve-item.h
@@ -52,7 +52,7 @@ class ResolveItem : public ResolverBase
 public:
   using Rust::Resolver::ResolverBase::visit;
 
-  static void go (AST::Item *item, const CanonicalPath &prefix,
+  static void go (AST::Item &item, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix);
 
   void visit (AST::TypeAlias &alias) override;
@@ -76,10 +76,10 @@ public:
   void visit (AST::UseDeclaration &) override;
 
 protected:
-  void resolve_impl_item (AST::AssociatedItem *item,
+  void resolve_impl_item (AST::AssociatedItem &item,
 			  const CanonicalPath &prefix,
 			  const CanonicalPath &canonical_prefix);
-  void resolve_extern_item (AST::ExternalItem *item);
+  void resolve_extern_item (AST::ExternalItem &item);
 
   ResolveItem (const CanonicalPath &prefix,
 	       const CanonicalPath &canonical_prefix);
@@ -93,7 +93,7 @@ class ResolveImplItems : public ResolveItem
   using Rust::Resolver::ResolveItem::visit;
 
 public:
-  static void go (AST::AssociatedItem *item, const CanonicalPath &prefix,
+  static void go (AST::AssociatedItem &item, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix);
 
   void visit (AST::TypeAlias &alias) override;
@@ -108,7 +108,7 @@ class ResolveExternItem : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::ExternalItem *item, const CanonicalPath &prefix,
+  static void go (AST::ExternalItem &item, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix);
 
   void visit (AST::Function &function) override;
diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resolve/rust-ast-resolve-path.cc
index 56c352e13ea..ec590302367 100644
--- a/gcc/rust/resolve/rust-ast-resolve-path.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-path.cc
@@ -26,35 +26,35 @@ namespace Resolver {
 ResolvePath::ResolvePath () : ResolverBase () {}
 
 NodeId
-ResolvePath::go (AST::PathInExpression *expr)
+ResolvePath::go (AST::PathInExpression &expr)
 {
   ResolvePath resolver;
   return resolver.resolve_path (expr);
 }
 
 NodeId
-ResolvePath::go (AST::QualifiedPathInExpression *expr)
+ResolvePath::go (AST::QualifiedPathInExpression &expr)
 {
   ResolvePath resolver;
   return resolver.resolve_path (expr);
 }
 
 NodeId
-ResolvePath::go (AST::SimplePath *expr)
+ResolvePath::go (AST::SimplePath &expr)
 {
   ResolvePath resolver;
   return resolver.resolve_path (expr);
 }
 
 NodeId
-ResolvePath::resolve_path (AST::PathInExpression *expr)
+ResolvePath::resolve_path (AST::PathInExpression &expr)
 {
   NodeId resolved_node_id = UNKNOWN_NODEID;
   NodeId module_scope_id = resolver->peek_current_module_scope ();
   NodeId previous_resolved_node_id = module_scope_id;
-  for (size_t i = 0; i < expr->get_segments ().size (); i++)
+  for (size_t i = 0; i < expr.get_segments ().size (); i++)
     {
-      auto &segment = expr->get_segments ().at (i);
+      auto &segment = expr.get_segments ().at (i);
       const AST::PathIdentSegment &ident_seg = segment.get_ident_segment ();
       bool is_first_segment = i == 0;
       resolved_node_id = UNKNOWN_NODEID;
@@ -219,14 +219,14 @@ ResolvePath::resolve_path (AST::PathInExpression *expr)
       // name scope first
       if (resolver->get_name_scope ().decl_was_declared_here (resolved_node_id))
 	{
-	  resolver->insert_resolved_name (expr->get_node_id (),
+	  resolver->insert_resolved_name (expr.get_node_id (),
 					  resolved_node_id);
 	}
       // check the type scope
       else if (resolver->get_type_scope ().decl_was_declared_here (
 		 resolved_node_id))
 	{
-	  resolver->insert_resolved_type (expr->get_node_id (),
+	  resolver->insert_resolved_type (expr.get_node_id (),
 					  resolved_node_id);
 	}
       else
@@ -238,14 +238,14 @@ ResolvePath::resolve_path (AST::PathInExpression *expr)
 }
 
 NodeId
-ResolvePath::resolve_path (AST::QualifiedPathInExpression *expr)
+ResolvePath::resolve_path (AST::QualifiedPathInExpression &expr)
 {
-  AST::QualifiedPathType &root_segment = expr->get_qualified_path_type ();
-  ResolveType::go (root_segment.get_type ().get ());
+  auto &root_segment = expr.get_qualified_path_type ();
+  ResolveType::go (root_segment.get_type ());
   if (root_segment.has_as_clause ())
-    ResolveType::go (&root_segment.get_as_type_path ());
+    ResolveType::go (root_segment.get_as_type_path ());
 
-  for (auto &segment : expr->get_segments ())
+  for (auto &segment : expr.get_segments ())
     {
       // we cant actually do anything with the segment itself since this is all
       // the job of the type system to figure it out but we can resolve any
@@ -260,18 +260,18 @@ ResolvePath::resolve_path (AST::QualifiedPathInExpression *expr)
 }
 
 NodeId
-ResolvePath::resolve_path (AST::SimplePath *expr)
+ResolvePath::resolve_path (AST::SimplePath &expr)
 {
   NodeId crate_scope_id = resolver->peek_crate_module_scope ();
   NodeId module_scope_id = resolver->peek_current_module_scope ();
 
   NodeId previous_resolved_node_id = UNKNOWN_NODEID;
   NodeId resolved_node_id = UNKNOWN_NODEID;
-  for (size_t i = 0; i < expr->get_segments ().size (); i++)
+  for (size_t i = 0; i < expr.get_segments ().size (); i++)
     {
-      AST::SimplePathSegment &segment = expr->get_segments ().at (i);
+      AST::SimplePathSegment &segment = expr.get_segments ().at (i);
       bool is_first_segment = i == 0;
-      bool is_final_segment = i >= (expr->get_segments ().size () - 1);
+      bool is_final_segment = i >= (expr.get_segments ().size () - 1);
       resolved_node_id = UNKNOWN_NODEID;
 
       if (segment.is_crate_path_seg ())
@@ -393,14 +393,14 @@ ResolvePath::resolve_path (AST::SimplePath *expr)
       // name scope first
       if (resolver->get_name_scope ().decl_was_declared_here (resolved_node_id))
 	{
-	  resolver->insert_resolved_name (expr->get_node_id (),
+	  resolver->insert_resolved_name (expr.get_node_id (),
 					  resolved_node_id);
 	}
       // check the type scope
       else if (resolver->get_type_scope ().decl_was_declared_here (
 		 resolved_node_id))
 	{
-	  resolver->insert_resolved_type (expr->get_node_id (),
+	  resolver->insert_resolved_type (expr.get_node_id (),
 					  resolved_node_id);
 	}
       else
diff --git a/gcc/rust/resolve/rust-ast-resolve-path.h b/gcc/rust/resolve/rust-ast-resolve-path.h
index 7aae19b5eac..08ce750c111 100644
--- a/gcc/rust/resolve/rust-ast-resolve-path.h
+++ b/gcc/rust/resolve/rust-ast-resolve-path.h
@@ -29,16 +29,16 @@ class ResolvePath : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static NodeId go (AST::PathInExpression *expr);
-  static NodeId go (AST::QualifiedPathInExpression *expr);
-  static NodeId go (AST::SimplePath *expr);
+  static NodeId go (AST::PathInExpression &expr);
+  static NodeId go (AST::QualifiedPathInExpression &expr);
+  static NodeId go (AST::SimplePath &expr);
 
 private:
   ResolvePath ();
 
-  NodeId resolve_path (AST::PathInExpression *expr);
-  NodeId resolve_path (AST::QualifiedPathInExpression *expr);
-  NodeId resolve_path (AST::SimplePath *expr);
+  NodeId resolve_path (AST::PathInExpression &expr);
+  NodeId resolve_path (AST::QualifiedPathInExpression &expr);
+  NodeId resolve_path (AST::SimplePath &expr);
 
   void
   resolve_simple_path_segments (CanonicalPath prefix, size_t offs,
diff --git a/gcc/rust/resolve/rust-ast-resolve-pattern.cc b/gcc/rust/resolve/rust-ast-resolve-pattern.cc
index 545fcf82d44..bfa6e3c4dfe 100644
--- a/gcc/rust/resolve/rust-ast-resolve-pattern.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-pattern.cc
@@ -23,7 +23,7 @@ namespace Rust {
 namespace Resolver {
 
 void
-PatternDeclaration::go (AST::Pattern *pattern, Rib::ItemType type)
+PatternDeclaration::go (AST::Pattern &pattern, Rib::ItemType type)
 {
   std::vector<PatternBinding> bindings
     = {PatternBinding (PatternBoundCtx::Product, std::set<Identifier> ())};
@@ -31,11 +31,11 @@ PatternDeclaration::go (AST::Pattern *pattern, Rib::ItemType type)
 }
 
 void
-PatternDeclaration::go (AST::Pattern *pattern, Rib::ItemType type,
+PatternDeclaration::go (AST::Pattern &pattern, Rib::ItemType type,
 			std::vector<PatternBinding> &bindings)
 {
   PatternDeclaration resolver (bindings, type);
-  pattern->accept_vis (resolver);
+  pattern.accept_vis (resolver);
 
   for (auto &map_entry : resolver.missing_bindings)
     {
@@ -71,28 +71,28 @@ PatternDeclaration::visit (AST::IdentifierPattern &pattern)
 void
 PatternDeclaration::visit (AST::GroupedPattern &pattern)
 {
-  pattern.get_pattern_in_parens ()->accept_vis (*this);
+  pattern.get_pattern_in_parens ().accept_vis (*this);
 }
 
 void
 PatternDeclaration::visit (AST::ReferencePattern &pattern)
 {
-  pattern.get_referenced_pattern ()->accept_vis (*this);
+  pattern.get_referenced_pattern ().accept_vis (*this);
 }
 
 void
 PatternDeclaration::visit (AST::PathInExpression &pattern)
 {
-  ResolvePath::go (&pattern);
+  ResolvePath::go (pattern);
 }
 
 void
 PatternDeclaration::visit (AST::TupleStructPattern &pattern)
 {
-  ResolvePath::go (&pattern.get_path ());
+  ResolvePath::go (pattern.get_path ());
 
-  std::unique_ptr<AST::TupleStructItems> &items = pattern.get_items ();
-  switch (items->get_item_type ())
+  AST::TupleStructItems &items = pattern.get_items ();
+  switch (items.get_item_type ())
     {
       case AST::TupleStructItems::RANGE: {
 	// TODO
@@ -101,12 +101,12 @@ PatternDeclaration::visit (AST::TupleStructPattern &pattern)
       break;
 
       case AST::TupleStructItems::NO_RANGE: {
-	AST::TupleStructItemsNoRange &items_no_range
-	  = static_cast<AST::TupleStructItemsNoRange &> (*items.get ());
+	auto &items_no_range
+	  = static_cast<AST::TupleStructItemsNoRange &> (items);
 
 	for (auto &inner_pattern : items_no_range.get_patterns ())
 	  {
-	    inner_pattern.get ()->accept_vis (*this);
+	    inner_pattern->accept_vis (*this);
 	  }
       }
       break;
@@ -116,7 +116,7 @@ PatternDeclaration::visit (AST::TupleStructPattern &pattern)
 void
 PatternDeclaration::visit (AST::StructPattern &pattern)
 {
-  ResolvePath::go (&pattern.get_path ());
+  ResolvePath::go (pattern.get_path ());
 
   auto &struct_pattern_elems = pattern.get_struct_pattern_elems ();
   for (auto &field : struct_pattern_elems.get_struct_pattern_fields ())
@@ -127,7 +127,7 @@ PatternDeclaration::visit (AST::StructPattern &pattern)
 	    AST::StructPatternFieldTuplePat &tuple
 	      = static_cast<AST::StructPatternFieldTuplePat &> (*field);
 
-	    tuple.get_index_pattern ()->accept_vis (*this);
+	    tuple.get_index_pattern ().accept_vis (*this);
 	  }
 	  break;
 
@@ -135,13 +135,12 @@ PatternDeclaration::visit (AST::StructPattern &pattern)
 	    AST::StructPatternFieldIdentPat &ident
 	      = static_cast<AST::StructPatternFieldIdentPat &> (*field);
 
-	    ident.get_ident_pattern ()->accept_vis (*this);
+	    ident.get_ident_pattern ().accept_vis (*this);
 	  }
 	  break;
 
 	  case AST::StructPatternField::ItemType::IDENT: {
-	    AST::StructPatternFieldIdent &ident
-	      = static_cast<AST::StructPatternFieldIdent &> (*field.get ());
+	    auto &ident = static_cast<AST::StructPatternFieldIdent &> (*field);
 
 	    Mutability mut
 	      = ident.is_mut () ? Mutability::Mut : Mutability::Imm;
@@ -158,13 +157,12 @@ PatternDeclaration::visit (AST::StructPattern &pattern)
 void
 PatternDeclaration::visit (AST::TuplePattern &pattern)
 {
-  std::unique_ptr<AST::TuplePatternItems> &items = pattern.get_items ();
-  switch (items->get_pattern_type ())
+  auto &items = pattern.get_items ();
+  switch (items.get_pattern_type ())
     {
       case AST::TuplePatternItems::TuplePatternItemType::MULTIPLE: {
-	AST::TuplePatternItemsMultiple &ref
-	  = *static_cast<AST::TuplePatternItemsMultiple *> (
-	    pattern.get_items ().get ());
+	auto &ref = static_cast<AST::TuplePatternItemsMultiple &> (
+	  pattern.get_items ());
 
 	for (auto &p : ref.get_patterns ())
 	  p->accept_vis (*this);
@@ -172,9 +170,8 @@ PatternDeclaration::visit (AST::TuplePattern &pattern)
       break;
 
       case AST::TuplePatternItems::TuplePatternItemType::RANGED: {
-	AST::TuplePatternItemsRanged &ref
-	  = *static_cast<AST::TuplePatternItemsRanged *> (
-	    pattern.get_items ().get ());
+	auto &ref
+	  = static_cast<AST::TuplePatternItemsRanged &> (pattern.get_items ());
 
 	for (auto &p : ref.get_lower_patterns ())
 	  p->accept_vis (*this);
@@ -342,27 +339,25 @@ PatternDeclaration::check_bindings_consistency (
 }
 
 static void
-resolve_range_pattern_bound (AST::RangePatternBound *bound)
+resolve_range_pattern_bound (AST::RangePatternBound &bound)
 {
-  switch (bound->get_bound_type ())
+  switch (bound.get_bound_type ())
     {
     case AST::RangePatternBound::RangePatternBoundType::LITERAL:
       // Nothing to resolve for a literal.
       break;
 
       case AST::RangePatternBound::RangePatternBoundType::PATH: {
-	AST::RangePatternBoundPath &ref
-	  = *static_cast<AST::RangePatternBoundPath *> (bound);
+	auto &ref = static_cast<AST::RangePatternBoundPath &> (bound);
 
-	ResolvePath::go (&ref.get_path ());
+	ResolvePath::go (ref.get_path ());
       }
       break;
 
       case AST::RangePatternBound::RangePatternBoundType::QUALPATH: {
-	AST::RangePatternBoundQualPath &ref
-	  = *static_cast<AST::RangePatternBoundQualPath *> (bound);
+	auto &ref = static_cast<AST::RangePatternBoundQualPath &> (bound);
 
-	ResolvePath::go (&ref.get_qualified_path ());
+	ResolvePath::go (ref.get_qualified_path ());
       }
       break;
     }
@@ -371,8 +366,8 @@ resolve_range_pattern_bound (AST::RangePatternBound *bound)
 void
 PatternDeclaration::visit (AST::RangePattern &pattern)
 {
-  resolve_range_pattern_bound (pattern.get_upper_bound ().get ());
-  resolve_range_pattern_bound (pattern.get_lower_bound ().get ());
+  resolve_range_pattern_bound (pattern.get_upper_bound ());
+  resolve_range_pattern_bound (pattern.get_lower_bound ());
 }
 
 void
diff --git a/gcc/rust/resolve/rust-ast-resolve-pattern.h b/gcc/rust/resolve/rust-ast-resolve-pattern.h
index 5974b503d6a..83607e5409a 100644
--- a/gcc/rust/resolve/rust-ast-resolve-pattern.h
+++ b/gcc/rust/resolve/rust-ast-resolve-pattern.h
@@ -95,8 +95,8 @@ class PatternDeclaration : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::Pattern *pattern, Rib::ItemType type);
-  static void go (AST::Pattern *pattern, Rib::ItemType type,
+  static void go (AST::Pattern &pattern, Rib::ItemType type);
+  static void go (AST::Pattern &pattern, Rib::ItemType type,
 		  std::vector<PatternBinding> &bindings);
 
   void visit (AST::IdentifierPattern &pattern) override;
diff --git a/gcc/rust/resolve/rust-ast-resolve-stmt.cc b/gcc/rust/resolve/rust-ast-resolve-stmt.cc
index 04dfdfed0ff..7b62d1f7f78 100644
--- a/gcc/rust/resolve/rust-ast-resolve-stmt.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-stmt.cc
@@ -30,31 +30,30 @@ ResolveStmt::visit (AST::ExternBlock &extern_block)
   resolve_visibility (extern_block.get_visibility ());
   for (auto &item : extern_block.get_extern_items ())
     {
-      ResolveToplevelExternItem::go (item.get (),
-				     CanonicalPath::create_empty ());
-      ResolveExternItem::go (item.get (), prefix, canonical_prefix);
+      ResolveToplevelExternItem::go (*item, CanonicalPath::create_empty ());
+      ResolveExternItem::go (*item, prefix, canonical_prefix);
     }
 }
 
 void
 ResolveStmt::visit (AST::Trait &trait)
 {
-  ResolveTopLevel::go (&trait, prefix, canonical_prefix);
-  ResolveItem::go (&trait, prefix, canonical_prefix);
+  ResolveTopLevel::go (trait, prefix, canonical_prefix);
+  ResolveItem::go (trait, prefix, canonical_prefix);
 }
 
 void
 ResolveStmt::visit (AST::InherentImpl &impl_block)
 {
-  ResolveTopLevel::go (&impl_block, prefix, canonical_prefix);
-  ResolveItem::go (&impl_block, prefix, canonical_prefix);
+  ResolveTopLevel::go (impl_block, prefix, canonical_prefix);
+  ResolveItem::go (impl_block, prefix, canonical_prefix);
 }
 
 void
 ResolveStmt::visit (AST::TraitImpl &impl_block)
 {
-  ResolveTopLevel::go (&impl_block, prefix, canonical_prefix);
-  ResolveItem::go (&impl_block, prefix, canonical_prefix);
+  ResolveTopLevel::go (impl_block, prefix, canonical_prefix);
+  ResolveItem::go (impl_block, prefix, canonical_prefix);
 }
 
 } // namespace Resolver
diff --git a/gcc/rust/resolve/rust-ast-resolve-stmt.h b/gcc/rust/resolve/rust-ast-resolve-stmt.h
index f9aa93ba7c4..d699bdec557 100644
--- a/gcc/rust/resolve/rust-ast-resolve-stmt.h
+++ b/gcc/rust/resolve/rust-ast-resolve-stmt.h
@@ -33,20 +33,20 @@ class ResolveStmt : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::Stmt *stmt, const CanonicalPath &prefix,
+  static void go (AST::Stmt &stmt, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix,
 		  const CanonicalPath &enum_prefix)
   {
-    if (stmt->is_marked_for_strip ())
+    if (stmt.is_marked_for_strip ())
       return;
 
     ResolveStmt resolver (prefix, canonical_prefix, enum_prefix);
-    stmt->accept_vis (resolver);
+    stmt.accept_vis (resolver);
   }
 
   void visit (AST::ExprStmt &stmt) override
   {
-    ResolveExpr::go (stmt.get_expr ().get (), prefix, canonical_prefix);
+    ResolveExpr::go (stmt.get_expr (), prefix, canonical_prefix);
   }
 
   void visit (AST::ConstantItem &constant) override
@@ -66,21 +66,20 @@ public:
 	rust_error_at (r, "redefined multiple times");
       });
 
-    ResolveType::go (constant.get_type ().get ());
-    ResolveExpr::go (constant.get_expr ().get (), prefix, canonical_prefix);
+    ResolveType::go (constant.get_type ());
+    ResolveExpr::go (constant.get_expr (), prefix, canonical_prefix);
   }
 
   void visit (AST::LetStmt &stmt) override
   {
     if (stmt.has_init_expr ())
       {
-	ResolveExpr::go (stmt.get_init_expr ().get (), prefix,
-			 canonical_prefix);
+	ResolveExpr::go (stmt.get_init_expr (), prefix, canonical_prefix);
       }
 
-    PatternDeclaration::go (stmt.get_pattern ().get (), Rib::ItemType::Var);
+    PatternDeclaration::go (stmt.get_pattern (), Rib::ItemType::Var);
     if (stmt.has_type ())
-      ResolveType::go (stmt.get_type ().get ());
+      ResolveType::go (stmt.get_type ());
   }
 
   void visit (AST::TupleStruct &struct_decl) override
@@ -107,11 +106,11 @@ public:
     if (struct_decl.has_generics ())
       {
 	for (auto &generic : struct_decl.get_generic_params ())
-	  ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+	  ResolveGenericParam::go (*generic, prefix, canonical_prefix);
       }
 
     for (AST::TupleField &field : struct_decl.get_fields ())
-      ResolveType::go (field.get_field_type ().get ());
+      ResolveType::go (field.get_field_type ());
 
     resolver->get_type_scope ().pop ();
   }
@@ -140,11 +139,11 @@ public:
     if (enum_decl.has_generics ())
       {
 	for (auto &generic : enum_decl.get_generic_params ())
-	  ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+	  ResolveGenericParam::go (*generic, prefix, canonical_prefix);
       }
 
     for (auto &variant : enum_decl.get_variants ())
-      ResolveStmt::go (variant.get (), path, canonical_prefix, path);
+      ResolveStmt::go (*variant, path, canonical_prefix, path);
 
     resolver->get_type_scope ().pop ();
   }
@@ -188,10 +187,10 @@ public:
 
     for (auto &field : item.get_tuple_fields ())
       {
-	if (field.get_field_type ()->is_marked_for_strip ())
+	if (field.get_field_type ().is_marked_for_strip ())
 	  continue;
 
-	ResolveType::go (field.get_field_type ().get ());
+	ResolveType::go (field.get_field_type ());
       }
   }
 
@@ -214,10 +213,10 @@ public:
 
     for (auto &field : item.get_struct_fields ())
       {
-	if (field.get_field_type ()->is_marked_for_strip ())
+	if (field.get_field_type ().is_marked_for_strip ())
 	  continue;
 
-	ResolveType::go (field.get_field_type ().get ());
+	ResolveType::go (field.get_field_type ());
       }
   }
 
@@ -265,15 +264,15 @@ public:
     if (struct_decl.has_generics ())
       {
 	for (auto &generic : struct_decl.get_generic_params ())
-	  ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+	  ResolveGenericParam::go (*generic, prefix, canonical_prefix);
       }
 
     for (AST::StructField &field : struct_decl.get_fields ())
       {
-	if (field.get_field_type ()->is_marked_for_strip ())
+	if (field.get_field_type ().is_marked_for_strip ())
 	  continue;
 
-	ResolveType::go (field.get_field_type ().get ());
+	ResolveType::go (field.get_field_type ());
       }
 
     resolver->get_type_scope ().pop ();
@@ -302,14 +301,14 @@ public:
 
     if (union_decl.has_generics ())
       for (auto &generic : union_decl.get_generic_params ())
-	ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+	ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
     for (AST::StructField &field : union_decl.get_variants ())
       {
-	if (field.get_field_type ()->is_marked_for_strip ())
+	if (field.get_field_type ().is_marked_for_strip ())
 	  continue;
 
-	ResolveType::go (field.get_field_type ().get ());
+	ResolveType::go (field.get_field_type ());
       }
 
     resolver->get_type_scope ().pop ();
@@ -343,10 +342,10 @@ public:
 
     if (function.has_generics ())
       for (auto &generic : function.get_generic_params ())
-	ResolveGenericParam::go (generic.get (), prefix, canonical_prefix);
+	ResolveGenericParam::go (*generic, prefix, canonical_prefix);
 
     if (function.has_return_type ())
-      ResolveType::go (function.get_return_type ().get ());
+      ResolveType::go (function.get_return_type ());
 
     std::vector<PatternBinding> bindings
       = {PatternBinding (PatternBoundCtx::Product, std::set<Identifier> ())};
@@ -357,28 +356,28 @@ public:
       {
 	if (p->is_variadic ())
 	  {
-	    auto param = static_cast<AST::VariadicParam *> (p.get ());
-	    PatternDeclaration::go (param->get_pattern ().get (),
-				    Rib::ItemType::Param, bindings);
+	    auto &param = static_cast<AST::VariadicParam &> (*p);
+	    PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param,
+				    bindings);
 	  }
 
 	else if (p->is_self ())
 	  {
-	    auto param = static_cast<AST::SelfParam *> (p.get ());
-	    ResolveType::go (param->get_type ().get ());
+	    auto &param = static_cast<AST::SelfParam &> (*p);
+	    ResolveType::go (param.get_type ());
 	  }
 	else
 	  {
-	    auto param = static_cast<AST::FunctionParam *> (p.get ());
+	    auto &param = static_cast<AST::FunctionParam &> (*p);
 
-	    ResolveType::go (param->get_type ().get ());
-	    PatternDeclaration::go (param->get_pattern ().get (),
-				    Rib::ItemType::Param, bindings);
+	    ResolveType::go (param.get_type ());
+	    PatternDeclaration::go (param.get_pattern (), Rib::ItemType::Param,
+				    bindings);
 	  }
       }
 
     // resolve the function body
-    ResolveExpr::go (function.get_definition ()->get (), path, cpath);
+    ResolveExpr::go (*function.get_definition ().value (), path, cpath);
 
     resolver->get_name_scope ().pop ();
     resolver->get_type_scope ().pop ();
diff --git a/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.cc b/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.cc
index b707343d3a2..c63da2368ee 100644
--- a/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.cc
@@ -23,12 +23,12 @@ namespace Rust {
 namespace Resolver {
 
 void
-ResolveStructExprField::go (AST::StructExprField *field,
+ResolveStructExprField::go (AST::StructExprField &field,
 			    const CanonicalPath &prefix,
 			    const CanonicalPath &canonical_prefix)
 {
   ResolveStructExprField resolver (prefix, canonical_prefix);
-  field->accept_vis (resolver);
+  field.accept_vis (resolver);
 }
 
 ResolveStructExprField::ResolveStructExprField (
@@ -39,13 +39,13 @@ ResolveStructExprField::ResolveStructExprField (
 void
 ResolveStructExprField::visit (AST::StructExprFieldIdentifierValue &field)
 {
-  ResolveExpr::go (field.get_value ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (field.get_value (), prefix, canonical_prefix);
 }
 
 void
 ResolveStructExprField::visit (AST::StructExprFieldIndexValue &field)
 {
-  ResolveExpr::go (field.get_value ().get (), prefix, canonical_prefix);
+  ResolveExpr::go (field.get_value (), prefix, canonical_prefix);
 }
 
 void
@@ -54,7 +54,7 @@ ResolveStructExprField::visit (AST::StructExprFieldIdentifier &field)
   AST::IdentifierExpr expr (field.get_field_name (), {}, field.get_locus ());
   expr.set_node_id (field.get_node_id ());
 
-  ResolveExpr::go (&expr, prefix, canonical_prefix);
+  ResolveExpr::go (expr, prefix, canonical_prefix);
 }
 
 } // namespace Resolver
diff --git a/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.h b/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.h
index 67bb9559372..3291c56671b 100644
--- a/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.h
+++ b/gcc/rust/resolve/rust-ast-resolve-struct-expr-field.h
@@ -31,7 +31,7 @@ class ResolveStructExprField : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::StructExprField *field, const CanonicalPath &prefix,
+  static void go (AST::StructExprField &field, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix);
 
   void visit (AST::StructExprFieldIdentifierValue &field) override;
diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h
index 73b4d29f19c..75769281ca9 100644
--- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h
+++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h
@@ -31,18 +31,18 @@ class ResolveTopLevel : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static void go (AST::Item *item, const CanonicalPath &prefix,
+  static void go (AST::Item &item, const CanonicalPath &prefix,
 		  const CanonicalPath &canonical_prefix)
   {
-    if (item->is_marked_for_strip ())
+    if (item.is_marked_for_strip ())
       return;
 
     ResolveTopLevel resolver (prefix, canonical_prefix);
-    item->accept_vis (resolver);
+    item.accept_vis (resolver);
 
     NodeId current_module = resolver.resolver->peek_current_module_scope ();
     resolver.mappings->insert_child_item_to_parent_module_mapping (
-      item->get_node_id (), current_module);
+      item.get_node_id (), current_module);
   }
 
   void visit (AST::Module &module) override
@@ -67,7 +67,7 @@ public:
 
     resolver->push_new_module_scope (module.get_node_id ());
     for (auto &item : module.get_items ())
-      ResolveTopLevel::go (item.get (), path, cpath);
+      ResolveTopLevel::go (*item, path, cpath);
 
     resolver->pop_module_scope ();
 
@@ -137,7 +137,7 @@ public:
 
     resolver->push_new_module_scope (enum_decl.get_node_id ());
     for (auto &variant : enum_decl.get_variants ())
-      ResolveTopLevel::go (variant.get (), path, cpath);
+      ResolveTopLevel::go (*variant, path, cpath);
 
     resolver->pop_module_scope ();
 
@@ -343,9 +343,9 @@ public:
 
   void visit (AST::InherentImpl &impl_block) override
   {
-    std::string raw_impl_type_path = impl_block.get_type ()->as_string ();
+    std::string raw_impl_type_path = impl_block.get_type ().as_string ();
     CanonicalPath impl_type_seg
-      = CanonicalPath::new_seg (impl_block.get_type ()->get_node_id (),
+      = CanonicalPath::new_seg (impl_block.get_type ().get_node_id (),
 				raw_impl_type_path);
 
     CanonicalPath impl_type
@@ -354,14 +354,14 @@ public:
     CanonicalPath impl_prefix = prefix.append (impl_type_seg);
 
     for (auto &impl_item : impl_block.get_impl_items ())
-      ResolveToplevelImplItem::go (impl_item.get (), impl_prefix);
+      ResolveToplevelImplItem::go (*impl_item, impl_prefix);
   }
 
   void visit (AST::TraitImpl &impl_block) override
   {
-    std::string raw_impl_type_path = impl_block.get_type ()->as_string ();
+    std::string raw_impl_type_path = impl_block.get_type ().as_string ();
     CanonicalPath impl_type_seg
-      = CanonicalPath::new_seg (impl_block.get_type ()->get_node_id (),
+      = CanonicalPath::new_seg (impl_block.get_type ().get_node_id (),
 				raw_impl_type_path);
 
     std::string raw_trait_type_path = impl_block.get_trait_path ().as_string ();
@@ -385,7 +385,7 @@ public:
       });
 
     for (auto &impl_item : impl_block.get_impl_items ())
-      ResolveToplevelImplItem::go (impl_item.get (), impl_prefix);
+      ResolveToplevelImplItem::go (*impl_item, impl_prefix);
   }
 
   void visit (AST::Trait &trait) override
@@ -416,7 +416,7 @@ public:
   {
     for (auto &item : extern_block.get_extern_items ())
       {
-	ResolveToplevelExternItem::go (item.get (), prefix);
+	ResolveToplevelExternItem::go (*item, prefix);
       }
   }
 
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.cc b/gcc/rust/resolve/rust-ast-resolve-type.cc
index bbb05380d2a..df1e7ee1a45 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-type.cc
@@ -27,15 +27,15 @@ namespace Resolver {
 void
 ResolveType::visit (AST::ArrayType &type)
 {
-  type.get_elem_type ()->accept_vis (*this);
-  ResolveExpr::go (type.get_size_expr ().get (), CanonicalPath::create_empty (),
+  type.get_elem_type ().accept_vis (*this);
+  ResolveExpr::go (type.get_size_expr (), CanonicalPath::create_empty (),
 		   CanonicalPath::create_empty ());
 }
 
 void
 ResolveType::visit (AST::TraitObjectTypeOneBound &type)
 {
-  ResolveTypeBound::go (&type.get_trait_bound ());
+  ResolveTypeBound::go (type.get_trait_bound ());
 }
 
 void
@@ -44,20 +44,20 @@ ResolveType::visit (AST::TraitObjectType &type)
   for (auto &bound : type.get_type_param_bounds ())
     {
       /* NodeId bound_resolved_id = */
-      ResolveTypeBound::go (bound.get ());
+      ResolveTypeBound::go (*bound);
     }
 }
 
 void
 ResolveType::visit (AST::ReferenceType &type)
 {
-  resolved_node = ResolveType::go (type.get_type_referenced ().get ());
+  resolved_node = ResolveType::go (type.get_type_referenced ());
 }
 
 void
 ResolveType::visit (AST::RawPointerType &type)
 {
-  resolved_node = ResolveType::go (type.get_type_pointed_to ().get ());
+  resolved_node = ResolveType::go (type.get_type_pointed_to ());
 }
 
 void
@@ -75,7 +75,7 @@ ResolveType::visit (AST::NeverType &)
 void
 ResolveType::visit (AST::SliceType &type)
 {
-  resolved_node = ResolveType::go (type.get_elem_type ().get ());
+  resolved_node = ResolveType::go (type.get_elem_type ());
 }
 
 // resolve relative type-paths
@@ -153,12 +153,12 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id)
 	  AST::TypePathFunction &fn = fnseg->get_type_path_function ();
 	  for (auto &param : fn.get_params ())
 	    {
-	      ResolveType::go (param.get ());
+	      ResolveType::go (*param);
 	    }
 
 	  if (fn.has_return_type ())
 	    {
-	      ResolveType::go (fn.get_return_type ().get ());
+	      ResolveType::go (fn.get_return_type ());
 	    }
 
 	  break;
@@ -318,11 +318,11 @@ ResolveRelativeQualTypePath::resolve_qual_seg (AST::QualifiedPathType &seg)
       return false;
     }
 
-  auto type = seg.get_type ().get ();
+  auto &type = seg.get_type ();
   ResolveType::go (type);
 
   if (seg.has_as_clause ())
-    ResolveType::go (&seg.get_as_type_path ());
+    ResolveType::go (seg.get_as_type_path ());
 
   return true;
 }
@@ -356,10 +356,10 @@ ResolveRelativeQualTypePath::visit (AST::TypePathSegment &seg)
 // resolve to canonical path
 
 bool
-ResolveTypeToCanonicalPath::go (AST::Type *type, CanonicalPath &result)
+ResolveTypeToCanonicalPath::go (AST::Type &type, CanonicalPath &result)
 {
   ResolveTypeToCanonicalPath resolver;
-  type->accept_vis (resolver);
+  type.accept_vis (resolver);
   result = resolver.result;
   return !resolver.result.is_empty ();
 }
@@ -402,8 +402,9 @@ ResolveTypeToCanonicalPath::visit (AST::TypePath &path)
 		    if (generic.get_kind () == AST::GenericArg::Kind::Type)
 		      {
 			CanonicalPath arg = CanonicalPath::create_empty ();
-			bool ok = ResolveTypeToCanonicalPath::go (
-			  generic.get_type ().get (), arg);
+			bool ok
+			  = ResolveTypeToCanonicalPath::go (generic.get_type (),
+							    arg);
 			if (ok)
 			  args.push_back (std::move (arg));
 		      }
@@ -444,8 +445,7 @@ void
 ResolveTypeToCanonicalPath::visit (AST::ReferenceType &type)
 {
   CanonicalPath path = CanonicalPath::create_empty ();
-  bool ok
-    = ResolveTypeToCanonicalPath::go (type.get_type_referenced ().get (), path);
+  bool ok = ResolveTypeToCanonicalPath::go (type.get_type_referenced (), path);
   if (ok)
     {
       std::string ref_type_str = type.is_mut () ? "mut" : "";
@@ -458,8 +458,7 @@ void
 ResolveTypeToCanonicalPath::visit (AST::RawPointerType &type)
 {
   CanonicalPath path = CanonicalPath::create_empty ();
-  bool ok
-    = ResolveTypeToCanonicalPath::go (type.get_type_pointed_to ().get (), path);
+  bool ok = ResolveTypeToCanonicalPath::go (type.get_type_pointed_to (), path);
   if (ok)
     {
       std::string ptr_type_str
@@ -474,7 +473,7 @@ void
 ResolveTypeToCanonicalPath::visit (AST::SliceType &type)
 {
   CanonicalPath path = CanonicalPath::create_empty ();
-  bool ok = ResolveTypeToCanonicalPath::go (type.get_elem_type ().get (), path);
+  bool ok = ResolveTypeToCanonicalPath::go (type.get_elem_type (), path);
   if (ok)
     {
       std::string slice_path = "[" + path.get () + "]";
@@ -487,7 +486,7 @@ ResolveTypeToCanonicalPath::visit (AST::TraitObjectTypeOneBound &type)
 {
   CanonicalPath path = CanonicalPath::create_empty ();
   bool ok
-    = ResolveTypeToCanonicalPath::go (&type.get_trait_bound ().get_type_path (),
+    = ResolveTypeToCanonicalPath::go (type.get_trait_bound ().get_type_path (),
 				      path);
   if (ok)
     {
@@ -550,10 +549,10 @@ ResolveGenericArgs::resolve_disambiguated_generic (AST::GenericArg &arg)
   switch (arg.get_kind ())
     {
     case AST::GenericArg::Kind::Const:
-      ResolveExpr::go (arg.get_expression ().get (), prefix, canonical_prefix);
+      ResolveExpr::go (arg.get_expression (), prefix, canonical_prefix);
       break;
     case AST::GenericArg::Kind::Type:
-      ResolveType::go (arg.get_type ().get ());
+      ResolveType::go (arg.get_type ());
       break;
     default:
       rust_unreachable ();
@@ -584,7 +583,7 @@ ResolveGenericArgs::go (AST::GenericArgs &generic_args,
 
   for (auto &binding : generic_args.get_binding_args ())
     {
-      ResolveType::go (binding.get_type ().get ());
+      ResolveType::go (binding.get_type ());
     }
 }
 
diff --git a/gcc/rust/resolve/rust-ast-resolve-type.h b/gcc/rust/resolve/rust-ast-resolve-type.h
index c69a8287de2..f1031e9b1ed 100644
--- a/gcc/rust/resolve/rust-ast-resolve-type.h
+++ b/gcc/rust/resolve/rust-ast-resolve-type.h
@@ -56,20 +56,20 @@ class ResolveType : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static NodeId go (AST::Type *type)
+  static NodeId go (AST::Type &type)
   {
     ResolveType resolver;
-    type->accept_vis (resolver);
+    type.accept_vis (resolver);
     return resolver.resolved_node;
   }
 
   void visit (AST::BareFunctionType &fntype) override
   {
     for (auto &param : fntype.get_function_params ())
-      ResolveType::go (param.get_type ().get ());
+      ResolveType::go (param.get_type ());
 
     if (fntype.has_return_type ())
-      ResolveType::go (fntype.get_return_type ().get ());
+      ResolveType::go (fntype.get_return_type ());
   }
 
   void visit (AST::TupleType &tuple) override
@@ -81,7 +81,7 @@ public:
       }
 
     for (auto &elem : tuple.get_elems ())
-      ResolveType::go (elem.get ());
+      ResolveType::go (*elem);
   }
 
   void visit (AST::TypePath &path) override
@@ -119,16 +119,16 @@ class ResolveTypeBound : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static NodeId go (AST::TypeParamBound *type)
+  static NodeId go (AST::TypeParamBound &type)
   {
     ResolveTypeBound resolver;
-    type->accept_vis (resolver);
+    type.accept_vis (resolver);
     return resolver.resolved_node;
   };
 
   void visit (AST::TraitBound &bound) override
   {
-    resolved_node = ResolveType::go (&bound.get_type_path ());
+    resolved_node = ResolveType::go (bound.get_type_path ());
   }
 
 private:
@@ -140,21 +140,21 @@ class ResolveGenericParam : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static NodeId go (AST::GenericParam *param, const CanonicalPath &prefix,
+  static NodeId go (AST::GenericParam &param, const CanonicalPath &prefix,
 		    const CanonicalPath &canonical_prefix)
   {
     ResolveGenericParam resolver (prefix, canonical_prefix);
-    param->accept_vis (resolver);
+    param.accept_vis (resolver);
     return resolver.resolved_node;
   }
 
   void visit (AST::ConstGenericParam &param) override
   {
-    ResolveType::go (param.get_type ().get ());
+    ResolveType::go (param.get_type ());
 
     if (param.has_default_value ())
-      ResolveExpr::go (param.get_default_value ().get_expression ().get (),
-		       prefix, canonical_prefix);
+      ResolveExpr::go (param.get_default_value ().get_expression (), prefix,
+		       canonical_prefix);
 
     ok = true;
   }
@@ -163,13 +163,13 @@ public:
   {
     // if it has a type lets resolve it
     if (param.has_type ())
-      ResolveType::go (param.get_type ().get ());
+      ResolveType::go (param.get_type ());
 
     if (param.has_type_param_bounds ())
       {
 	for (auto &bound : param.get_type_param_bounds ())
 	  {
-	    ResolveTypeBound::go (bound.get ());
+	    ResolveTypeBound::go (*bound);
 	  }
       }
 
@@ -213,12 +213,12 @@ public:
 
   void visit (AST::TypeBoundWhereClauseItem &item) override
   {
-    ResolveType::go (item.get_type ().get ());
+    ResolveType::go (item.get_type ());
     if (item.has_type_param_bounds ())
       {
 	for (auto &bound : item.get_type_param_bounds ())
 	  {
-	    ResolveTypeBound::go (bound.get ());
+	    ResolveTypeBound::go (*bound);
 	  }
       }
   }
@@ -232,7 +232,7 @@ class ResolveTypeToCanonicalPath : public ResolverBase
   using Rust::Resolver::ResolverBase::visit;
 
 public:
-  static bool go (AST::Type *type, CanonicalPath &result);
+  static bool go (AST::Type &type, CanonicalPath &result);
 
   void visit (AST::TypePath &path) override;
 
diff --git a/gcc/rust/resolve/rust-ast-resolve.cc b/gcc/rust/resolve/rust-ast-resolve.cc
index 401434cb667..4273ae34055 100644
--- a/gcc/rust/resolve/rust-ast-resolve.cc
+++ b/gcc/rust/resolve/rust-ast-resolve.cc
@@ -92,9 +92,8 @@ NameResolution::go (AST::Crate &crate)
   // first gather the top-level namespace names then we drill down so this
   // allows for resolving forward declarations since an impl block might have
   // a Self type Foo which is defined after the impl block for example.
-  for (auto it = crate.items.begin (); it != crate.items.end (); it++)
-    ResolveTopLevel::go (it->get (), CanonicalPath::create_empty (),
-			 crate_prefix);
+  for (auto &item : crate.items)
+    ResolveTopLevel::go (*item, CanonicalPath::create_empty (), crate_prefix);
 
   // FIXME remove this
   if (saw_errors ())
@@ -104,8 +103,8 @@ NameResolution::go (AST::Crate &crate)
     }
 
   // next we can drill down into the items and their scopes
-  for (auto it = crate.items.begin (); it != crate.items.end (); it++)
-    ResolveItem::go (it->get (), CanonicalPath::create_empty (), crate_prefix);
+  for (auto &item : crate.items)
+    ResolveItem::go (*item, CanonicalPath::create_empty (), crate_prefix);
 
   // done
   resolver->pop_module_scope ();
diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 789cc4eef42..e2609d13c9a 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -35,7 +35,7 @@ DefaultResolver::visit (AST::BlockExpr &expr)
       stmt->accept_vis (*this);
 
     if (expr.has_tail_expr ())
-      expr.get_tail_expr ()->accept_vis (*this);
+      expr.get_tail_expr ().accept_vis (*this);
   };
 
   ctx.scoped (Rib::Kind::Normal, expr.get_node_id (), inner_fn);
@@ -61,21 +61,21 @@ DefaultResolver::visit (AST::Function &function)
       {
 	if (p->is_variadic ())
 	  {
-	    auto param = static_cast<AST::VariadicParam *> (p.get ());
-	    if (param->has_pattern ())
-	      param->get_pattern ()->accept_vis (*this);
+	    auto &param = static_cast<AST::VariadicParam &> (*p);
+	    if (param.has_pattern ())
+	      param.get_pattern ().accept_vis (*this);
 	  }
 	else if (p->is_self ())
 	  {
-	    auto param = static_cast<AST::SelfParam *> (p.get ());
-	    param->get_type ()->accept_vis (*this);
-	    param->get_lifetime ().accept_vis (*this);
+	    auto &param = static_cast<AST::SelfParam &> (*p);
+	    param.get_type ().accept_vis (*this);
+	    param.get_lifetime ().accept_vis (*this);
 	  }
 	else
 	  {
-	    auto param = static_cast<AST::FunctionParam *> (p.get ());
-	    param->get_pattern ()->accept_vis (*this);
-	    param->get_type ()->accept_vis (*this);
+	    auto &param = static_cast<AST::FunctionParam &> (*p);
+	    param.get_pattern ().accept_vis (*this);
+	    param.get_type ().accept_vis (*this);
 	  }
       }
 
@@ -90,9 +90,9 @@ void
 DefaultResolver::visit (AST::ForLoopExpr &expr)
 {
   ctx.scoped (Rib::Kind::Normal, expr.get_node_id (), [this, &expr] () {
-    expr.get_pattern ()->accept_vis (*this);
-    expr.get_iterator_expr ()->accept_vis (*this);
-    expr.get_loop_block ()->accept_vis (*this);
+    expr.get_pattern ().accept_vis (*this);
+    expr.get_iterator_expr ().accept_vis (*this);
+    expr.get_loop_block ().accept_vis (*this);
   });
 }
 
@@ -188,12 +188,12 @@ DefaultResolver::visit (AST::ClosureExprInner &expr)
       if (param.is_error ())
 	continue;
 
-      param.get_pattern ()->accept_vis (*this);
+      param.get_pattern ().accept_vis (*this);
       if (param.has_type_given ())
-	param.get_type ()->accept_vis (*this);
+	param.get_type ().accept_vis (*this);
     }
 
-  expr.get_definition_expr ()->accept_vis (*this);
+  expr.get_definition_expr ().accept_vis (*this);
 }
 
 void
@@ -207,13 +207,13 @@ DefaultResolver::visit (AST::ClosureExprInnerTyped &expr)
       if (param.is_error ())
 	continue;
 
-      param.get_pattern ()->accept_vis (*this);
+      param.get_pattern ().accept_vis (*this);
       if (param.has_type_given ())
-	param.get_type ()->accept_vis (*this);
+	param.get_type ().accept_vis (*this);
     }
 
-  expr.get_definition_block ()->accept_vis (*this);
-  expr.get_return_type ()->accept_vis (*this);
+  expr.get_definition_block ().accept_vis (*this);
+  expr.get_return_type ().accept_vis (*this);
 }
 
 void
@@ -263,16 +263,16 @@ DefaultResolver::visit (AST::WhileLetLoopExpr &expr)
 void
 DefaultResolver::visit (AST::IfExpr &expr)
 {
-  expr.get_condition_expr ()->accept_vis (*this);
-  expr.get_if_block ()->accept_vis (*this);
+  expr.get_condition_expr ().accept_vis (*this);
+  expr.get_if_block ().accept_vis (*this);
 }
 
 void
 DefaultResolver::visit (AST::IfExprConseqElse &expr)
 {
-  expr.get_condition_expr ()->accept_vis (*this);
-  expr.get_if_block ()->accept_vis (*this);
-  expr.get_else_block ()->accept_vis (*this);
+  expr.get_condition_expr ().accept_vis (*this);
+  expr.get_if_block ().accept_vis (*this);
+  expr.get_else_block ().accept_vis (*this);
 }
 
 void
@@ -289,14 +289,14 @@ DefaultResolver::visit (AST::MatchExpr &expr)
   if (expr.is_marked_for_strip ())
     return;
 
-  expr.get_scrutinee_expr ()->accept_vis (*this);
+  expr.get_scrutinee_expr ().accept_vis (*this);
   for (auto &arm : expr.get_match_cases ())
     {
-      arm.get_expr ()->accept_vis (*this);
+      arm.get_expr ().accept_vis (*this);
       for (auto &pat : arm.get_arm ().get_patterns ())
 	pat->accept_vis (*this);
       if (arm.get_arm ().has_match_arm_guard ())
-	arm.get_arm ().get_guard_expr ()->accept_vis (*this);
+	arm.get_arm ().get_guard_expr ().accept_vis (*this);
     }
 }
 
@@ -339,7 +339,7 @@ DefaultResolver::visit (AST::PathInExpression &expr)
 	  arg.accept_vis (*this);
 	for (auto &arg : args.get_binding_args ())
 	  if (!arg.is_error ())
-	    arg.get_type ()->accept_vis (*this);
+	    arg.get_type ().accept_vis (*this);
 	for (auto &arg : args.get_lifetime_args ())
 	  arg.accept_vis (*this);
       }
@@ -441,27 +441,27 @@ void
 DefaultResolver::visit (AST::EnumItemTuple &item)
 {
   for (auto &field : item.get_tuple_fields ())
-    field.get_field_type ()->accept_vis (*this);
+    field.get_field_type ().accept_vis (*this);
 }
 
 void
 DefaultResolver::visit (AST::EnumItemStruct &item)
 {
   for (auto &field : item.get_struct_fields ())
-    field.get_field_type ()->accept_vis (*this);
+    field.get_field_type ().accept_vis (*this);
 }
 
 void
 DefaultResolver::visit (AST::EnumItemDiscriminant &item)
 {
   if (item.has_expr ())
-    item.get_expr ()->accept_vis (*this);
+    item.get_expr ().accept_vis (*this);
 }
 
 void
 DefaultResolver::visit (AST::ConstantItem &item)
 {
-  auto expr_vis = [this, &item] () { item.get_expr ()->accept_vis (*this); };
+  auto expr_vis = [this, &item] () { item.get_expr ().accept_vis (*this); };
 
   // FIXME: Why do we need a Rib here?
   ctx.scoped (Rib::Kind::Item, item.get_node_id (), expr_vis);
@@ -470,7 +470,7 @@ DefaultResolver::visit (AST::ConstantItem &item)
 void
 DefaultResolver::visit (AST::StaticItem &item)
 {
-  auto expr_vis = [this, &item] () { item.get_expr ()->accept_vis (*this); };
+  auto expr_vis = [this, &item] () { item.get_expr ().accept_vis (*this); };
 
   // FIXME: Why do we need a Rib here?
   ctx.scoped (Rib::Kind::ConstantItem, item.get_node_id (), expr_vis);
diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc
index 5447084cfdd..af44439cdab 100644
--- a/gcc/rust/resolve/rust-early-name-resolver.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver.cc
@@ -90,13 +90,13 @@ EarlyNameResolver::resolve_generic_args (AST::GenericArgs &generic_args)
     arg.accept_vis (*this);
 
   for (auto &arg : generic_args.get_binding_args ())
-    arg.get_type ()->accept_vis (*this);
+    arg.get_type ().accept_vis (*this);
 }
 
 void
 EarlyNameResolver::resolve_qualified_path_type (AST::QualifiedPathType &path)
 {
-  path.get_type ()->accept_vis (*this);
+  path.get_type ().accept_vis (*this);
 
   if (path.has_as_clause ())
     path.get_as_type_path ().accept_vis (*this);
@@ -227,7 +227,7 @@ EarlyNameResolver::visit (AST::BlockExpr &expr)
       stmt->accept_vis (*this);
 
     if (expr.has_tail_expr ())
-      expr.get_tail_expr ()->accept_vis (*this);
+      expr.get_tail_expr ().accept_vis (*this);
   });
 }
 
@@ -243,37 +243,37 @@ void
 EarlyNameResolver::visit (AST::ForLoopExpr &expr)
 {
   scoped (expr.get_node_id (), [&expr, this] () {
-    expr.get_pattern ()->accept_vis (*this);
-    expr.get_iterator_expr ()->accept_vis (*this);
-    expr.get_loop_block ()->accept_vis (*this);
+    expr.get_pattern ().accept_vis (*this);
+    expr.get_iterator_expr ().accept_vis (*this);
+    expr.get_loop_block ().accept_vis (*this);
   });
 }
 
 void
 EarlyNameResolver::visit (AST::IfLetExpr &expr)
 {
-  expr.get_value_expr ()->accept_vis (*this);
+  expr.get_value_expr ().accept_vis (*this);
 
   scoped (expr.get_node_id (),
-	  [&expr, this] () { expr.get_if_block ()->accept_vis (*this); });
+	  [&expr, this] () { expr.get_if_block ().accept_vis (*this); });
 }
 
 void
 EarlyNameResolver::visit (AST::MatchExpr &expr)
 {
-  expr.get_scrutinee_expr ()->accept_vis (*this);
+  expr.get_scrutinee_expr ().accept_vis (*this);
 
   scoped (expr.get_node_id (), [&expr, this] () {
     for (auto &arm : expr.get_match_cases ())
       {
 	scoped (arm.get_node_id (), [&arm, this] () {
 	  if (arm.get_arm ().has_match_arm_guard ())
-	    arm.get_arm ().get_guard_expr ()->accept_vis (*this);
+	    arm.get_arm ().get_guard_expr ().accept_vis (*this);
 
 	  for (auto &pattern : arm.get_arm ().get_patterns ())
 	    pattern->accept_vis (*this);
 
-	  arm.get_expr ()->accept_vis (*this);
+	  arm.get_expr ().accept_vis (*this);
 	});
       }
   });
@@ -365,7 +365,7 @@ EarlyNameResolver::visit (AST::Trait &trait)
 void
 EarlyNameResolver::visit (AST::InherentImpl &impl)
 {
-  impl.get_type ()->accept_vis (*this);
+  impl.get_type ().accept_vis (*this);
 
   for (auto &generic : impl.get_generic_params ())
     generic->accept_vis (*this);
@@ -379,7 +379,7 @@ EarlyNameResolver::visit (AST::InherentImpl &impl)
 void
 EarlyNameResolver::visit (AST::TraitImpl &impl)
 {
-  impl.get_type ()->accept_vis (*this);
+  impl.get_type ().accept_vis (*this);
 
   for (auto &generic : impl.get_generic_params ())
     generic->accept_vis (*this);
@@ -558,7 +558,7 @@ EarlyNameResolver::visit (AST::StructPattern &)
 void
 EarlyNameResolver::visit (AST::TupleStructPattern &pattern)
 {
-  pattern.get_items ()->accept_vis (*this);
+  pattern.get_items ().accept_vis (*this);
 }
 
 void
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 6470a63c9ad..446a1c6a41b 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -213,7 +213,7 @@ TopLevel::visit (AST::BlockExpr &expr)
       stmt->accept_vis (*this);
 
     if (expr.has_tail_expr ())
-      expr.get_tail_expr ()->accept_vis (*this);
+      expr.get_tail_expr ().accept_vis (*this);
   };
 
   ctx.scoped (Rib::Kind::Normal, expr.get_node_id (), sub_vis);
@@ -223,7 +223,7 @@ void
 TopLevel::visit (AST::StaticItem &static_item)
 {
   auto sub_vis
-    = [this, &static_item] () { static_item.get_expr ()->accept_vis (*this); };
+    = [this, &static_item] () { static_item.get_expr ().accept_vis (*this); };
 
   ctx.scoped (Rib::Kind::Item, static_item.get_node_id (), sub_vis);
 }
@@ -299,7 +299,7 @@ void
 TopLevel::visit (AST::ConstantItem &const_item)
 {
   auto expr_vis
-    = [this, &const_item] () { const_item.get_expr ()->accept_vis (*this); };
+    = [this, &const_item] () { const_item.get_expr ().accept_vis (*this); };
 
   ctx.scoped (Rib::Kind::ConstantItem, const_item.get_node_id (), expr_vis);
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 046/125] gccrs: macro: Use MacroInvocation's node_id in ExternalItem constructor.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (43 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 045/125] gccrs: Replace unique_ptr references with references Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 047/125] gccrs: format-args: Add base for expanding FormatArgs nodes Arthur Cohen
                   ` (78 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-macro.h: Use proper node id instead of the one in the base
	Expr class - which is uninitialized.
---
 gcc/rust/ast/rust-macro.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index 5b9ff3f22c8..507e595e379 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -727,7 +727,7 @@ private:
   {}
 
   MacroInvocation (const MacroInvocation &other)
-    : TraitItem (other.locus), ExternalItem (Expr::node_id),
+    : TraitItem (other.locus), ExternalItem (other.node_id),
       outer_attrs (other.outer_attrs), locus (other.locus),
       node_id (other.node_id), invoc_data (other.invoc_data),
       is_semi_coloned (other.is_semi_coloned), kind (other.kind),
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 047/125] gccrs: format-args: Add base for expanding FormatArgs nodes
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (44 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 046/125] gccrs: macro: Use MacroInvocation's node_id in ExternalItem constructor Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory Arthur Cohen
                   ` (77 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* Make-lang.in: Add new object.
	* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Remove calls to
	FormatArgsLowering.
	* expand/rust-expand-format-args.cc: New file.
	* expand/rust-expand-format-args.h: New file.
---
 gcc/rust/Make-lang.in                      |  1 +
 gcc/rust/expand/rust-expand-format-args.cc | 43 ++++++++++++++++++++++
 gcc/rust/expand/rust-expand-format-args.h  | 32 ++++++++++++++++
 gcc/rust/hir/rust-ast-lower-expr.cc        |  4 --
 4 files changed, 76 insertions(+), 4 deletions(-)
 create mode 100644 gcc/rust/expand/rust-expand-format-args.cc
 create mode 100644 gcc/rust/expand/rust-expand-format-args.h

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index f166b02340d..cbb9da0fe43 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -205,6 +205,7 @@ GRS_OBJS = \
     rust/rust-unicode.o \
     rust/rust-punycode.o \
 	rust/rust-lang-item.o \
+	rust/rust-expand-format-args.o \
     $(END)
 # removed object files from here
 
diff --git a/gcc/rust/expand/rust-expand-format-args.cc b/gcc/rust/expand/rust-expand-format-args.cc
new file mode 100644
index 00000000000..52249cb17e3
--- /dev/null
+++ b/gcc/rust/expand/rust-expand-format-args.cc
@@ -0,0 +1,43 @@
+// Copyright (C) 2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-expand-format-args.h"
+#include "rust-builtin-ast-nodes.h"
+
+namespace Rust {
+
+tl::optional<AST::Fragment>
+expand_format_args (AST::FormatArgs &fmt)
+{
+  for (const auto &node : fmt.get_template ().get_pieces ())
+    {
+      switch (node.tag)
+	{
+	case Fmt::Piece::Tag::String:
+	  // rust_debug ("[ARTHUR]: %s", node.string._0.c_str ());
+
+	case Fmt::Piece::Tag::NextArgument:
+	  rust_debug ("[ARTHUR]: NextArgument");
+	  break;
+	}
+    }
+
+  return tl::nullopt;
+}
+
+} // namespace Rust
diff --git a/gcc/rust/expand/rust-expand-format-args.h b/gcc/rust/expand/rust-expand-format-args.h
new file mode 100644
index 00000000000..1481f3605ed
--- /dev/null
+++ b/gcc/rust/expand/rust-expand-format-args.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_EXPAND_FORMAT_ARGS_H
+#define RUST_EXPAND_FORMAT_ARGS_H
+
+#include "optional.h"
+#include "rust-ast-fragment.h"
+
+namespace Rust {
+
+tl::optional<AST::Fragment>
+expand_format_args (AST::FormatArgs &fmt);
+
+} // namespace Rust
+
+#endif //! RUST_EXPAND_FORMAT_ARGS_H
diff --git a/gcc/rust/hir/rust-ast-lower-expr.cc b/gcc/rust/hir/rust-ast-lower-expr.cc
index 6944db9b9cc..c414643bb91 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.cc
+++ b/gcc/rust/hir/rust-ast-lower-expr.cc
@@ -19,7 +19,6 @@
 #include "rust-ast-lower-expr.h"
 #include "rust-ast-lower-base.h"
 #include "rust-ast-lower-block.h"
-#include "rust-ast-lower-format-args.h"
 #include "rust-ast-lower-struct-field-expr.h"
 #include "rust-ast-lower-pattern.h"
 #include "rust-ast-lower-type.h"
@@ -824,9 +823,6 @@ ASTLoweringExpr::visit (AST::ClosureExprInnerTyped &expr)
 void
 ASTLoweringExpr::visit (AST::FormatArgs &fmt)
 {
-  // Lowering FormatArgs is complex, and this file is already very long
-  translated = FormatArgsLowering ().go (fmt);
-
   rust_sorry_at (fmt.get_locus (),
 		 "FormatArgs lowering is not implemented yet");
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (45 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 047/125] gccrs: format-args: Add base for expanding FormatArgs nodes Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-11-23 20:17   ` Rust: Work around 'error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope' (was: [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory) Thomas Schwinge
  2024-08-01 14:56 ` [PATCH 049/125] gccrs: format-args: Add basic expansion of unnamed Display::fmt arguments Arthur Cohen
                   ` (76 subsequent siblings)
  123 siblings, 1 reply; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-fmt.cc (ffi::RustHamster::to_string): New.
	(Pieces::collect): Adapt to use new handle API.
	(Pieces::~Pieces): Likewise.
	(Pieces::Pieces): Likewise.
	(Pieces::operator=): Likewise.
	* ast/rust-fmt.h (struct RustString): Add members.
	(struct FormatArgsHandle): New.
	(clone_pieces): Adapt for new FFI API.
	(destroy_pieces): Likewise.
	(struct Pieces): Store new FormatArgsHandle type.
	* expand/rust-expand-format-args.cc (expand_format_args): Use proper
	namespace.
	* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): FormatArgs
	nodes are already resolved, so do nothing.

libgrust/ChangeLog:

	* libformat_parser/src/lib.rs: Use new Handle struct and expose it.
---
 gcc/rust/ast/rust-fmt.cc                   |  32 ++++---
 gcc/rust/ast/rust-fmt.h                    |  46 ++++++---
 gcc/rust/expand/rust-expand-format-args.cc |   4 +-
 gcc/rust/resolve/rust-ast-resolve-base.cc  |   5 +-
 libgrust/libformat_parser/src/lib.rs       | 105 ++++++++++++++++-----
 5 files changed, 133 insertions(+), 59 deletions(-)

diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index b82e089fc41..fda02e530fd 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -22,44 +22,48 @@
 namespace Rust {
 namespace Fmt {
 
+std::string
+ffi::RustHamster::to_string () const
+{
+  return std::string (ptr, len);
+}
+
 Pieces
-Pieces::collect (std::string &&to_parse, bool append_newline)
+Pieces::collect (const std::string &to_parse, bool append_newline)
 {
-  auto piece_slice = collect_pieces (to_parse.c_str (), append_newline);
+  auto handle = ffi::collect_pieces (to_parse.c_str (), append_newline);
 
   // this performs multiple copies, can we avoid them maybe?
   // TODO: Instead of just creating a vec of, basically, `ffi::Piece`s, we
   // should transform them into the proper C++ type which we can work with. so
   // transform all the strings into C++ strings? all the Option<T> into
   // tl::optional<T>?
-  auto pieces = std::vector<Piece> (piece_slice.base_ptr,
-				    piece_slice.base_ptr + piece_slice.len);
+  auto pieces_vector = std::vector<ffi::Piece> (handle.piece_slice.base_ptr,
+						handle.piece_slice.base_ptr
+						  + handle.piece_slice.len);
 
-  return Pieces (std::move (pieces), piece_slice, std::move (to_parse));
+  return Pieces (handle, std::move (pieces_vector));
 }
 
-Pieces::~Pieces () { destroy_pieces (slice); }
+Pieces::~Pieces () { ffi::destroy_pieces (handle); }
 
-Pieces::Pieces (const Pieces &other)
-  : pieces_vector (other.pieces_vector), to_parse (other.to_parse)
+Pieces::Pieces (const Pieces &other) : pieces_vector (other.pieces_vector)
 {
-  slice = clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap);
+  handle = ffi::clone_pieces (other.handle);
 }
 
 Pieces &
 Pieces::operator= (const Pieces &other)
 {
-  slice = clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap);
-  to_parse = other.to_parse;
+  handle = ffi::clone_pieces (other.handle);
+  pieces_vector = other.pieces_vector;
 
   return *this;
 }
 
 Pieces::Pieces (Pieces &&other)
   : pieces_vector (std::move (other.pieces_vector)),
-    slice (
-      clone_pieces (other.slice.base_ptr, other.slice.len, other.slice.cap)),
-    to_parse (std::move (other.to_parse))
+    handle (clone_pieces (other.handle))
 {}
 
 } // namespace Fmt
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index ba412f9958c..6a0c116b841 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -20,15 +20,21 @@
 #define RUST_FMT_H
 
 #include "rust-system.h"
+#include <cstddef>
 
 // FIXME: How to encode Option?
 
 namespace Rust {
 namespace Fmt {
 
+namespace ffi {
+
 struct RustHamster
 {
-  // hehe
+  const char *ptr;
+  size_t len;
+
+  std::string to_string () const;
 };
 
 /// Enum of alignments which are supported.
@@ -240,21 +246,36 @@ struct PieceSlice
   size_t cap;
 };
 
+struct RustString
+{
+  const unsigned char *ptr;
+  size_t len;
+  size_t cap;
+};
+
+struct FormatArgsHandle
+{
+  PieceSlice piece_slice;
+  RustString rust_string;
+};
+
 extern "C" {
 
-PieceSlice
+FormatArgsHandle
 collect_pieces (const char *input, bool append_newline);
 
-PieceSlice
-clone_pieces (const Piece *base_ptr, size_t len, size_t cap);
+FormatArgsHandle
+clone_pieces (const FormatArgsHandle &);
 
-void destroy_pieces (PieceSlice);
+void destroy_pieces (FormatArgsHandle);
 
 } // extern "C"
 
+} // namespace ffi
+
 struct Pieces
 {
-  static Pieces collect (std::string &&to_parse, bool append_newline);
+  static Pieces collect (const std::string &to_parse, bool append_newline);
   ~Pieces ();
 
   Pieces (const Pieces &other);
@@ -262,7 +283,7 @@ struct Pieces
 
   Pieces (Pieces &&other);
 
-  const std::vector<Piece> &get_pieces () const { return pieces_vector; }
+  const std::vector<ffi::Piece> &get_pieces () const { return pieces_vector; }
 
   // {
   //   slice = clone_pieces (&other.slice);
@@ -272,19 +293,16 @@ struct Pieces
   // }
 
 private:
-  Pieces (std::vector<Piece> &&pieces_vector, PieceSlice slice,
-	  std::string &&to_parse)
-    : pieces_vector (std::move (pieces_vector)), slice (slice),
-      to_parse (std::move (to_parse))
+  Pieces (ffi::FormatArgsHandle handle, std::vector<ffi::Piece> &&pieces_vector)
+    : pieces_vector (std::move (pieces_vector)), handle (handle)
   {}
 
-  std::vector<Piece> pieces_vector;
+  std::vector<ffi::Piece> pieces_vector;
 
   // this memory is held for FFI reasons - it needs to be released and cloned
   // precisely, so try to not access it/modify it if possible. you should
   // instead work with `pieces_vector`
-  PieceSlice slice;
-  std::string to_parse;
+  ffi::FormatArgsHandle handle;
 };
 
 } // namespace Fmt
diff --git a/gcc/rust/expand/rust-expand-format-args.cc b/gcc/rust/expand/rust-expand-format-args.cc
index 52249cb17e3..276ffd58c50 100644
--- a/gcc/rust/expand/rust-expand-format-args.cc
+++ b/gcc/rust/expand/rust-expand-format-args.cc
@@ -28,10 +28,10 @@ expand_format_args (AST::FormatArgs &fmt)
     {
       switch (node.tag)
 	{
-	case Fmt::Piece::Tag::String:
+	case Fmt::ffi::Piece::Tag::String:
 	  // rust_debug ("[ARTHUR]: %s", node.string._0.c_str ());
 
-	case Fmt::Piece::Tag::NextArgument:
+	case Fmt::ffi::Piece::Tag::NextArgument:
 	  rust_debug ("[ARTHUR]: NextArgument");
 	  break;
 	}
diff --git a/gcc/rust/resolve/rust-ast-resolve-base.cc b/gcc/rust/resolve/rust-ast-resolve-base.cc
index 1939a2056e4..fa1be197941 100644
--- a/gcc/rust/resolve/rust-ast-resolve-base.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-base.cc
@@ -648,10 +648,7 @@ ResolverBase::visit (AST::FunctionParam &)
 
 void
 ResolverBase::visit (AST::FormatArgs &fmt)
-{
-  rust_sorry_at (fmt.get_locus (), "%s:%u: unimplemented FormatArgs visitor",
-		 __FILE__, __LINE__);
-}
+{}
 
 } // namespace Resolver
 } // namespace Rust
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 6bf78c4f2a8..84fac38e224 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -27,6 +27,23 @@ where
 mod ffi {
     use super::IntoFFI;
 
+    // FIXME: We need to ensure we deal with memory properly - whether it's owned by the C++ side or the Rust side
+    #[derive(Copy, Clone, PartialEq, Eq, Debug)]
+    #[repr(C)]
+    pub struct RustHamster {
+        ptr: *const u8,
+        len: usize,
+    }
+
+    impl<'a> From<&'a str> for RustHamster {
+        fn from(s: &'a str) -> RustHamster {
+            RustHamster {
+                ptr: s.as_ptr(),
+                len: s.len(),
+            }
+        }
+    }
+
     // Note: copied from rustc_span
     /// Range inside of a `Span` used for diagnostics when we only have access to relative positions.
     #[derive(Copy, Clone, PartialEq, Eq, Debug)]
@@ -81,7 +98,7 @@ mod ffi {
     #[repr(C)]
     pub enum Piece<'a> {
         /// A literal string which should directly be emitted
-        String(&'a str),
+        String(RustHamster),
         /// This describes that formatting should process the next argument (as
         /// specified inside) for emission.
         // do we need a pointer here? we're doing big cloning anyway
@@ -201,7 +218,7 @@ mod ffi {
     impl<'a> From<generic_format_parser::Piece<'a>> for Piece<'a> {
         fn from(old: generic_format_parser::Piece<'a>) -> Self {
             match old {
-                generic_format_parser::Piece::String(x) => Piece::String(x),
+                generic_format_parser::Piece::String(x) => Piece::String(x.into()),
                 generic_format_parser::Piece::NextArgument(x) => {
                     // FIXME: This is problematic - if we do this, then we probably run into the issue that the Box
                     // is freed at the end of the call to collect_pieces. if we just .leak() it, then we have
@@ -336,53 +353,91 @@ pub struct PieceSlice {
     cap: usize,
 }
 
-#[no_mangle]
-pub extern "C" fn collect_pieces(input: *const libc::c_char, append_newline: bool) -> PieceSlice {
-    dbg!(input);
+#[repr(C)]
+// FIXME: we should probably use FFIString here
+pub struct RustString {
+    ptr: *const u8,
+    len: usize,
+    cap: usize,
+}
+
+#[repr(C)]
+pub struct FormatArgsHandle(PieceSlice, RustString);
 
+#[no_mangle]
+pub extern "C" fn collect_pieces(
+    input: *const libc::c_char,
+    append_newline: bool,
+) -> FormatArgsHandle {
     // FIXME: Add comment
     let str = unsafe { CStr::from_ptr(input) };
+    let str = str.to_str().unwrap().to_owned();
 
-    // FIXME: No unwrap
-    let pieces: Vec<ffi::Piece<'_>> =
-        rust::collect_pieces(str.to_str().unwrap(), None, None, append_newline)
-            .into_iter()
-            .map(Into::into)
-            .collect();
+    // we are never going to free this string here (we leak it later on), so we can extend its lifetime
+    // to send it across an FFI boundary.
+    // FIXME: Is that correct?
+    let s = &str;
+    let s = unsafe { std::mem::transmute::<&'_ str, &'static str>(s) };
 
-    println!("[ARTHUR]: debug: {:?}, {:?}", pieces.as_ptr(), pieces.len());
+    // FIXME: No unwrap
+    let pieces: Vec<ffi::Piece<'_>> = rust::collect_pieces(s, None, None, append_newline)
+        .into_iter()
+        .map(Into::into)
+        .collect();
 
-    PieceSlice {
+    let piece_slice = PieceSlice {
         len: pieces.len(),
         cap: pieces.capacity(),
         base_ptr: pieces.leak().as_mut_ptr(),
-    }
+    };
+    let rust_string = RustString {
+        len: str.len(),
+        cap: str.capacity(),
+        ptr: str.leak().as_ptr(),
+    };
+
+    FormatArgsHandle(piece_slice, rust_string)
 }
 
 #[no_mangle]
-pub unsafe extern "C" fn destroy_pieces(PieceSlice { base_ptr, len, cap }: PieceSlice) {
-    eprintln!("[ARTHUR] destroying pieces: {base_ptr:?} {len} {cap}");
+pub unsafe extern "C" fn destroy_pieces(FormatArgsHandle(piece_slice, s): FormatArgsHandle) {
+    let PieceSlice { base_ptr, len, cap } = piece_slice;
     drop(Vec::from_raw_parts(base_ptr, len, cap));
+
+    let RustString { ptr, len, cap } = s;
+    drop(String::from_raw_parts(ptr as *mut u8, len, cap));
 }
 
 #[no_mangle]
 pub extern "C" fn clone_pieces(
-    base_ptr: *mut ffi::Piece<'static>,
-    len: usize,
-    cap: usize,
-) -> PieceSlice {
-    eprintln!("[ARTHUR] cloning pieces: {base_ptr:?} {len} {cap}");
+    FormatArgsHandle(piece_slice, s): &FormatArgsHandle,
+) -> FormatArgsHandle {
+    let PieceSlice { base_ptr, len, cap } = *piece_slice;
 
     let v = unsafe { Vec::from_raw_parts(base_ptr, len, cap) };
-
     let cloned_v = v.clone();
 
     // FIXME: Add documentation
     v.leak();
 
-    PieceSlice {
+    let piece_slice = PieceSlice {
         len: cloned_v.len(),
         cap: cloned_v.capacity(),
-        base_ptr: dbg!(cloned_v.leak().as_mut_ptr()),
-    }
+        base_ptr: cloned_v.leak().as_mut_ptr(),
+    };
+
+    let RustString { ptr, len, cap } = *s;
+    let s = unsafe { String::from_raw_parts(ptr as *mut u8, len, cap) };
+    let cloned_s = s.clone();
+
+    // FIXME: Documentation
+    s.leak();
+
+    let rust_string = RustString {
+        len: cloned_s.len(),
+        cap: cloned_s.capacity(),
+        ptr: cloned_s.leak().as_ptr(),
+    };
+
+    FormatArgsHandle(piece_slice, rust_string)
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 049/125] gccrs: format-args: Add basic expansion of unnamed Display::fmt arguments.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (46 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 050/125] gccrs: format-args: Add basic test case Arthur Cohen
                   ` (75 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* ast/rust-ast-builder.h: Rename AST::AstBuilder -> AST::Builder
	* ast/rust-ast-builder.cc: Likewise.
	* expand/rust-derive.cc: Use new AST::Builder name.
	* expand/rust-derive.h: Likewise.
	* ast/rust-builtin-ast-nodes.h: Add required getters.
	* expand/rust-expand-format-args.cc (format_arg): New.
	(get_trait_name): New.
	(expand_format_args): Properly expand basic format_args!() invocations.
	* expand/rust-expand-format-args.h (expand_format_args): Fix signature.
	* expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler):
	Call into expand_format_args().
---
 gcc/rust/ast/rust-ast-builder.cc           |  66 ++++++++-----
 gcc/rust/ast/rust-ast-builder.h            |  51 ++++++----
 gcc/rust/ast/rust-builtin-ast-nodes.h      |   5 +
 gcc/rust/expand/rust-derive.cc             |   2 +-
 gcc/rust/expand/rust-derive.h              |   2 +-
 gcc/rust/expand/rust-expand-format-args.cc | 107 +++++++++++++++++++--
 gcc/rust/expand/rust-expand-format-args.h  |   5 +-
 gcc/rust/expand/rust-macro-builtins.cc     |  23 +++--
 8 files changed, 205 insertions(+), 56 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-builder.cc b/gcc/rust/ast/rust-ast-builder.cc
index 0d5218c6381..1138d3dc2b2 100644
--- a/gcc/rust/ast/rust-ast-builder.cc
+++ b/gcc/rust/ast/rust-ast-builder.cc
@@ -17,53 +17,73 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-ast-builder.h"
+#include "rust-ast-full-decls.h"
 #include "rust-ast-full.h"
+#include "rust-expr.h"
+#include "rust-token.h"
+#include "rust-make-unique.h"
 
 namespace Rust {
 namespace AST {
 
 std::unique_ptr<Expr>
-AstBuilder::call (std::unique_ptr<Expr> &&path,
-		  std::vector<std::unique_ptr<Expr>> &&args)
+Builder::literal_string (std::string &&content) const
+{
+  return std::unique_ptr<Expr> (
+    new AST::LiteralExpr (std::move (content), Literal::LitType::STRING,
+			  PrimitiveCoreType::CORETYPE_STR, {}, loc));
+}
+
+std::unique_ptr<Expr>
+Builder::call (std::unique_ptr<Expr> &&path,
+	       std::vector<std::unique_ptr<Expr>> &&args) const
 {
   return std::unique_ptr<Expr> (
     new CallExpr (std::move (path), std::move (args), {}, loc));
 }
 
 std::unique_ptr<Expr>
-AstBuilder::identifier (std::string name)
+Builder::array (std::vector<std::unique_ptr<Expr>> &&members) const
+{
+  auto elts = Rust::make_unique<ArrayElemsValues> (std::move (members), loc);
+
+  return std::unique_ptr<Expr> (new ArrayExpr (std::move (elts), {}, {}, loc));
+}
+
+std::unique_ptr<Expr>
+Builder::identifier (std::string name) const
 {
   return std::unique_ptr<Expr> (new IdentifierExpr (name, {}, loc));
 }
 
 std::unique_ptr<Expr>
-AstBuilder::tuple_idx (std::string receiver, int idx)
+Builder::tuple_idx (std::string receiver, int idx) const
 {
   return std::unique_ptr<Expr> (
     new TupleIndexExpr (identifier (receiver), idx, {}, loc));
 }
 
 FunctionQualifiers
-AstBuilder::fn_qualifiers ()
+Builder::fn_qualifiers () const
 {
   return FunctionQualifiers (loc, Async::No, Const::No, Unsafety::Normal);
 }
 
 PathExprSegment
-AstBuilder::path_segment (std::string seg)
+Builder::path_segment (std::string seg) const
 {
   return PathExprSegment (PathIdentSegment (seg, loc), loc);
 }
 
 std::unique_ptr<TypePathSegment>
-AstBuilder::type_path_segment (std::string seg)
+Builder::type_path_segment (std::string seg) const
 {
   return std::unique_ptr<TypePathSegment> (
     new TypePathSegment (seg, false, loc));
 }
 
 std::unique_ptr<Type>
-AstBuilder::single_type_path (std::string type)
+Builder::single_type_path (std::string type) const
 {
   auto segments = std::vector<std::unique_ptr<TypePathSegment>> ();
   segments.emplace_back (type_path_segment (type));
@@ -72,7 +92,7 @@ AstBuilder::single_type_path (std::string type)
 }
 
 PathInExpression
-AstBuilder::path_in_expression (std::vector<std::string> &&segments)
+Builder::path_in_expression (std::vector<std::string> &&segments) const
 {
   auto path_segments = std::vector<PathExprSegment> ();
   for (auto &seg : segments)
@@ -82,8 +102,8 @@ AstBuilder::path_in_expression (std::vector<std::string> &&segments)
 }
 
 std::unique_ptr<Expr>
-AstBuilder::block (std::vector<std::unique_ptr<Stmt>> &&stmts,
-		   std::unique_ptr<Expr> &&tail_expr)
+Builder::block (std::vector<std::unique_ptr<Stmt>> &&stmts,
+		std::unique_ptr<Expr> &&tail_expr) const
 {
   return std::unique_ptr<Expr> (new BlockExpr (std::move (stmts),
 					       std::move (tail_expr), {}, {},
@@ -91,8 +111,8 @@ AstBuilder::block (std::vector<std::unique_ptr<Stmt>> &&stmts,
 }
 
 std::unique_ptr<Stmt>
-AstBuilder::let (std::unique_ptr<Pattern> pattern, std::unique_ptr<Type> type,
-		 std::unique_ptr<Expr> init)
+Builder::let (std::unique_ptr<Pattern> pattern, std::unique_ptr<Type> type,
+	      std::unique_ptr<Expr> init) const
 {
   return std::unique_ptr<Stmt> (new LetStmt (std::move (pattern),
 					     std::move (init), std::move (type),
@@ -100,28 +120,29 @@ AstBuilder::let (std::unique_ptr<Pattern> pattern, std::unique_ptr<Type> type,
 }
 
 std::unique_ptr<Expr>
-AstBuilder::ref (std::unique_ptr<Expr> &&of, bool mut)
+Builder::ref (std::unique_ptr<Expr> &&of, bool mut) const
 {
   return std::unique_ptr<Expr> (
     new BorrowExpr (std::move (of), mut, /* is double */ false, {}, loc));
 }
 
 std::unique_ptr<Expr>
-AstBuilder::deref (std::unique_ptr<Expr> &&of)
+Builder::deref (std::unique_ptr<Expr> &&of) const
 {
   return std::unique_ptr<Expr> (new DereferenceExpr (std::move (of), {}, loc));
 }
 
 std::unique_ptr<Expr>
-AstBuilder::struct_expr_struct (std::string struct_name)
+Builder::struct_expr_struct (std::string struct_name) const
 {
   return std::unique_ptr<Expr> (
     new StructExprStruct (path_in_expression ({struct_name}), {}, {}, loc));
 }
 
 std::unique_ptr<Expr>
-AstBuilder::struct_expr (std::string struct_name,
-			 std::vector<std::unique_ptr<StructExprField>> &&fields)
+Builder::struct_expr (
+  std::string struct_name,
+  std::vector<std::unique_ptr<StructExprField>> &&fields) const
 {
   return std::unique_ptr<Expr> (
     new StructExprStructFields (path_in_expression ({struct_name}),
@@ -129,22 +150,23 @@ AstBuilder::struct_expr (std::string struct_name,
 }
 
 std::unique_ptr<StructExprField>
-AstBuilder::struct_expr_field (std::string field_name,
-			       std::unique_ptr<Expr> &&value)
+Builder::struct_expr_field (std::string field_name,
+			    std::unique_ptr<Expr> &&value) const
 {
   return std::unique_ptr<StructExprField> (
     new StructExprFieldIdentifierValue (field_name, std::move (value), loc));
 }
 
 std::unique_ptr<Expr>
-AstBuilder::field_access (std::unique_ptr<Expr> &&instance, std::string field)
+Builder::field_access (std::unique_ptr<Expr> &&instance,
+		       std::string field) const
 {
   return std::unique_ptr<Expr> (
     new FieldAccessExpr (std::move (instance), field, {}, loc));
 }
 
 std::unique_ptr<Pattern>
-AstBuilder::wildcard ()
+Builder::wildcard () const
 {
   return std::unique_ptr<Pattern> (new WildcardPattern (loc));
 }
diff --git a/gcc/rust/ast/rust-ast-builder.h b/gcc/rust/ast/rust-ast-builder.h
index c0b4fa7b2cb..5c33954131f 100644
--- a/gcc/rust/ast/rust-ast-builder.h
+++ b/gcc/rust/ast/rust-ast-builder.h
@@ -28,80 +28,93 @@ namespace AST {
 /* Builder class with helper methods to create AST nodes. This builder is
  * tailored towards generating multiple AST nodes from a single location, and
  * may not be suitable to other purposes */
-class AstBuilder
+class Builder
 {
 public:
-  AstBuilder (location_t loc) : loc (loc) {}
+  Builder (location_t loc) : loc (loc) {}
+
+  /* Create a string literal expression ("content") */
+  std::unique_ptr<Expr> literal_string (std::string &&content) const;
 
   /* Create an identifier expression (`variable`) */
-  std::unique_ptr<Expr> identifier (std::string name);
+  std::unique_ptr<Expr> identifier (std::string name) const;
 
   /* Create a tuple index expression (`receiver.0`) */
-  std::unique_ptr<Expr> tuple_idx (std::string receiver, int idx);
+  std::unique_ptr<Expr> tuple_idx (std::string receiver, int idx) const;
 
   /* Create a reference to an expression (`&of`) */
-  std::unique_ptr<Expr> ref (std::unique_ptr<Expr> &&of, bool mut = false);
+  std::unique_ptr<Expr> ref (std::unique_ptr<Expr> &&of,
+			     bool mut = false) const;
 
   /* Create a dereference of an expression (`*of`) */
-  std::unique_ptr<Expr> deref (std::unique_ptr<Expr> &&of);
+  std::unique_ptr<Expr> deref (std::unique_ptr<Expr> &&of) const;
 
   /* Create a block with an optional tail expression */
   std::unique_ptr<Expr> block (std::vector<std::unique_ptr<Stmt>> &&stmts,
-			       std::unique_ptr<Expr> &&tail_expr = nullptr);
+			       std::unique_ptr<Expr> &&tail_expr
+			       = nullptr) const;
 
   /* Create a let binding with an optional type and initializer (`let <name> :
    * <type> = <init>`) */
   std::unique_ptr<Stmt> let (std::unique_ptr<Pattern> pattern,
 			     std::unique_ptr<Type> type = nullptr,
-			     std::unique_ptr<Expr> init = nullptr);
+			     std::unique_ptr<Expr> init = nullptr) const;
 
   /**
    * Create a call expression to a function, struct or enum variant, given its
    * arguments (`path(arg0, arg1, arg2)`)
    */
   std::unique_ptr<Expr> call (std::unique_ptr<Expr> &&path,
-			      std::vector<std::unique_ptr<Expr>> &&args);
+			      std::vector<std::unique_ptr<Expr>> &&args) const;
+
+  /**
+   * Create an array expression (`[member0, member1, member2]`)
+   */
+  std::unique_ptr<Expr>
+  array (std::vector<std::unique_ptr<Expr>> &&members) const;
 
   /* Empty function qualifiers, with no specific qualifiers */
-  FunctionQualifiers fn_qualifiers ();
+  FunctionQualifiers fn_qualifiers () const;
 
   /* Create a single path segment from one string */
-  PathExprSegment path_segment (std::string seg);
+  PathExprSegment path_segment (std::string seg) const;
 
   /* And similarly for type path segments */
-  std::unique_ptr<TypePathSegment> type_path_segment (std::string seg);
+  std::unique_ptr<TypePathSegment> type_path_segment (std::string seg) const;
 
   /* Create a Type from a single string - the most basic kind of type in our AST
    */
-  std::unique_ptr<Type> single_type_path (std::string type);
+  std::unique_ptr<Type> single_type_path (std::string type) const;
 
   /**
    * Create a path in expression from multiple segments (`Clone::clone`). You
    * do not need to separate the segments using `::`, you can simply provide a
    * vector of strings to the functions which will get turned into path segments
    */
-  PathInExpression path_in_expression (std::vector<std::string> &&segments);
+  PathInExpression
+  path_in_expression (std::vector<std::string> &&segments) const;
 
   /* Create a struct expression for unit structs (`S`) */
-  std::unique_ptr<Expr> struct_expr_struct (std::string struct_name);
+  std::unique_ptr<Expr> struct_expr_struct (std::string struct_name) const;
 
   /**
    * Create an expression for struct instantiation with fields (`S { a, b: c }`)
    */
   std::unique_ptr<Expr>
   struct_expr (std::string struct_name,
-	       std::vector<std::unique_ptr<StructExprField>> &&fields);
+	       std::vector<std::unique_ptr<StructExprField>> &&fields) const;
 
   /* Create a field expression for struct instantiation (`field_name: value`) */
   std::unique_ptr<StructExprField>
-  struct_expr_field (std::string field_name, std::unique_ptr<Expr> &&value);
+  struct_expr_field (std::string field_name,
+		     std::unique_ptr<Expr> &&value) const;
 
   /* Create a field access expression (`instance.field`) */
   std::unique_ptr<Expr> field_access (std::unique_ptr<Expr> &&instance,
-				      std::string field);
+				      std::string field) const;
 
   /* Create a wildcard pattern (`_`) */
-  std::unique_ptr<Pattern> wildcard ();
+  std::unique_ptr<Pattern> wildcard () const;
 
 private:
   /**
diff --git a/gcc/rust/ast/rust-builtin-ast-nodes.h b/gcc/rust/ast/rust-builtin-ast-nodes.h
index 780d1a9d4e9..3e21d7e718d 100644
--- a/gcc/rust/ast/rust-builtin-ast-nodes.h
+++ b/gcc/rust/ast/rust-builtin-ast-nodes.h
@@ -132,6 +132,9 @@ public:
     return *this;
   }
 
+  FormatArgumentKind get_kind () const { return kind; }
+  const Expr &get_expr () const { return *expr; }
+
 private:
   FormatArgument (FormatArgumentKind::Kind kind, tl::optional<Identifier> ident,
 		  std::unique_ptr<Expr> expr)
@@ -159,6 +162,7 @@ public:
   FormatArguments &operator= (const FormatArguments &other) = default;
 
   void push (FormatArgument &&elt) { args.emplace_back (std::move (elt)); }
+  const FormatArgument at (size_t idx) const { return args.at (idx); }
 
 private:
   std::vector<FormatArgument> args;
@@ -195,6 +199,7 @@ public:
   void accept_vis (AST::ASTVisitor &vis) override;
 
   const Fmt::Pieces &get_template () const { return template_pieces; }
+  const FormatArguments &get_arguments () const { return arguments; }
   virtual location_t get_locus () const override;
 
 private:
diff --git a/gcc/rust/expand/rust-derive.cc b/gcc/rust/expand/rust-derive.cc
index e9927df1559..4177004eccf 100644
--- a/gcc/rust/expand/rust-derive.cc
+++ b/gcc/rust/expand/rust-derive.cc
@@ -24,7 +24,7 @@ namespace Rust {
 namespace AST {
 
 DeriveVisitor::DeriveVisitor (location_t loc)
-  : loc (loc), builder (AstBuilder (loc))
+  : loc (loc), builder (Builder (loc))
 {}
 
 std::unique_ptr<Item>
diff --git a/gcc/rust/expand/rust-derive.h b/gcc/rust/expand/rust-derive.h
index cbe5bbbcbea..48f6594a636 100644
--- a/gcc/rust/expand/rust-derive.h
+++ b/gcc/rust/expand/rust-derive.h
@@ -41,7 +41,7 @@ protected:
   DeriveVisitor (location_t loc);
 
   location_t loc;
-  AstBuilder builder;
+  Builder builder;
 
 private:
   // the 4 "allowed" visitors, which a derive-visitor can specify and override
diff --git a/gcc/rust/expand/rust-expand-format-args.cc b/gcc/rust/expand/rust-expand-format-args.cc
index 276ffd58c50..3f76344ea5b 100644
--- a/gcc/rust/expand/rust-expand-format-args.cc
+++ b/gcc/rust/expand/rust-expand-format-args.cc
@@ -17,27 +17,122 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-expand-format-args.h"
+#include "rust-ast-fragment.h"
+#include "rust-ast.h"
 #include "rust-builtin-ast-nodes.h"
+#include "rust-ast-builder.h"
+#include "rust-diagnostics.h"
+#include "rust-expr.h"
+#include "rust-fmt.h"
+#include "rust-path.h"
+#include "rust-system.h"
+#include "rust-token.h"
 
 namespace Rust {
+namespace Fmt {
+
+static std::unique_ptr<AST::Expr>
+format_arg (const AST::Builder &builder, std::unique_ptr<AST::Expr> &&to_format,
+	    const std::string &trait)
+{
+  auto formatter_fn = std::unique_ptr<AST::Expr> (new AST::PathInExpression (
+    builder.path_in_expression ({"core", "fmt", trait, "fmt"})));
+
+  auto path = std::unique_ptr<AST::Expr> (new AST::PathInExpression (
+    builder.path_in_expression ({"core", "fmt", "ArgumentV1", "new"})));
+
+  auto args = std::vector<std::unique_ptr<AST::Expr>> ();
+  args.emplace_back (std::move (to_format));
+  args.emplace_back (std::move (formatter_fn));
+
+  return builder.call (std::move (path), std::move (args));
+}
+
+const std::string &
+get_trait_name (ffi::FormatSpec format_specifier)
+{
+  static const std::unordered_map<std::string, std::string> spec_map = {
+    {"", "Display"},   {"?", "Debug"},	  {"e", "LowerExp"},
+    {"E", "UpperExp"}, {"o", "Octal"},	  {"p", "Pointer"},
+    {"b", "Binary"},   {"x", "LowerHex"}, {"X", "UpperHex"},
+  };
+
+  auto it = spec_map.find (format_specifier.ty.to_string ());
+
+  if (it == spec_map.end ())
+    rust_unreachable ();
+
+  return it->second;
+}
 
 tl::optional<AST::Fragment>
-expand_format_args (AST::FormatArgs &fmt)
+expand_format_args (AST::FormatArgs &fmt,
+		    std::vector<std::unique_ptr<AST::Token>> &&tokens)
 {
+  auto loc = fmt.get_locus ();
+  auto builder = AST::Builder (loc);
+  auto &arguments = fmt.get_arguments ();
+
+  auto static_pieces = std::vector<std::unique_ptr<AST::Expr>> ();
+  auto args
+    = std::vector<std::pair<std::unique_ptr<AST::Expr>, ffi::FormatSpec>> ();
+
   for (const auto &node : fmt.get_template ().get_pieces ())
     {
       switch (node.tag)
 	{
-	case Fmt::ffi::Piece::Tag::String:
-	  // rust_debug ("[ARTHUR]: %s", node.string._0.c_str ());
+	case ffi::Piece::Tag::String:
+	  static_pieces.emplace_back (
+	    builder.literal_string (node.string._0.to_string ()));
+	  break;
+	  case ffi::Piece::Tag::NextArgument: {
+	    auto next_argument = node.next_argument._0;
+	    switch (node.next_argument._0.position.tag)
+	      {
+		case ffi::Position::Tag::ArgumentImplicitlyIs: {
+		  auto idx = next_argument.position.argument_implicitly_is._0;
+		  auto trait = next_argument.format;
+		  auto arg = arguments.at (idx);
+
+		  // FIXME(Arthur): This API sucks
+		  rust_assert (arg.get_kind ().kind
+			       == AST::FormatArgumentKind::Kind::Normal);
 
-	case Fmt::ffi::Piece::Tag::NextArgument:
-	  rust_debug ("[ARTHUR]: NextArgument");
+		  args.push_back ({arg.get_expr ().clone_expr (), trait});
+		}
+		break;
+	      case ffi::Position::Tag::ArgumentIs:
+	      case ffi::Position::Tag::ArgumentNamed:
+		rust_sorry_at (loc, "unhandled argument position specifier");
+		break;
+	      }
+	  }
 	  break;
 	}
     }
 
-  return tl::nullopt;
+  auto args_array = std::vector<std::unique_ptr<AST::Expr>> ();
+  for (auto &&arg : args)
+    args_array.emplace_back (format_arg (builder,
+					 builder.ref (std::move (arg.first)),
+					 get_trait_name (arg.second)));
+
+  auto pieces = builder.ref (builder.array (std::move (static_pieces)));
+  auto args_slice = builder.ref (builder.array (std::move (args_array)));
+
+  auto final_path = make_unique<AST::PathInExpression> (
+    builder.path_in_expression ({"core", "fmt", "Arguments", "new_v1"}));
+  auto final_args = std::vector<std::unique_ptr<AST::Expr>> ();
+  final_args.emplace_back (std::move (pieces));
+  final_args.emplace_back (std::move (args_slice));
+
+  auto final_call
+    = builder.call (std::move (final_path), std::move (final_args));
+
+  auto node = AST::SingleASTNode (std::move (final_call));
+
+  return AST::Fragment ({node}, std::move (tokens));
 }
 
+} // namespace Fmt
 } // namespace Rust
diff --git a/gcc/rust/expand/rust-expand-format-args.h b/gcc/rust/expand/rust-expand-format-args.h
index 1481f3605ed..0a17de53597 100644
--- a/gcc/rust/expand/rust-expand-format-args.h
+++ b/gcc/rust/expand/rust-expand-format-args.h
@@ -23,10 +23,13 @@
 #include "rust-ast-fragment.h"
 
 namespace Rust {
+namespace Fmt {
 
 tl::optional<AST::Fragment>
-expand_format_args (AST::FormatArgs &fmt);
+expand_format_args (AST::FormatArgs &fmt,
+		    std::vector<std::unique_ptr<AST::Token>> &&tokens);
 
+} // namespace Fmt
 } // namespace Rust
 
 #endif //! RUST_EXPAND_FORMAT_ARGS_H
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 8cf32051c7a..112713a4f97 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -20,6 +20,7 @@
 #include "libproc_macro_internal/tokenstream.h"
 #include "rust-ast-full-decls.h"
 #include "rust-builtin-ast-nodes.h"
+#include "rust-expand-format-args.h"
 #include "rust-token-converter.h"
 #include "rust-system.h"
 #include "rust-macro-builtins.h"
@@ -1102,13 +1103,23 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
   // TODO: we now need to take care of creating `unfinished_literal`? this is
   // for creating the `template`
 
-  auto fmt_args_node = new AST::FormatArgs (invoc_locus, std::move (pieces),
-					    std::move (input->args));
-  auto node = std::unique_ptr<AST::Expr> (fmt_args_node);
-  auto single_node = AST::SingleASTNode (std::move (node));
+  auto fmt_args_node = AST::FormatArgs (invoc_locus, std::move (pieces),
+					std::move (input->args));
 
-  return AST::Fragment ({std::move (single_node)},
-			invoc.get_delim_tok_tree ().to_token_stream ());
+  auto expanded
+    = Fmt::expand_format_args (fmt_args_node,
+			       invoc.get_delim_tok_tree ().to_token_stream ());
+
+  if (!expanded.has_value ())
+    return AST::Fragment::create_error ();
+
+  return *expanded;
+
+  // auto node = std::unique_ptr<AST::Expr> (fmt_args_node);
+  // auto single_node = AST::SingleASTNode (std::move (node));
+
+  // return AST::Fragment ({std::move (single_node)},
+  // 	invoc.get_delim_tok_tree ().to_token_stream ());
 }
 
 tl::optional<AST::Fragment>
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 050/125] gccrs: format-args: Add basic test case
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (47 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 049/125] gccrs: format-args: Add basic expansion of unnamed Display::fmt arguments Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 051/125] gccrs: format-args: Only pass the format string to the parser Arthur Cohen
                   ` (74 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/testsuite/ChangeLog:

	* rust/compile/format_args_basic_expansion.rs: New test.
---
 .../compile/format_args_basic_expansion.rs    | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/format_args_basic_expansion.rs

diff --git a/gcc/testsuite/rust/compile/format_args_basic_expansion.rs b/gcc/testsuite/rust/compile/format_args_basic_expansion.rs
new file mode 100644
index 00000000000..40bcd3c1433
--- /dev/null
+++ b/gcc/testsuite/rust/compile/format_args_basic_expansion.rs
@@ -0,0 +1,47 @@
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! format_args {
+    () => {};
+}
+
+#[lang = "sized"]
+trait Sized {}
+
+pub mod core {
+    pub mod fmt {
+        pub struct Formatter;
+        pub struct Result;
+
+        pub struct Arguments<'a>;
+
+        impl<'a> Arguments<'a> {
+            pub fn new_v1(_: &'a [&'static str], _: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
+                Arguments
+            }
+        }
+
+        pub struct ArgumentV1<'a>;
+
+        impl<'a> ArgumentV1<'a> {
+            pub fn new<'b, T>(_: &'b T, _: fn(&T, &mut Formatter) -> Result) -> ArgumentV1 {
+                ArgumentV1
+            }
+        }
+
+        pub trait Display {
+            fn fmt(&self, _: &mut Formatter) -> Result;
+        }
+
+        impl Display for i32 {
+            fn fmt(&self, _: &mut Formatter) -> Result {
+                // { dg-warning "unused name .self." "" { target *-*-* } .-1 }
+                Result
+            }
+        }
+    }
+}
+
+fn main() {
+    let _formatted = format_args!("hello {}", 15);
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 051/125] gccrs: format-args: Only pass the format string to the parser.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (48 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 050/125] gccrs: format-args: Add basic test case Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 052/125] gccrs: TyTy: add common SubstitutionRef API Arthur Cohen
                   ` (73 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

This fixes an issue we had where the generated code ended with more static
pieces than its rustc counterpart.

gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (struct FormatArgsInput): Store the format_str
	as a string instead of an AST::Expr.
	(format_args_parse_arguments): Transform format_expr into a format string
	properly - add note for handling eager macro invocations later on.
	(MacroBuiltin::format_args_handler): Parse the correct input, append
	newline to format_str if necessary.
---
 gcc/rust/expand/rust-macro-builtins.cc | 37 +++++++++++++++-----------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 112713a4f97..a33a57752da 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -18,6 +18,7 @@
 
 #include "expected.h"
 #include "libproc_macro_internal/tokenstream.h"
+#include "optional.h"
 #include "rust-ast-full-decls.h"
 #include "rust-builtin-ast-nodes.h"
 #include "rust-expand-format-args.h"
@@ -961,7 +962,7 @@ MacroBuiltin::stringify_handler (location_t invoc_locus,
 
 struct FormatArgsInput
 {
-  std::unique_ptr<AST::Expr> format_str;
+  std::string format_str;
   AST::FormatArguments args;
   // bool is_literal?
 };
@@ -985,12 +986,18 @@ format_args_parse_arguments (AST::MacroInvocData &invoc)
 
   auto args = AST::FormatArguments ();
   auto last_token_id = macro_end_token (invoc.get_delim_tok_tree (), parser);
-  std::unique_ptr<AST::Expr> format_str = nullptr;
+  std::unique_ptr<AST::Expr> format_expr = nullptr;
 
   // TODO: Handle the case where we're not parsing a string literal (macro
   // invocation for e.g.)
   if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
-    format_str = parser.parse_literal_expr ();
+    format_expr = parser.parse_literal_expr ();
+
+  // TODO(Arthur): Clean this up - if we haven't parsed a string literal but a
+  // macro invocation, what do we do here? return a tl::unexpected?
+  auto format_str = static_cast<AST::LiteralExpr &> (*format_expr)
+		      .get_literal ()
+		      .as_string ();
 
   // TODO: Allow implicit captures ONLY if the the first arg is a string literal
   // and not a macro invocation
@@ -1053,6 +1060,13 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
 {
   auto input = format_args_parse_arguments (invoc);
 
+  if (!input)
+    {
+      rust_error_at (invoc_locus,
+		     "could not parse arguments to %<format_args!()%>");
+      return tl::nullopt;
+    }
+
   // TODO(Arthur): We need to handle this
   // // if it is not a literal, it's an eager macro invocation - return it
   // if (!fmt_expr->is_literal ())
@@ -1080,20 +1094,13 @@ MacroBuiltin::format_args_handler (location_t invoc_locus,
   //     rust_unreachable ();
   //   }
 
-  // Remove the delimiters from the macro invocation:
-  // the invoc data for `format_args!(fmt, arg1, arg2)` is `(fmt, arg1, arg2)`,
-  // so we pop the front and back to remove the parentheses (or curly brackets,
-  // or brackets)
-  auto tokens = invoc.get_delim_tok_tree ().to_token_stream ();
-  tokens.erase (tokens.begin ());
-  tokens.pop_back ();
+  bool append_newline = nl == AST::FormatArgs::Newline::Yes;
 
-  std::stringstream stream;
-  for (const auto &tok : tokens)
-    stream << tok->as_string () << ' ';
+  auto fmt_str = std::move (input->format_str);
+  if (append_newline)
+    fmt_str += '\n';
 
-  auto append_newline = nl == AST::FormatArgs::Newline::Yes ? true : false;
-  auto pieces = Fmt::Pieces::collect (stream.str (), append_newline);
+  auto pieces = Fmt::Pieces::collect (fmt_str, append_newline);
 
   // TODO:
   // do the transformation into an AST::FormatArgs node
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 052/125] gccrs: TyTy: add common SubstitutionRef API
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (49 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 051/125] gccrs: format-args: Only pass the format string to the parser Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 053/125] gccrs: TyTy: Variance analysis module Arthur Cohen
                   ` (72 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* typecheck/rust-tyty-subst.cc (SubstitutionRef::get_arg_at):
	Add unified API.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/typecheck/rust-tyty-subst.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gcc/rust/typecheck/rust-tyty-subst.cc b/gcc/rust/typecheck/rust-tyty-subst.cc
index 5a753566d48..71d41d6f796 100644
--- a/gcc/rust/typecheck/rust-tyty-subst.cc
+++ b/gcc/rust/typecheck/rust-tyty-subst.cc
@@ -589,6 +589,17 @@ SubstitutionRef::get_used_arguments () const
   return used_arguments;
 }
 
+tl::optional<SubstitutionArg>
+SubstitutionRef::get_arg_at (size_t i) const
+{
+  auto param_ty = get_substs ().at (i).get_param_ty ();
+  SubstitutionArg arg = SubstitutionArg::error ();
+  get_used_arguments ().get_argument_for_symbol (param_ty, &arg);
+  if (arg.is_error ())
+    return tl::nullopt;
+  return arg;
+}
+
 const RegionConstraints &
 SubstitutionRef::get_region_constraints () const
 {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 053/125] gccrs: TyTy: Variance analysis module
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (50 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 052/125] gccrs: TyTy: add common SubstitutionRef API Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 054/125] gccrs: TyTy: Collect variance info from types Arthur Cohen
                   ` (71 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* Make-lang.in: Add new .cc file.
	* rust-session-manager.cc (Session::compile_crate): Run
	analysis.
	* typecheck/rust-tyty-variance-analysis-private.h: New file.
	* typecheck/rust-tyty-variance-analysis.cc: New file.
	* typecheck/rust-tyty-variance-analysis.h: New file.
	* typecheck/rust-typecheck-context.cc
	(TypeCheckContext::get_variance_analysis_ctx):
	Variance analysis context.
	* typecheck/rust-hir-type-check.h (TypeCheckItem::visit):
	Variance analysis context.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/Make-lang.in                         |   1 +
 gcc/rust/rust-session-manager.cc              |   3 +
 gcc/rust/typecheck/rust-hir-type-check.h      |   6 +
 gcc/rust/typecheck/rust-typecheck-context.cc  |   6 +
 .../rust-tyty-variance-analysis-private.h     | 304 ++++++++++
 .../typecheck/rust-tyty-variance-analysis.cc  | 541 ++++++++++++++++++
 .../typecheck/rust-tyty-variance-analysis.h   | 114 ++++
 7 files changed, 975 insertions(+)
 create mode 100644 gcc/rust/typecheck/rust-tyty-variance-analysis-private.h
 create mode 100644 gcc/rust/typecheck/rust-tyty-variance-analysis.cc
 create mode 100644 gcc/rust/typecheck/rust-tyty-variance-analysis.h

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index cbb9da0fe43..67df843349f 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -147,6 +147,7 @@ GRS_OBJS = \
     rust/rust-tyty-util.o \
     rust/rust-tyty-call.o \
     rust/rust-tyty-subst.o \
+    rust/rust-tyty-variance-analysis.o \
     rust/rust-typecheck-context.o \
     rust/rust-tyty-bounds.o \
     rust/rust-hir-trait-resolve.o \
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 62c47b2e6de..ea99d019f64 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -48,6 +48,7 @@
 #include "rust-attribute-values.h"
 #include "rust-borrow-checker.h"
 #include "rust-ast-validation.h"
+#include "rust-tyty-variance-analysis.h"
 
 #include "input.h"
 #include "selftest.h"
@@ -652,6 +653,8 @@ Session::compile_crate (const char *filename)
   // type resolve
   Resolver::TypeResolution::Resolve (hir);
 
+  Resolver::TypeCheckContext::get ()->get_variance_analysis_ctx ().solve ();
+
   if (saw_errors ())
     return;
 
diff --git a/gcc/rust/typecheck/rust-hir-type-check.h b/gcc/rust/typecheck/rust-hir-type-check.h
index 52c84fc4435..c32fa4e8487 100644
--- a/gcc/rust/typecheck/rust-hir-type-check.h
+++ b/gcc/rust/typecheck/rust-hir-type-check.h
@@ -24,6 +24,7 @@
 #include "rust-hir-trait-reference.h"
 #include "rust-autoderef.h"
 #include "rust-tyty-region.h"
+#include "rust-tyty-variance-analysis.h"
 
 #include <stack>
 
@@ -233,6 +234,8 @@ public:
 
   void compute_inference_variables (bool error);
 
+  TyTy::VarianceAnalysis::CrateCtx &get_variance_analysis_ctx ();
+
 private:
   TypeCheckContext ();
 
@@ -272,6 +275,9 @@ private:
   std::set<HirId> querys_in_progress;
   std::set<DefId> trait_queries_in_progress;
 
+  // variance analysis
+  TyTy::VarianceAnalysis::CrateCtx variance_analysis_ctx;
+
   /** Used to resolve (interned) lifetime names to their bounding scope. */
   class LifetimeResolver
   {
diff --git a/gcc/rust/typecheck/rust-typecheck-context.cc b/gcc/rust/typecheck/rust-typecheck-context.cc
index 9059e0261b3..ab0093a273b 100644
--- a/gcc/rust/typecheck/rust-typecheck-context.cc
+++ b/gcc/rust/typecheck/rust-typecheck-context.cc
@@ -617,6 +617,12 @@ TypeCheckContext::compute_inference_variables (bool error)
   });
 }
 
+TyTy::VarianceAnalysis::CrateCtx &
+TypeCheckContext::get_variance_analysis_ctx ()
+{
+  return variance_analysis_ctx;
+}
+
 // TypeCheckContextItem
 
 TypeCheckContextItem::Item::Item (HIR::Function *item) : item (item) {}
diff --git a/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h b/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h
new file mode 100644
index 00000000000..ab8c039238e
--- /dev/null
+++ b/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h
@@ -0,0 +1,304 @@
+#ifndef RUST_TYTY_VARIANCE_ANALYSIS_PRIVATE_H
+#define RUST_TYTY_VARIANCE_ANALYSIS_PRIVATE_H
+
+#include "rust-tyty-variance-analysis.h"
+
+#include "rust-tyty-visitor.h"
+
+namespace Rust {
+namespace TyTy {
+namespace VarianceAnalysis {
+
+using SolutionIndex = uint32_t;
+
+/** Term descibing variance relations. */
+struct Term
+{
+  enum Kind : uint8_t
+  {
+    CONST,
+    REF,
+    TRANSFORM,
+  };
+
+  Kind kind;
+  union
+  {
+    struct
+    {
+      Term *lhs;
+      Term *rhs;
+    } transform;
+    SolutionIndex ref;
+    Variance const_val;
+  };
+
+  Term () {}
+
+  Term (Variance variance) : kind (CONST), const_val (variance) {}
+
+  WARN_UNUSED_RESULT bool is_const () const { return kind == CONST; }
+
+  static Term make_ref (SolutionIndex index);
+
+  static Term make_transform (Term lhs, Term rhs);
+};
+
+/** Variance constraint of a type parameter. */
+struct Constraint
+{
+  SolutionIndex target_index;
+  Term *term;
+};
+
+/** Abstract variance visitor context. */
+template <typename VARIANCE> class VarianceVisitorCtx
+{
+public:
+  virtual ~VarianceVisitorCtx () = default;
+
+  virtual void add_constraints_from_ty (BaseType *ty, VARIANCE variance) = 0;
+  virtual void add_constraints_from_region (const Region &region,
+					    VARIANCE variance)
+    = 0;
+  void add_constraints_from_mutability (BaseType *type, Mutability mutability,
+					VARIANCE variance)
+  {
+    switch (mutability)
+      {
+      case Mutability::Imm:
+	return add_constraints_from_ty (type, variance);
+      case Mutability::Mut:
+	return add_constraints_from_ty (type, Variance::invariant ());
+      }
+  }
+  virtual void
+  add_constraints_from_generic_args (HirId ref, SubstitutionRef &subst,
+				     VARIANCE variance, bool invariant_args)
+    = 0;
+  virtual void add_constrints_from_param (ParamType &param, VARIANCE variance)
+    = 0;
+  virtual VARIANCE contra (VARIANCE variance) = 0;
+};
+
+template <typename VARIANCE> class VisitorBase final : public TyVisitor
+{
+  VarianceVisitorCtx<VARIANCE> &ctx;
+  VARIANCE variance;
+
+public:
+  VisitorBase (VarianceVisitorCtx<VARIANCE> &ctx, VARIANCE variance)
+    : ctx (ctx), variance (variance)
+  {}
+
+  void visit (BoolType &type) override {}
+  void visit (CharType &type) override {}
+  void visit (IntType &type) override {}
+  void visit (UintType &type) override {}
+  void visit (FloatType &type) override {}
+  void visit (USizeType &type) override {}
+  void visit (ISizeType &type) override {}
+  void visit (StrType &type) override {}
+  void visit (NeverType &type) override {}
+
+  void visit (ClosureType &type) override {}
+  void visit (FnType &type) override
+  {
+    for (auto &region : type.get_used_arguments ().get_regions ())
+      ctx.add_constraints_from_region (region, Variance::invariant ());
+  }
+
+  void visit (ReferenceType &type) override
+  {
+    ctx.add_constraints_from_region (type.get_region (), variance);
+    ctx.add_constraints_from_mutability (type.get_base (), type.mutability (),
+					 variance);
+  }
+  void visit (ArrayType &type) override
+  {
+    ctx.add_constraints_from_ty (type.get_element_type (), variance);
+  }
+  void visit (SliceType &type) override
+  {
+    ctx.add_constraints_from_ty (type.get_element_type (), variance);
+  }
+  void visit (PointerType &type) override
+  {
+    ctx.add_constraints_from_ty (type.get_base (), variance);
+    ctx.add_constraints_from_mutability (type.get_base (), type.mutability (),
+					 variance);
+  }
+  void visit (TupleType &type) override
+  {
+    for (auto &elem : type.get_fields ())
+      ctx.add_constraints_from_ty (elem.get_tyty (), variance);
+  }
+  void visit (ADTType &type) override
+  {
+    ctx.add_constraints_from_generic_args (type.get_orig_ref (), type, variance,
+					   false);
+  }
+  void visit (ProjectionType &type) override
+  {
+    ctx.add_constraints_from_generic_args (type.get_orig_ref (), type, variance,
+					   true);
+  }
+  void visit (ParamType &type) override
+  {
+    ctx.add_constrints_from_param (type, variance);
+  }
+  void visit (FnPtr &type) override
+  {
+    auto contra = ctx.contra (variance);
+
+    for (auto &param : type.get_params ())
+      {
+	ctx.add_constraints_from_ty (param.get_tyty (), contra);
+      }
+
+    ctx.add_constraints_from_ty (type.get_return_type (), variance);
+  }
+
+  void visit (ErrorType &type) override {}
+
+  void visit (PlaceholderType &type) override { rust_unreachable (); }
+  void visit (InferType &type) override { rust_unreachable (); }
+
+  void visit (DynamicObjectType &type) override
+  {
+    // TODO
+  }
+};
+
+/** Per crate context for generic type variance analysis. */
+class GenericTyPerCrateCtx
+{
+public: // External API
+  /** Add a type to context and process its variance constraints. */
+  void process_type (ADTType &ty);
+
+  /**
+   * Solve for all variance constraints and clear temporary data.
+   *
+   * Only keeps the results.
+   */
+  void solve ();
+
+  /** Prints solution debug output. To be called after solve. */
+  void debug_print_solutions ();
+
+  tl::optional<SolutionIndex> lookup_type_index (HirId orig_ref);
+
+public: // Module internal API
+  /** Format term tree to string. */
+  WARN_UNUSED_RESULT std::string to_string (const Term &term) const;
+
+  /** Formats as <type ident>`[`<param index>``]` */
+  WARN_UNUSED_RESULT std::string to_string (SolutionIndex index) const;
+
+  /** Evaluate a variance relation expression (term tree). */
+  Variance evaluate (Term *term);
+
+  std::vector<Variance> query_generic_variance (const ADTType &type);
+
+public: // Data used by visitors.
+  // This whole class is private, therfore members can be public.
+
+  /** Current solutions. Initiated to bivariant. */
+  std::vector<Variance> solutions;
+
+  /** Constrains on solutions. Iteratively applied until fixpoint. */
+  std::vector<Constraint> constraints;
+
+  /** Maps TyTy::orig_ref to an index of first solution for this type. */
+  std::unordered_map<HirId, SolutionIndex> map_from_ty_orig_ref;
+};
+
+/** Visitor context for generic type variance analysis used for processing of a
+ * single type. */
+class GenericTyVisitorCtx : VarianceVisitorCtx<Term>
+{
+  using Visitor = VisitorBase<Term>;
+
+public:
+  explicit GenericTyVisitorCtx (GenericTyPerCrateCtx &ctx) : ctx (ctx) {}
+  /** Entry point: Add a type to context and process its variance constraints.
+   */
+  void process_type (ADTType &ty);
+
+private:
+  /** Resolve a type from a TyTy::ref. */
+  SolutionIndex lookup_or_add_type (HirId hir_id);
+
+  /** Visit an inner type and add its constraints. */
+  void add_constraints_from_ty (BaseType *ty, Term variance) override;
+
+  void add_constraint (SolutionIndex index, Term term);
+
+  void add_constraints_from_region (const Region &region, Term term) override;
+
+  void add_constraints_from_generic_args (HirId ref, SubstitutionRef &subst,
+					  Term variance,
+					  bool invariant_args) override;
+
+  void add_constrints_from_param (ParamType &type, Term variance) override;
+
+  /** Construct a term for type in contravaraint position. */
+  Term contra (Term variance) override;
+
+private:
+  GenericTyPerCrateCtx &ctx;
+
+private: // Per type processing context
+  /** Index of the solution first **lifetime param** for the current type. */
+  SolutionIndex first_lifetime = 0;
+
+  /** Index of the solution first **type param** for the current type. */
+  SolutionIndex first_type = 0;
+
+  /** Maps type param names to index among type params. */
+  std::vector<std::string> param_names;
+};
+
+/** Visitor context for basic type variance analysis. */
+class TyVisitorCtx : public VarianceVisitorCtx<Variance>
+{
+public:
+  using Visitor = VisitorBase<Variance>;
+
+  TyVisitorCtx (GenericTyPerCrateCtx &ctx) : ctx (ctx) {}
+
+  std::vector<Variance> collect_variances (BaseType &ty)
+  {
+    add_constraints_from_ty (&ty, Variance::covariant ());
+    return variances;
+  }
+
+  std::vector<Region> collect_regions (BaseType &ty)
+  {
+    add_constraints_from_ty (&ty, Variance::covariant ());
+    return regions;
+  }
+
+  void add_constraints_from_ty (BaseType *ty, Variance variance) override;
+  void add_constraints_from_region (const Region &region,
+				    Variance variance) override;
+  void add_constraints_from_generic_args (HirId ref, SubstitutionRef &subst,
+					  Variance variance,
+					  bool invariant_args) override;
+  void add_constrints_from_param (ParamType &param, Variance variance) override
+  {}
+  Variance contra (Variance variance) override;
+
+private:
+  GenericTyPerCrateCtx &ctx;
+  std::vector<Variance> variances;
+  std::vector<Region> regions;
+};
+
+} // namespace VarianceAnalysis
+
+} // namespace TyTy
+} // namespace Rust
+
+#endif // RUST_TYTY_VARIANCE_ANALYSIS_PRIVATE_H
diff --git a/gcc/rust/typecheck/rust-tyty-variance-analysis.cc b/gcc/rust/typecheck/rust-tyty-variance-analysis.cc
new file mode 100644
index 00000000000..5a21d69651b
--- /dev/null
+++ b/gcc/rust/typecheck/rust-tyty-variance-analysis.cc
@@ -0,0 +1,541 @@
+#include "rust-tyty-variance-analysis-private.h"
+#include "rust-hir-type-check.h"
+
+namespace Rust {
+namespace TyTy {
+
+BaseType *
+lookup_type (HirId ref)
+{
+  BaseType *ty = nullptr;
+  bool ok = Resolver::TypeCheckContext::get ()->lookup_type (ref, &ty);
+  rust_assert (ok);
+  return ty;
+}
+
+namespace VarianceAnalysis {
+
+CrateCtx::CrateCtx () : private_ctx (new GenericTyPerCrateCtx ()) {}
+
+// Must be here because of incomplete type.
+CrateCtx::~CrateCtx () = default;
+
+void
+CrateCtx::add_type_constraints (ADTType &type)
+{
+  private_ctx->process_type (type);
+}
+
+void
+CrateCtx::solve ()
+{
+  private_ctx->solve ();
+  private_ctx->debug_print_solutions ();
+}
+
+std::vector<Variance>
+CrateCtx::query_generic_variance (const ADTType &type)
+{
+  return private_ctx->query_generic_variance (type);
+}
+
+std::vector<Variance>
+CrateCtx::query_type_variances (BaseType *type)
+{
+  TyVisitorCtx ctx (*private_ctx);
+  return ctx.collect_variances (*type);
+}
+
+std::vector<Region>
+CrateCtx::query_type_regions (BaseType *type)
+{
+  TyVisitorCtx ctx (*private_ctx);
+  return ctx.collect_regions (*type);
+}
+
+Variance
+Variance::reverse () const
+{
+  switch (kind)
+    {
+    case BIVARIANT:
+      return bivariant ();
+    case COVARIANT:
+      return contravariant ();
+    case CONTRAVARIANT:
+      return covariant ();
+    case INVARIANT:
+      return invariant ();
+    }
+
+  rust_unreachable ();
+}
+
+Variance
+Variance::join (Variance lhs, Variance rhs)
+{
+  return {Kind (lhs.kind | rhs.kind)};
+}
+
+void
+Variance::join (Variance rhs)
+{
+  *this = join (*this, rhs);
+}
+
+Variance
+Variance::transform (Variance lhs, Variance rhs)
+{
+  switch (lhs.kind)
+    {
+    case BIVARIANT:
+      return bivariant ();
+    case COVARIANT:
+      return rhs;
+    case CONTRAVARIANT:
+      return rhs.reverse ();
+    case INVARIANT:
+      return invariant ();
+    }
+  rust_unreachable ();
+}
+
+std::string
+Variance::as_string () const
+{
+  switch (kind)
+    {
+    case BIVARIANT:
+      return "o";
+    case COVARIANT:
+      return "+";
+    case CONTRAVARIANT:
+      return "-";
+    case INVARIANT:
+      return "*";
+    }
+  rust_unreachable ();
+}
+
+void
+GenericTyPerCrateCtx::process_type (ADTType &type)
+{
+  GenericTyVisitorCtx (*this).process_type (type);
+}
+
+void
+GenericTyPerCrateCtx::solve ()
+{
+  rust_debug ("Variance analysis solving started:");
+
+  // Fix point iteration
+  bool changed = true;
+  while (changed)
+    {
+      changed = false;
+      for (auto constraint : constraints)
+	{
+	  rust_debug ("\tapplying constraint: %s <= %s",
+		      to_string (constraint.target_index).c_str (),
+		      to_string (*constraint.term).c_str ());
+
+	  auto old_solution = solutions[constraint.target_index];
+	  auto new_solution
+	    = Variance::join (old_solution, evaluate (constraint.term));
+
+	  if (old_solution != new_solution)
+	    {
+	      rust_debug ("\t\tsolution changed: %s => %s",
+			  old_solution.as_string ().c_str (),
+			  new_solution.as_string ().c_str ());
+
+	      changed = true;
+	      solutions[constraint.target_index] = new_solution;
+	    }
+	}
+    }
+
+  constraints.clear ();
+  constraints.shrink_to_fit ();
+}
+
+void
+GenericTyPerCrateCtx::debug_print_solutions ()
+{
+  rust_debug ("Variance analysis results:");
+
+  for (auto type : map_from_ty_orig_ref)
+    {
+      auto solution_index = type.second;
+      auto ref = type.first;
+
+      BaseType *ty = lookup_type (ref);
+
+      std::string result = "\t";
+
+      if (auto adt = ty->try_as<ADTType> ())
+	{
+	  result += adt->get_identifier ();
+	  result += "<";
+
+	  size_t i = solution_index;
+	  for (auto &region : adt->get_used_arguments ().get_regions ())
+	    {
+	      (void) region;
+	      if (i > solution_index)
+		result += ", ";
+	      result += solutions[i].as_string ();
+	      i++;
+	    }
+	  for (auto &param : adt->get_substs ())
+	    {
+	      if (i > solution_index)
+		result += ", ";
+	      result += param.get_generic_param ()
+			  .get_type_representation ()
+			  .as_string ();
+	      result += "=";
+	      result += solutions[i].as_string ();
+	      i++;
+	    }
+
+	  result += ">";
+	}
+      else
+	{
+	  rust_sorry_at (
+	    ty->get_ref (),
+	    "This is a compiler bug: Unhandled type in variance analysis");
+	}
+      rust_debug ("%s", result.c_str ());
+    }
+}
+
+tl::optional<SolutionIndex>
+GenericTyPerCrateCtx::lookup_type_index (HirId orig_ref)
+{
+  auto it = map_from_ty_orig_ref.find (orig_ref);
+  if (it != map_from_ty_orig_ref.end ())
+    {
+      return it->second;
+    }
+  return tl::nullopt;
+}
+
+void
+GenericTyVisitorCtx::process_type (ADTType &ty)
+{
+  rust_debug ("add_type_constraints: %s", ty.as_string ().c_str ());
+
+  first_lifetime = lookup_or_add_type (ty.get_orig_ref ());
+  first_type = first_lifetime + ty.get_used_arguments ().get_regions ().size ();
+
+  for (const auto &param : ty.get_substs ())
+    param_names.push_back (
+      param.get_generic_param ().get_type_representation ().as_string ());
+
+  for (const auto &variant : ty.get_variants ())
+    {
+      if (variant->get_variant_type () != VariantDef::NUM)
+	{
+	  for (const auto &field : variant->get_fields ())
+	    add_constraints_from_ty (field->get_field_type (),
+				     Variance::covariant ());
+	}
+    }
+}
+
+std::string
+GenericTyPerCrateCtx::to_string (const Term &term) const
+{
+  switch (term.kind)
+    {
+    case Term::CONST:
+      return term.const_val.as_string ();
+    case Term::REF:
+      return "v(" + to_string (term.ref) + ")";
+    case Term::TRANSFORM:
+      return "(" + to_string (*term.transform.lhs) + " x "
+	     + to_string (*term.transform.rhs) + ")";
+    }
+  rust_unreachable ();
+}
+
+std::string
+GenericTyPerCrateCtx::to_string (SolutionIndex index) const
+{
+  // Search all values in def_id_to_solution_index_start and find key for
+  // largest value smaller than index
+  std::pair<HirId, SolutionIndex> best = {0, 0};
+
+  for (const auto &ty_map : map_from_ty_orig_ref)
+    {
+      if (ty_map.second <= index && ty_map.first > best.first)
+	best = ty_map;
+    }
+  rust_assert (best.first != 0);
+
+  BaseType *ty = lookup_type (best.first);
+
+  std::string result = "";
+  if (auto adt = ty->try_as<ADTType> ())
+    {
+      result += (adt->get_identifier ());
+    }
+  else
+    {
+      result += ty->as_string ();
+    }
+
+  result += "[" + std::to_string (index - best.first) + "]";
+  return result;
+}
+
+Variance
+GenericTyPerCrateCtx::evaluate (Term *term)
+{
+  switch (term->kind)
+    {
+    case Term::CONST:
+      return term->const_val;
+    case Term::REF:
+      return solutions[term->ref];
+    case Term::TRANSFORM:
+      return Variance::transform (evaluate (term->transform.lhs),
+				  evaluate (term->transform.rhs));
+    }
+  rust_unreachable ();
+}
+
+std::vector<Variance>
+GenericTyPerCrateCtx::query_generic_variance (const ADTType &type)
+{
+  auto solution_index = lookup_type_index (type.get_orig_ref ());
+  rust_assert (solution_index.has_value ());
+  auto num_lifetimes = type.get_num_lifetime_params ();
+  auto num_types = type.get_num_type_params ();
+
+  std::vector<Variance> result;
+  for (size_t i = 0; i < num_lifetimes + num_types; ++i)
+    {
+      result.push_back (solutions[solution_index.value () + i]);
+    }
+
+  return result;
+}
+
+SolutionIndex
+GenericTyVisitorCtx::lookup_or_add_type (HirId hir_id)
+{
+  BaseType *ty = lookup_type (hir_id);
+  auto index = ctx.lookup_type_index (hir_id);
+  if (index.has_value ())
+    {
+      return index.value ();
+    }
+
+  SubstitutionRef *subst = nullptr;
+  if (auto adt = ty->try_as<ADTType> ())
+    {
+      subst = adt;
+    }
+  else
+    {
+      rust_sorry_at (
+	ty->get_locus (),
+	"This is a compiler bug: Unhandled type in variance analysis");
+    }
+  rust_assert (subst != nullptr);
+
+  auto solution_index = ctx.solutions.size ();
+  ctx.map_from_ty_orig_ref.emplace (ty->get_orig_ref (), solution_index);
+
+  auto num_lifetime_param = subst->get_used_arguments ().get_regions ().size ();
+  auto num_type_param = subst->get_num_substitutions ();
+
+  for (size_t i = 0; i < num_lifetime_param + num_type_param; ++i)
+    ctx.solutions.emplace_back (Variance::bivariant ());
+
+  return solution_index;
+}
+
+void
+GenericTyVisitorCtx::add_constraints_from_ty (BaseType *type, Term variance)
+{
+  rust_debug ("\tadd_constraint_from_ty: %s with v=%s",
+	      type->as_string ().c_str (), ctx.to_string (variance).c_str ());
+
+  Visitor visitor (*this, variance);
+  type->accept_vis (visitor);
+}
+
+void
+GenericTyVisitorCtx::add_constraint (SolutionIndex index, Term term)
+{
+  rust_debug ("\t\tadd_constraint: %s", ctx.to_string (term).c_str ());
+
+  if (term.kind == Term::CONST)
+    {
+      // Constant terms do not depend on other solutions, so we can
+      // immediately apply them.
+      ctx.solutions[index].join (term.const_val);
+    }
+  else
+    {
+      ctx.constraints.push_back ({index, new Term (term)});
+    }
+}
+
+void
+GenericTyVisitorCtx::add_constraints_from_region (const Region &region,
+						  Term term)
+{
+  if (region.is_early_bound ())
+    {
+      add_constraint (first_lifetime + region.get_index (), term);
+    }
+}
+
+void
+GenericTyVisitorCtx::add_constraints_from_generic_args (HirId ref,
+							SubstitutionRef &subst,
+							Term variance,
+							bool invariant_args)
+{
+  SolutionIndex solution_index = lookup_or_add_type (ref);
+
+  size_t num_lifetimes = subst.get_used_arguments ().get_regions ().size ();
+  size_t num_types = subst.get_substs ().size ();
+
+  for (size_t i = 0; i < num_lifetimes + num_types; ++i)
+    {
+      // TODO: What about variance from other crates?
+      auto variance_i
+	= invariant_args
+	    ? Term::make_transform (variance, Variance::invariant ())
+	    : Term::make_transform (variance,
+				    Term::make_ref (solution_index + i));
+
+      if (i < num_lifetimes)
+	{
+	  auto region_i = i;
+	  auto &region
+	    = subst.get_substitution_arguments ().get_mut_regions ()[region_i];
+	  add_constraints_from_region (region, variance_i);
+	}
+      else
+	{
+	  auto type_i = i - num_lifetimes;
+	  auto arg = subst.get_arg_at (type_i);
+	  if (arg.has_value ())
+	    {
+	      add_constraints_from_ty (arg.value ().get_tyty (), variance_i);
+	    }
+	}
+    }
+}
+void
+GenericTyVisitorCtx::add_constrints_from_param (ParamType &type, Term variance)
+{
+  auto it
+    = std::find (param_names.begin (), param_names.end (), type.get_name ());
+  rust_assert (it != param_names.end ());
+
+  auto index = first_type + std::distance (param_names.begin (), it);
+
+  add_constraint (index, variance);
+}
+
+Term
+GenericTyVisitorCtx::contra (Term variance)
+{
+  return Term::make_transform (variance, Variance::contravariant ());
+}
+
+void
+TyVisitorCtx::add_constraints_from_ty (BaseType *ty, Variance variance)
+{
+  Visitor visitor (*this, variance);
+  ty->accept_vis (visitor);
+}
+
+void
+TyVisitorCtx::add_constraints_from_region (const Region &region,
+					   Variance variance)
+{
+  variances.push_back (variance);
+  regions.push_back (region);
+}
+
+void
+TyVisitorCtx::add_constraints_from_generic_args (HirId ref,
+						 SubstitutionRef &subst,
+						 Variance variance,
+						 bool invariant_args)
+{
+  // Handle function
+  auto variances
+    = ctx.query_generic_variance (*lookup_type (ref)->as<ADTType> ());
+
+  size_t num_lifetimes = subst.get_used_arguments ().get_regions ().size ();
+  size_t num_types = subst.get_substs ().size ();
+
+  for (size_t i = 0; i < num_lifetimes + num_types; ++i)
+    {
+      // TODO: What about variance from other crates?
+      auto variance_i
+	= invariant_args
+	    ? Variance::transform (variance, Variance::invariant ())
+	    : Variance::transform (variance, variances[i]);
+
+      if (i < num_lifetimes)
+	{
+	  auto region_i = i;
+	  auto &region = subst.get_used_arguments ().get_regions ()[region_i];
+	  add_constraints_from_region (region, variance_i);
+	}
+      else
+	{
+	  auto type_i = i - num_lifetimes;
+	  auto arg = subst.get_arg_at (type_i);
+	  if (arg.has_value ())
+	    {
+	      add_constraints_from_ty (arg.value ().get_tyty (), variance_i);
+	    }
+	}
+    }
+}
+
+Variance
+TyVisitorCtx::contra (Variance variance)
+{
+  return Variance::transform (variance, Variance::contravariant ());
+}
+
+Term
+Term::make_ref (SolutionIndex index)
+{
+  Term term;
+  term.kind = REF;
+  term.ref = index;
+  return term;
+}
+
+Term
+Term::make_transform (Term lhs, Term rhs)
+{
+  if (lhs.is_const () && rhs.is_const ())
+    {
+      return Variance::transform (lhs.const_val, rhs.const_val);
+    }
+
+  Term term;
+  term.kind = TRANSFORM;
+  term.transform.lhs = new Term (lhs);
+  term.transform.rhs = new Term (rhs);
+  return term;
+}
+
+} // namespace VarianceAnalysis
+} // namespace TyTy
+} // namespace Rust
\ No newline at end of file
diff --git a/gcc/rust/typecheck/rust-tyty-variance-analysis.h b/gcc/rust/typecheck/rust-tyty-variance-analysis.h
new file mode 100644
index 00000000000..a1defd62e54
--- /dev/null
+++ b/gcc/rust/typecheck/rust-tyty-variance-analysis.h
@@ -0,0 +1,114 @@
+#ifndef RUST_TYTY_VARIANCE_ANALYSIS_H
+#define RUST_TYTY_VARIANCE_ANALYSIS_H
+
+#include "rust-tyty.h"
+
+namespace Rust {
+namespace TyTy {
+namespace VarianceAnalysis {
+
+class Variance;
+class GenericTyPerCrateCtx;
+
+/** Per crate context for variance analysis. */
+class CrateCtx
+{
+public:
+  CrateCtx ();
+  ~CrateCtx ();
+
+  /** Add type to variance analysis context. */
+  void add_type_constraints (ADTType &type);
+
+  /** Solve all constraints and print debug output. */
+  void solve ();
+
+  /** Get variance of a type parameters. */
+  std::vector<Variance> query_generic_variance (const ADTType &type);
+
+  /** Get variance of a type body (members, fn parameters...). */
+  std::vector<Variance> query_type_variances (BaseType *type);
+
+  /** Get regions mentioned in a type. */
+  std::vector<Region> query_type_regions (BaseType *type);
+
+private:
+  std::unique_ptr<GenericTyPerCrateCtx> private_ctx;
+};
+
+/** Variance semilattice */
+class Variance
+{
+  enum Kind : uint8_t
+  {
+    BIVARIANT = 0,     // 0b00
+    COVARIANT = 1,     // 0b01
+    CONTRAVARIANT = 2, // 0b10
+    INVARIANT = 3,     // 0b11
+  } kind;
+
+  static constexpr auto TOP = BIVARIANT;
+  static constexpr auto BOTTOM = INVARIANT;
+
+  constexpr Variance (Kind kind) : kind (kind) {}
+
+public:
+  constexpr Variance () : kind (TOP) {}
+
+  WARN_UNUSED_RESULT constexpr bool is_bivariant () const
+  {
+    return kind == BIVARIANT;
+  }
+  WARN_UNUSED_RESULT constexpr bool is_covariant () const
+  {
+    return kind == COVARIANT;
+  }
+  WARN_UNUSED_RESULT constexpr bool is_contravariant () const
+  {
+    return kind == CONTRAVARIANT;
+  }
+  WARN_UNUSED_RESULT constexpr bool is_invariant () const
+  {
+    return kind == INVARIANT;
+  }
+
+  static constexpr Variance bivariant () { return {BIVARIANT}; }
+  static constexpr Variance covariant () { return {COVARIANT}; }
+  static constexpr Variance contravariant () { return {CONTRAVARIANT}; }
+  static constexpr Variance invariant () { return {INVARIANT}; }
+
+  WARN_UNUSED_RESULT Variance reverse () const;
+  static WARN_UNUSED_RESULT Variance join (Variance lhs, Variance rhs);
+
+  void join (Variance rhs);
+
+  /**
+   * Variance composition function.
+   *
+   * For `A<X>` and `B<X>` and the composition `A<B<X>>` the variance of
+   * `v(A<B<X>>, X)` is defined as:
+   * ```
+   * v(A<B<X>>, X) = v(A<X>, X).transform(v(B<X>, X))
+   * ```
+   */
+  static WARN_UNUSED_RESULT Variance transform (Variance lhs, Variance rhs);
+
+  constexpr friend bool operator== (const Variance &lhs, const Variance &rhs)
+  {
+    return lhs.kind == rhs.kind;
+  }
+
+  constexpr friend bool operator!= (const Variance &lhs, const Variance &rhs)
+  {
+    return !(lhs == rhs);
+  }
+
+  WARN_UNUSED_RESULT std::string as_string () const;
+};
+
+} // namespace VarianceAnalysis
+
+} // namespace TyTy
+} // namespace Rust
+
+#endif // RUST_TYTY_VARIANCE_ANALYSIS_H
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 054/125] gccrs: TyTy: Collect variance info from types
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (51 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 053/125] gccrs: TyTy: Variance analysis module Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 055/125] gccrs: Store visibility properly in ExternalTypeItem Arthur Cohen
                   ` (70 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
	Collect variance info from types.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/typecheck/rust-hir-type-check-item.cc | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.cc b/gcc/rust/typecheck/rust-hir-type-check-item.cc
index 16b4906a356..4bbd28021a0 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-item.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-item.cc
@@ -25,6 +25,7 @@
 #include "rust-hir-trait-resolve.h"
 #include "rust-substitution-mapper.h"
 #include "rust-type-util.h"
+#include "rust-tyty-variance-analysis.h"
 
 namespace Rust {
 namespace Resolver {
@@ -204,7 +205,7 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
   TyTy::ADTType::ReprOptions repr
     = parse_repr_options (attrs, struct_decl.get_locus ());
 
-  TyTy::BaseType *type = new TyTy::ADTType (
+  auto *type = new TyTy::ADTType (
     struct_decl.get_mappings ().get_hirid (), mappings->get_next_hir_id (),
     struct_decl.get_identifier ().as_string (), ident,
     TyTy::ADTType::ADTKind::TUPLE_STRUCT, std::move (variants),
@@ -215,6 +216,8 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
 
   context->insert_type (struct_decl.get_mappings (), type);
   infered = type;
+
+  context->get_variance_analysis_ctx ().add_type_constraints (*type);
 }
 
 void
@@ -266,7 +269,7 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
   TyTy::ADTType::ReprOptions repr
     = parse_repr_options (attrs, struct_decl.get_locus ());
 
-  TyTy::BaseType *type = new TyTy::ADTType (
+  auto *type = new TyTy::ADTType (
     struct_decl.get_mappings ().get_hirid (), mappings->get_next_hir_id (),
     struct_decl.get_identifier ().as_string (), ident,
     TyTy::ADTType::ADTKind::STRUCT_STRUCT, std::move (variants),
@@ -277,6 +280,8 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
 
   context->insert_type (struct_decl.get_mappings (), type);
   infered = type;
+
+  context->get_variance_analysis_ctx ().add_type_constraints (*type);
 }
 
 void
@@ -307,7 +312,7 @@ TypeCheckItem::visit (HIR::Enum &enum_decl)
   RustIdent ident{*canonical_path, enum_decl.get_locus ()};
 
   // multi variant ADT
-  TyTy::BaseType *type
+  auto *type
     = new TyTy::ADTType (enum_decl.get_mappings ().get_hirid (),
 			 mappings->get_next_hir_id (),
 			 enum_decl.get_identifier ().as_string (), ident,
@@ -316,6 +321,8 @@ TypeCheckItem::visit (HIR::Enum &enum_decl)
 
   context->insert_type (enum_decl.get_mappings (), type);
   infered = type;
+
+  context->get_variance_analysis_ctx ().add_type_constraints (*type);
 }
 
 void
@@ -363,7 +370,7 @@ TypeCheckItem::visit (HIR::Union &union_decl)
 			  TyTy::VariantDef::VariantType::STRUCT, nullptr,
 			  std::move (fields)));
 
-  TyTy::BaseType *type
+  auto *type
     = new TyTy::ADTType (union_decl.get_mappings ().get_hirid (),
 			 mappings->get_next_hir_id (),
 			 union_decl.get_identifier ().as_string (), ident,
@@ -372,6 +379,8 @@ TypeCheckItem::visit (HIR::Union &union_decl)
 
   context->insert_type (union_decl.get_mappings (), type);
   infered = type;
+
+  context->get_variance_analysis_ctx ().add_type_constraints (*type);
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 055/125] gccrs: Store visibility properly in ExternalTypeItem
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (52 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 054/125] gccrs: TyTy: Collect variance info from types Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 056/125] gccrs: Fix typo Arthur Cohen
                   ` (69 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, jjasmine

From: jjasmine <tanghocle456@gmail.com>

Fix issue 2897

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-extern.h: Add translate_visiblity
	* hir/tree/rust-hir-item.h: Fix constructor of ExternalTypeItem
---
 gcc/rust/hir/rust-ast-lower-extern.h | 4 +++-
 gcc/rust/hir/tree/rust-hir-item.h    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/hir/rust-ast-lower-extern.h b/gcc/rust/hir/rust-ast-lower-extern.h
index e92acdc44a1..bd889e244b0 100644
--- a/gcc/rust/hir/rust-ast-lower-extern.h
+++ b/gcc/rust/hir/rust-ast-lower-extern.h
@@ -133,8 +133,10 @@ public:
 				   mappings->get_next_hir_id (crate_num),
 				   mappings->get_next_localdef_id (crate_num));
 
+    HIR::Visibility vis = translate_visibility (type.get_visibility ());
+
     translated = new HIR::ExternalTypeItem (mapping, type.get_identifier (),
-					    type.get_locus ());
+					    vis, type.get_locus ());
   }
 
 private:
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 3bd0102d4dc..7e0c8c6ffca 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -3154,9 +3154,9 @@ class ExternalTypeItem : public ExternalItem
 {
 public:
   ExternalTypeItem (Analysis::NodeMapping mappings, Identifier item_name,
-		    location_t locus)
+		    Visibility vis, location_t locus)
     : ExternalItem (std::move (mappings), std::move (item_name),
-		    Visibility (Visibility::PRIVATE),
+		    Visibility (std::move (vis)),
 		    /* FIXME: Is that correct? */
 		    {}, locus)
   {}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 056/125] gccrs: Fix typo
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (53 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 055/125] gccrs: Store visibility properly in ExternalTypeItem Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 057/125] gccrs: Split up rust-macro-builtins.cc Arthur Cohen
                   ` (68 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Guillaume Gomez

From: Guillaume Gomez <guillaume1.gomez@gmail.com>

gcc/rust/ChangeLog:

	* expand/rust-derive.cc (DeriveVisitor::derive): Fix typo
---
 gcc/rust/expand/rust-derive.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/expand/rust-derive.cc b/gcc/rust/expand/rust-derive.cc
index 4177004eccf..e6778fea972 100644
--- a/gcc/rust/expand/rust-derive.cc
+++ b/gcc/rust/expand/rust-derive.cc
@@ -45,7 +45,7 @@ DeriveVisitor::derive (Item &item, const Attribute &attr,
     case BuiltinMacro::PartialOrd:
     case BuiltinMacro::Hash:
     default:
-      rust_sorry_at (attr.get_locus (), "uninmplemented builtin derive macro");
+      rust_sorry_at (attr.get_locus (), "unimplemented builtin derive macro");
       return nullptr;
     };
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 057/125] gccrs: Split up rust-macro-builtins.cc
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (54 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 056/125] gccrs: Fix typo Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 058/125] gccrs: Placate clang-format re 'gcc/rust/lex/rust-lex.cc' Arthur Cohen
                   ` (67 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, jjasmine

From: jjasmine <tanghocle456@gmail.com>

Fixes issue #2855

gcc/rust/ChangeLog:

	* Make-lang.in: add new .o builds for new .cc files
	* expand/rust-cfg-strip.h (RUST_CFG_STRIP_H): Add include guards
	for rust-cfg-strip
	* expand/rust-macro-builtins.cc (make_macro_path_str): moved to new respective files
	(make_token): moved to new respective files
	(make_string): moved to new respective files
	(macro_end_token): moved to new respective files
	(try_extract_string_literal_from_fragment): moved to new respective files
	(try_expand_many_expr): moved to new respective files
	(parse_single_string_literal): moved to new respective files
	(source_relative_path): moved to new respective files
	(load_file_bytes): moved to new respective files
	(MacroBuiltin::assert_handler): moved to new respective files
	(MacroBuiltin::file_handler): moved to new respective files
	(MacroBuiltin::column_handler): moved to new respective files
	(MacroBuiltin::include_bytes_handler): moved to new respective files
	(MacroBuiltin::include_str_handler): moved to new respective files
	(MacroBuiltin::compile_error_handler): moved to new respective files
	(MacroBuiltin::concat_handler): moved to new respective files
	(MacroBuiltin::env_handler): moved to new respective files
	(MacroBuiltin::cfg_handler): moved to new respective files
	(MacroBuiltin::include_handler): moved to new respective files
	(MacroBuiltin::line_handler): moved to new respective files
	(MacroBuiltin::stringify_handler): moved to new respective files
	(struct FormatArgsInput): moved to new respective files
	(struct FormatArgsParseError): moved to new respective files
	(format_args_parse_arguments): moved to new respective files
	(MacroBuiltin::format_args_handler): moved to new respective files
	* expand/rust-macro-builtins.h (builtin_macro_from_string):
	merge tl::optional from master
	* expand/rust-macro-builtins-asm.cc: New file.
	* expand/rust-macro-builtins-format-args.cc: New file.
	* expand/rust-macro-builtins-helpers.cc: New file.
	* expand/rust-macro-builtins-helpers.h: New file.
	* expand/rust-macro-builtins-include.cc: New file.
	* expand/rust-macro-builtins-location.cc: New file.
	* expand/rust-macro-builtins-log-debug.cc: New file.
	* expand/rust-macro-builtins-test-bench.cc: New file.
	* expand/rust-macro-builtins-trait.cc: New file.
	* expand/rust-macro-builtins-utility.cc: New file.
---
 gcc/rust/Make-lang.in                         |   9 +
 gcc/rust/expand/rust-cfg-strip.h              |   4 +
 gcc/rust/expand/rust-macro-builtins-asm.cc    |  20 +
 .../expand/rust-macro-builtins-format-args.cc | 192 ++++
 .../expand/rust-macro-builtins-helpers.cc     | 284 +++++
 gcc/rust/expand/rust-macro-builtins-helpers.h |  90 ++
 .../expand/rust-macro-builtins-include.cc     | 249 +++++
 .../expand/rust-macro-builtins-location.cc    |  61 ++
 .../expand/rust-macro-builtins-log-debug.cc   |  31 +
 .../expand/rust-macro-builtins-test-bench.cc  |  20 +
 gcc/rust/expand/rust-macro-builtins-trait.cc  |  20 +
 .../expand/rust-macro-builtins-utility.cc     | 294 ++++++
 gcc/rust/expand/rust-macro-builtins.cc        | 981 +-----------------
 gcc/rust/expand/rust-macro-builtins.h         |  79 +-
 14 files changed, 1315 insertions(+), 1019 deletions(-)
 create mode 100644 gcc/rust/expand/rust-macro-builtins-asm.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-format-args.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-helpers.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-helpers.h
 create mode 100644 gcc/rust/expand/rust-macro-builtins-include.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-location.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-log-debug.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-test-bench.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-trait.cc
 create mode 100644 gcc/rust/expand/rust-macro-builtins-utility.cc

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 67df843349f..10af0814372 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -102,6 +102,15 @@ GRS_OBJS = \
     rust/rust-proc-macro-invoc-lexer.o \
     rust/rust-macro-substitute-ctx.o \
     rust/rust-macro-builtins.o \
+    rust/rust-macro-builtins-helpers.o \
+    rust/rust-macro-builtins-asm.o \
+    rust/rust-macro-builtins-trait.o \
+    rust/rust-macro-builtins-utility.o \
+    rust/rust-macro-builtins-log-debug.o \
+    rust/rust-macro-builtins-test-bench.o \
+    rust/rust-macro-builtins-format-args.o \
+    rust/rust-macro-builtins-location.o \
+    rust/rust-macro-builtins-include.o \
 	rust/rust-fmt.o \
     rust/rust-hir.o \
     rust/rust-hir-map.o \
diff --git a/gcc/rust/expand/rust-cfg-strip.h b/gcc/rust/expand/rust-cfg-strip.h
index 4a8e6041ff2..048cebdb991 100644
--- a/gcc/rust/expand/rust-cfg-strip.h
+++ b/gcc/rust/expand/rust-cfg-strip.h
@@ -15,6 +15,8 @@
 // You should have received a copy of the GNU General Public License
 // along with GCC; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
+#ifndef RUST_CFG_STRIP_H
+#define RUST_CFG_STRIP_H
 
 #include "rust-ast-visitor.h"
 #include "rust-ast.h"
@@ -190,3 +192,5 @@ public:
   }
 };
 } // namespace Rust
+
+#endif // RUST_CFG_STRIP_Hs
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc
new file mode 100644
index 00000000000..62bb5935280
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-asm.cc
@@ -0,0 +1,20 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
diff --git a/gcc/rust/expand/rust-macro-builtins-format-args.cc b/gcc/rust/expand/rust-macro-builtins-format-args.cc
new file mode 100644
index 00000000000..f42a07ff205
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-format-args.cc
@@ -0,0 +1,192 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+#include "rust-macro-builtins-helpers.h"
+#include "rust-expand-format-args.h"
+
+namespace Rust {
+
+struct FormatArgsInput
+{
+  std::string format_str;
+  AST::FormatArguments args;
+  // bool is_literal?
+};
+
+struct FormatArgsParseError
+{
+  enum class Kind
+  {
+    MissingArguments
+  } kind;
+};
+
+static tl::expected<FormatArgsInput, FormatArgsParseError>
+format_args_parse_arguments (AST::MacroInvocData &invoc)
+{
+  MacroInvocLexer lex (invoc.get_delim_tok_tree ().to_token_stream ());
+  Parser<MacroInvocLexer> parser (lex);
+
+  // TODO: check if EOF - return that format_args!() requires at least one
+  // argument
+
+  auto args = AST::FormatArguments ();
+  auto last_token_id = macro_end_token (invoc.get_delim_tok_tree (), parser);
+  std::unique_ptr<AST::Expr> format_expr = nullptr;
+
+  // TODO: Handle the case where we're not parsing a string literal (macro
+  // invocation for e.g.)
+  if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
+    format_expr = parser.parse_literal_expr ();
+
+  // TODO(Arthur): Clean this up - if we haven't parsed a string literal but a
+  // macro invocation, what do we do here? return a tl::unexpected?
+  auto format_str = static_cast<AST::LiteralExpr &> (*format_expr)
+		      .get_literal ()
+		      .as_string ();
+
+  // TODO: Allow implicit captures ONLY if the the first arg is a string literal
+  // and not a macro invocation
+
+  // TODO: How to consume all of the arguments until the delimiter?
+
+  // TODO: What we then want to do is as follows:
+  // for each token, check if it is an identifier
+  //     yes? is the next token an equal sign (=)
+  //          yes?
+  //              -> if that identifier is already present in our map, error
+  //              out
+  //              -> parse an expression, return a FormatArgument::Named
+  //     no?
+  //         -> if there have been named arguments before, error out
+  //         (positional after named error)
+  //         -> parse an expression, return a FormatArgument::Normal
+  while (parser.peek_current_token ()->get_id () != last_token_id)
+    {
+      parser.skip_token (COMMA);
+
+      if (parser.peek_current_token ()->get_id () == IDENTIFIER
+	  && parser.peek (1)->get_id () == EQUAL)
+	{
+	  // FIXME: This is ugly - just add a parser.parse_identifier()?
+	  auto ident_tok = parser.peek_current_token ();
+	  auto ident = Identifier (ident_tok);
+
+	  parser.skip_token (IDENTIFIER);
+	  parser.skip_token (EQUAL);
+
+	  auto expr = parser.parse_expr ();
+
+	  // TODO: Handle graciously
+	  if (!expr)
+	    rust_unreachable ();
+
+	  args.push (AST::FormatArgument::named (ident, std::move (expr)));
+	}
+      else
+	{
+	  auto expr = parser.parse_expr ();
+
+	  // TODO: Handle graciously
+	  if (!expr)
+	    rust_unreachable ();
+
+	  args.push (AST::FormatArgument::normal (std::move (expr)));
+	}
+      // we need to skip commas, don't we?
+    }
+
+  return FormatArgsInput{std::move (format_str), std::move (args)};
+}
+
+tl::optional<AST::Fragment>
+MacroBuiltin::format_args_handler (location_t invoc_locus,
+				   AST::MacroInvocData &invoc,
+				   AST::FormatArgs::Newline nl)
+{
+  auto input = format_args_parse_arguments (invoc);
+
+  if (!input)
+    {
+      rust_error_at (invoc_locus,
+		     "could not parse arguments to %<format_args!()%>");
+      return tl::nullopt;
+    }
+
+  // TODO(Arthur): We need to handle this
+  // // if it is not a literal, it's an eager macro invocation - return it
+  // if (!fmt_expr->is_literal ())
+  //   {
+  //     auto token_tree = invoc.get_delim_tok_tree ();
+  //     return AST::Fragment ({AST::SingleASTNode (std::move (fmt_expr))},
+  // 	    token_tree.to_token_stream ());
+  //   }
+
+  // TODO(Arthur): Handle this as well - raw strings are special for the
+  // format_args parser auto fmt_str = static_cast<AST::LiteralExpr &>
+  // (*fmt_arg.get ()); Switch on the format string to know if the string is raw
+  // or cooked switch (fmt_str.get_lit_type ())
+  //   {
+  //   // case AST::Literal::RAW_STRING:
+  //   case AST::Literal::STRING:
+  //     break;
+  //   case AST::Literal::CHAR:
+  //   case AST::Literal::BYTE:
+  //   case AST::Literal::BYTE_STRING:
+  //   case AST::Literal::INT:
+  //   case AST::Literal::FLOAT:
+  //   case AST::Literal::BOOL:
+  //   case AST::Literal::ERROR:
+  //     rust_unreachable ();
+  //   }
+
+  bool append_newline = nl == AST::FormatArgs::Newline::Yes;
+
+  auto fmt_str = std::move (input->format_str);
+  if (append_newline)
+    fmt_str += '\n';
+
+  auto pieces = Fmt::Pieces::collect (fmt_str, append_newline);
+
+  // TODO:
+  // do the transformation into an AST::FormatArgs node
+  // return that
+  // expand it during lowering
+
+  // TODO: we now need to take care of creating `unfinished_literal`? this is
+  // for creating the `template`
+
+  auto fmt_args_node = AST::FormatArgs (invoc_locus, std::move (pieces),
+					std::move (input->args));
+
+  auto expanded
+    = Fmt::expand_format_args (fmt_args_node,
+			       invoc.get_delim_tok_tree ().to_token_stream ());
+
+  if (!expanded.has_value ())
+    return AST::Fragment::create_error ();
+
+  return *expanded;
+
+  // auto node = std::unique_ptr<AST::Expr> (fmt_args_node);
+  // auto single_node = AST::SingleASTNode (std::move (node));
+
+  // return AST::Fragment ({std::move (single_node)},
+  // 	invoc.get_delim_tok_tree ().to_token_stream ());
+}
+
+} // namespace Rust
\ No newline at end of file
diff --git a/gcc/rust/expand/rust-macro-builtins-helpers.cc b/gcc/rust/expand/rust-macro-builtins-helpers.cc
new file mode 100644
index 00000000000..e9bf54f068a
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-helpers.cc
@@ -0,0 +1,284 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins-helpers.h"
+
+namespace Rust {
+
+std::string
+make_macro_path_str (BuiltinMacro kind)
+{
+  auto str = MacroBuiltin::builtins.lookup (kind);
+  rust_assert (str.has_value ());
+
+  return str.value ();
+}
+
+std::vector<std::unique_ptr<AST::MacroInvocation>>
+check_for_eager_invocations (
+  std::vector<std::unique_ptr<AST::Expr>> &expressions)
+{
+  std::vector<std::unique_ptr<AST::MacroInvocation>> pending;
+
+  for (auto &expr : expressions)
+    if (expr->get_ast_kind () == AST::Kind::MACRO_INVOCATION)
+      pending.emplace_back (std::unique_ptr<AST::MacroInvocation> (
+	static_cast<AST::MacroInvocation *> (expr->clone_expr ().release ())));
+
+  return pending;
+}
+
+//
+// Shorthand function for creating unique_ptr tokens
+//
+std::unique_ptr<AST::Token>
+make_token (const TokenPtr tok)
+{
+  return std::unique_ptr<AST::Token> (new AST::Token (tok));
+}
+
+std::unique_ptr<AST::Expr>
+make_string (location_t locus, std::string value)
+{
+  return std::unique_ptr<AST::Expr> (
+    new AST::LiteralExpr (value, AST::Literal::STRING,
+			  PrimitiveCoreType::CORETYPE_STR, {}, locus));
+}
+
+// TODO: Is this correct?
+AST::Fragment
+make_eager_builtin_invocation (
+  BuiltinMacro kind, location_t locus, AST::DelimTokenTree arguments,
+  std::vector<std::unique_ptr<AST::MacroInvocation>> &&pending_invocations)
+{
+  auto path_str = make_macro_path_str (kind);
+
+  std::unique_ptr<AST::Expr> node = AST::MacroInvocation::Builtin (
+    kind,
+    AST::MacroInvocData (AST::SimplePath (
+			   {AST::SimplePathSegment (path_str, locus)}),
+			 std::move (arguments)),
+    {}, locus, std::move (pending_invocations));
+
+  return AST::Fragment ({AST::SingleASTNode (std::move (node))},
+			arguments.to_token_stream ());
+}
+
+/* Match the end token of a macro given the start delimiter of the macro */
+TokenId
+macro_end_token (AST::DelimTokenTree &invoc_token_tree,
+		 Parser<MacroInvocLexer> &parser)
+{
+  auto last_token_id = TokenId::RIGHT_CURLY;
+  switch (invoc_token_tree.get_delim_type ())
+    {
+    case AST::DelimType::PARENS:
+      last_token_id = TokenId::RIGHT_PAREN;
+      rust_assert (parser.skip_token (LEFT_PAREN));
+      break;
+
+    case AST::DelimType::CURLY:
+      rust_assert (parser.skip_token (LEFT_CURLY));
+      break;
+
+    case AST::DelimType::SQUARE:
+      last_token_id = TokenId::RIGHT_SQUARE;
+      rust_assert (parser.skip_token (LEFT_SQUARE));
+      break;
+    }
+
+  return last_token_id;
+}
+
+// Expand and then extract a string literal from the macro
+std::unique_ptr<AST::LiteralExpr>
+try_extract_string_literal_from_fragment (const location_t &parent_locus,
+					  std::unique_ptr<AST::Expr> &node)
+{
+  auto maybe_lit = static_cast<AST::LiteralExpr *> (node.get ());
+  if (!node || !node->is_literal ()
+      || maybe_lit->get_lit_type () != AST::Literal::STRING)
+    {
+      rust_error_at (parent_locus, "argument must be a string literal");
+      if (node)
+	rust_inform (node->get_locus (), "expanded from here");
+      return nullptr;
+    }
+  return std::unique_ptr<AST::LiteralExpr> (
+    static_cast<AST::LiteralExpr *> (node->clone_expr ().release ()));
+}
+
+std::vector<std::unique_ptr<AST::Expr>>
+try_expand_many_expr (Parser<MacroInvocLexer> &parser,
+		      const TokenId last_token_id, MacroExpander *expander,
+		      bool &has_error)
+{
+  auto restrictions = Rust::ParseRestrictions ();
+  // stop parsing when encountered a braces/brackets
+  restrictions.expr_can_be_null = true;
+  // we can't use std::optional, so...
+  auto result = std::vector<std::unique_ptr<AST::Expr>> ();
+  auto empty_expr = std::vector<std::unique_ptr<AST::Expr>> ();
+
+  auto first_token = parser.peek_current_token ()->get_id ();
+  if (first_token == COMMA)
+    {
+      rust_error_at (parser.peek_current_token ()->get_locus (),
+		     "expected expression, found %<,%>");
+      has_error = true;
+      return empty_expr;
+    }
+
+  while (parser.peek_current_token ()->get_id () != last_token_id
+	 && parser.peek_current_token ()->get_id () != END_OF_FILE)
+    {
+      auto expr = parser.parse_expr (AST::AttrVec (), restrictions);
+      // something must be so wrong that the expression could not be parsed
+      rust_assert (expr);
+      result.push_back (std::move (expr));
+
+      auto next_token = parser.peek_current_token ();
+      if (!parser.skip_token (COMMA) && next_token->get_id () != last_token_id)
+	{
+	  rust_error_at (next_token->get_locus (), "expected token: %<,%>");
+	  // TODO: is this recoverable? to avoid crashing the parser in the next
+	  // fragment we have to exit early here
+	  has_error = true;
+	  return empty_expr;
+	}
+    }
+
+  return result;
+}
+
+// Parse a single string literal from the given delimited token tree,
+// and return the LiteralExpr for it. Allow for an optional trailing comma,
+// but otherwise enforce that these are the only tokens.
+// FIXME(Arthur): This function needs a rework - it should not emit errors, it
+// should probably be smaller
+std::unique_ptr<AST::Expr>
+parse_single_string_literal (BuiltinMacro kind,
+			     AST::DelimTokenTree &invoc_token_tree,
+			     location_t invoc_locus, MacroExpander *expander)
+{
+  MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
+  Parser<MacroInvocLexer> parser (lex);
+
+  auto last_token_id = macro_end_token (invoc_token_tree, parser);
+
+  std::unique_ptr<AST::LiteralExpr> lit_expr = nullptr;
+  std::unique_ptr<AST::MacroInvocation> macro_invoc = nullptr;
+
+  if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
+    {
+      lit_expr = parser.parse_literal_expr ();
+      parser.maybe_skip_token (COMMA);
+      if (parser.peek_current_token ()->get_id () != last_token_id)
+	{
+	  lit_expr = nullptr;
+	  rust_error_at (invoc_locus, "macro takes 1 argument");
+	}
+    }
+  else if (parser.peek_current_token ()->get_id () == last_token_id)
+    rust_error_at (invoc_locus, "macro takes 1 argument");
+  else
+    {
+      macro_invoc = parser.parse_macro_invocation (AST::AttrVec ());
+
+      parser.maybe_skip_token (COMMA);
+      if (parser.peek_current_token ()->get_id () != last_token_id)
+	{
+	  lit_expr = nullptr;
+	  rust_error_at (invoc_locus, "macro takes 1 argument");
+	}
+
+      if (macro_invoc != nullptr)
+	{
+	  auto path_str = make_macro_path_str (kind);
+
+	  auto pending_invocations
+	    = std::vector<std::unique_ptr<AST::MacroInvocation>> ();
+
+	  pending_invocations.push_back (std::move (macro_invoc));
+
+	  return AST::MacroInvocation::Builtin (
+	    kind,
+	    AST::MacroInvocData (AST::SimplePath ({AST::SimplePathSegment (
+				   path_str, invoc_locus)}),
+				 std::move (invoc_token_tree)),
+	    {}, invoc_locus, std::move (pending_invocations));
+	}
+      else
+	{
+	  rust_error_at (invoc_locus, "argument must be a string literal or a "
+				      "macro which expands to a string");
+	}
+    }
+
+  parser.skip_token (last_token_id);
+
+  return std::unique_ptr<AST::Expr> (std::move (lit_expr));
+}
+
+/* Treat PATH as a path relative to the source file currently being
+   compiled, and return the absolute path for it.  */
+std::string
+source_relative_path (std::string path, location_t locus)
+{
+  std::string compile_fname = LOCATION_FILE (locus);
+
+  auto dir_separator_pos = compile_fname.rfind (file_separator);
+
+  /* If there is no file_separator in the path, use current dir ('.').  */
+  std::string dirname;
+  if (dir_separator_pos == std::string::npos)
+    dirname = std::string (".") + file_separator;
+  else
+    dirname = compile_fname.substr (0, dir_separator_pos) + file_separator;
+
+  return dirname + path;
+}
+
+/* Read the full contents of the file FILENAME and return them in a vector.
+   FIXME: platform specific.  */
+tl::optional<std::vector<uint8_t>>
+load_file_bytes (location_t invoc_locus, const char *filename)
+{
+  RAIIFile file_wrap (filename);
+  if (file_wrap.get_raw () == nullptr)
+    {
+      rust_error_at (invoc_locus, "cannot open filename %s: %m", filename);
+      return tl::nullopt;
+    }
+
+  FILE *f = file_wrap.get_raw ();
+  fseek (f, 0L, SEEK_END);
+  long fsize = ftell (f);
+  fseek (f, 0L, SEEK_SET);
+
+  std::vector<uint8_t> buf (fsize);
+
+  if (fsize > 0 && fread (&buf[0], fsize, 1, f) != 1)
+    {
+      rust_error_at (invoc_locus, "error reading file %s: %m", filename);
+      return std::vector<uint8_t> ();
+    }
+
+  return buf;
+}
+} // namespace Rust
\ No newline at end of file
diff --git a/gcc/rust/expand/rust-macro-builtins-helpers.h b/gcc/rust/expand/rust-macro-builtins-helpers.h
new file mode 100644
index 00000000000..f5d018b35f8
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-helpers.h
@@ -0,0 +1,90 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef GCCRS_RUST_MACRO_BUILTINS_HELPERS_H
+#define GCCRS_RUST_MACRO_BUILTINS_HELPERS_H
+#include "rust-ast-fragment.h"
+#include "rust-ast.h"
+#include "rust-cfg-strip.h"
+#include "rust-diagnostics.h"
+#include "rust-early-name-resolver.h"
+#include "rust-expr.h"
+#include "rust-lex.h"
+#include "rust-macro-builtins.h"
+#include "rust-macro-invoc-lexer.h"
+#include "rust-macro.h"
+#include "rust-parse.h"
+#include "rust-session-manager.h"
+#include "rust-system.h"
+#include "rust-token.h"
+namespace Rust {
+
+std::string
+make_macro_path_str (BuiltinMacro kind);
+
+std::vector<std::unique_ptr<AST::MacroInvocation>>
+check_for_eager_invocations (
+  std::vector<std::unique_ptr<AST::Expr>> &expressions);
+
+// Shorthand function for creating unique_ptr tokens
+
+std::unique_ptr<AST::Token>
+make_token (const TokenPtr tok);
+
+std::unique_ptr<AST::Expr>
+make_string (location_t locus, std::string value);
+// TODO: Is this correct?
+AST::Fragment
+make_eager_builtin_invocation (
+  BuiltinMacro kind, location_t locus, AST::DelimTokenTree arguments,
+  std::vector<std::unique_ptr<AST::MacroInvocation>> &&pending_invocations);
+// Match the end token of a macro given the start delimiter of the macro
+TokenId
+macro_end_token (AST::DelimTokenTree &invoc_token_tree,
+		 Parser<MacroInvocLexer> &parser);
+// Expand and then extract a string literal from the macro
+std::unique_ptr<AST::LiteralExpr>
+try_extract_string_literal_from_fragment (const location_t &parent_locus,
+					  std::unique_ptr<AST::Expr> &node);
+
+std::vector<std::unique_ptr<AST::Expr>>
+try_expand_many_expr (Parser<MacroInvocLexer> &parser,
+		      const TokenId last_token_id, MacroExpander *expander,
+		      bool &has_error);
+
+// Parse a single string literal from the given delimited token tree,
+//   and return the LiteralExpr for it. Allow for an optional trailing comma,
+//   but otherwise enforce that these are the only tokens.
+
+std::unique_ptr<AST::Expr>
+parse_single_string_literal (BuiltinMacro kind,
+			     AST::DelimTokenTree &invoc_token_tree,
+			     location_t invoc_locus, MacroExpander *expander);
+
+// Treat PATH as a path relative to the source file currently being
+// compiled, and return the absolute path for it.
+
+std::string
+source_relative_path (std::string path, location_t locus);
+
+// Read the full contents of the file FILENAME and return them in a vector.
+// FIXME: platform specific.
+tl::optional<std::vector<uint8_t>>
+load_file_bytes (location_t invoc_locus, const char *filename);
+} // namespace Rust
+#endif // GCCRS_RUST_MACRO_BUILTINS_HELPERS_H
diff --git a/gcc/rust/expand/rust-macro-builtins-include.cc b/gcc/rust/expand/rust-macro-builtins-include.cc
new file mode 100644
index 00000000000..c3b1e65ffc6
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-include.cc
@@ -0,0 +1,249 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
+#include "optional.h"
+namespace Rust {
+/* Expand builtin macro include_bytes!("filename"), which includes the contents
+of the given file as reference to a byte array. Yields an expression of type
+&'static [u8; N].  */
+
+tl::optional<AST::Fragment>
+MacroBuiltin::include_bytes_handler (location_t invoc_locus,
+				     AST::MacroInvocData &invoc)
+{
+  /* Get target filename from the macro invocation, which is treated as a path
+     relative to the include!-ing file (currently being compiled).  */
+  auto lit_expr
+    = parse_single_string_literal (BuiltinMacro::IncludeBytes,
+				   invoc.get_delim_tok_tree (), invoc_locus,
+				   invoc.get_expander ());
+  if (lit_expr == nullptr)
+    return AST::Fragment::create_error ();
+
+  rust_assert (lit_expr->is_literal ());
+
+  std::string target_filename
+    = source_relative_path (lit_expr->as_string (), invoc_locus);
+
+  auto maybe_bytes = load_file_bytes (invoc_locus, target_filename.c_str ());
+
+  if (!maybe_bytes.has_value ())
+    return AST::Fragment::create_error ();
+
+  std::vector<uint8_t> bytes = maybe_bytes.value ();
+
+  /* Is there a more efficient way to do this?  */
+  std::vector<std::unique_ptr<AST::Expr>> elts;
+
+  // We create the tokens for a borrow expression of a byte array, so
+  // & [ <byte0>, <byte1>, ... ]
+  std::vector<std::unique_ptr<AST::Token>> toks;
+  toks.emplace_back (make_token (Token::make (AMP, invoc_locus)));
+  toks.emplace_back (make_token (Token::make (LEFT_SQUARE, invoc_locus)));
+
+  for (uint8_t b : bytes)
+    {
+      elts.emplace_back (
+	new AST::LiteralExpr (std::string (1, (char) b), AST::Literal::BYTE,
+			      PrimitiveCoreType::CORETYPE_U8,
+			      {} /* outer_attrs */, invoc_locus));
+      toks.emplace_back (make_token (Token::make_byte_char (invoc_locus, b)));
+      toks.emplace_back (make_token (Token::make (COMMA, invoc_locus)));
+    }
+
+  toks.emplace_back (make_token (Token::make (RIGHT_SQUARE, invoc_locus)));
+
+  auto elems = std::unique_ptr<AST::ArrayElems> (
+    new AST::ArrayElemsValues (std::move (elts), invoc_locus));
+
+  auto array = std::unique_ptr<AST::Expr> (
+    new AST::ArrayExpr (std::move (elems), {}, {}, invoc_locus));
+
+  auto borrow = std::unique_ptr<AST::Expr> (
+    new AST::BorrowExpr (std::move (array), false, false, {}, invoc_locus));
+
+  auto node = AST::SingleASTNode (std::move (borrow));
+
+  return AST::Fragment ({node}, std::move (toks));
+}
+
+/* Expand builtin macro include_str!("filename"), which includes the contents
+   of the given file as a string. The file must be UTF-8 encoded. Yields an
+   expression of type &'static str.  */
+
+tl::optional<AST::Fragment>
+MacroBuiltin::include_str_handler (location_t invoc_locus,
+				   AST::MacroInvocData &invoc)
+{
+  /* Get target filename from the macro invocation, which is treated as a path
+     relative to the include!-ing file (currently being compiled).  */
+  auto lit_expr
+    = parse_single_string_literal (BuiltinMacro::IncludeStr,
+				   invoc.get_delim_tok_tree (), invoc_locus,
+				   invoc.get_expander ());
+  if (lit_expr == nullptr)
+    return AST::Fragment::create_error ();
+
+  if (!lit_expr->is_literal ())
+    {
+      auto token_tree = invoc.get_delim_tok_tree ();
+      return AST::Fragment ({AST::SingleASTNode (std::move (lit_expr))},
+			    token_tree.to_token_stream ());
+    }
+
+  std::string target_filename
+    = source_relative_path (lit_expr->as_string (), invoc_locus);
+
+  auto maybe_bytes = load_file_bytes (invoc_locus, target_filename.c_str ());
+
+  if (!maybe_bytes.has_value ())
+    return AST::Fragment::create_error ();
+
+  std::vector<uint8_t> bytes = maybe_bytes.value ();
+
+  /* FIXME: reuse lexer */
+  int expect_single = 0;
+  for (uint8_t b : bytes)
+    {
+      if (expect_single)
+	{
+	  if ((b & 0xC0) != 0x80)
+	    /* character was truncated, exit with expect_single != 0 */
+	    break;
+	  expect_single--;
+	}
+      else if (b & 0x80)
+	{
+	  if (b >= 0xF8)
+	    {
+	      /* more than 4 leading 1s */
+	      expect_single = 1;
+	      break;
+	    }
+	  else if (b >= 0xF0)
+	    {
+	      /* 4 leading 1s */
+	      expect_single = 3;
+	    }
+	  else if (b >= 0xE0)
+	    {
+	      /* 3 leading 1s */
+	      expect_single = 2;
+	    }
+	  else if (b >= 0xC0)
+	    {
+	      /* 2 leading 1s */
+	      expect_single = 1;
+	    }
+	  else
+	    {
+	      /* only 1 leading 1 */
+	      expect_single = 1;
+	      break;
+	    }
+	}
+    }
+
+  std::string str;
+  if (expect_single)
+    rust_error_at (invoc_locus, "%s was not a valid utf-8 file",
+		   target_filename.c_str ());
+  else
+    str = std::string ((const char *) bytes.data (), bytes.size ());
+
+  auto node = AST::SingleASTNode (make_string (invoc_locus, str));
+  auto str_tok = make_token (Token::make_string (invoc_locus, std::move (str)));
+
+  return AST::Fragment ({node}, std::move (str_tok));
+}
+
+/* Expand builtin macro include!(), which includes a source file at the current
+scope compile time. */
+
+tl::optional<AST::Fragment>
+MacroBuiltin::include_handler (location_t invoc_locus,
+			       AST::MacroInvocData &invoc)
+{
+  /* Get target filename from the macro invocation, which is treated as a path
+     relative to the include!-ing file (currently being compiled).  */
+  auto lit_expr
+    = parse_single_string_literal (BuiltinMacro::Include,
+				   invoc.get_delim_tok_tree (), invoc_locus,
+				   invoc.get_expander ());
+  if (lit_expr == nullptr)
+    return AST::Fragment::create_error ();
+
+  rust_assert (lit_expr->is_literal ());
+
+  std::string filename
+    = source_relative_path (lit_expr->as_string (), invoc_locus);
+  auto target_filename
+    = Rust::Session::get_instance ().include_extra_file (std::move (filename));
+
+  RAIIFile target_file (target_filename);
+  Linemap *linemap = Session::get_instance ().linemap;
+
+  if (!target_file.ok ())
+    {
+      rust_error_at (lit_expr->get_locus (),
+		     "cannot open included file %qs: %m", target_filename);
+      return AST::Fragment::create_error ();
+    }
+
+  rust_debug ("Attempting to parse included file %s", target_filename);
+
+  Lexer lex (target_filename, std::move (target_file), linemap);
+  Parser<Lexer> parser (lex);
+
+  auto parsed_items = parser.parse_items ();
+  bool has_error = !parser.get_errors ().empty ();
+
+  for (const auto &error : parser.get_errors ())
+    error.emit ();
+
+  if (has_error)
+    {
+      // inform the user that the errors above are from a included file
+      rust_inform (invoc_locus, "included from here");
+      return AST::Fragment::create_error ();
+    }
+
+  std::vector<AST::SingleASTNode> nodes{};
+  for (auto &item : parsed_items)
+    {
+      AST::SingleASTNode node (std::move (item));
+      nodes.push_back (node);
+    }
+
+  // FIXME: This returns an empty vector of tokens and works fine, but is that
+  // the expected behavior? `include` macros are a bit harder to reason about
+  // since they include tokens. Furthermore, our lexer has no easy way to return
+  // a slice of tokens like the MacroInvocLexer. So it gets even harder to
+  // extrac tokens from here. For now, let's keep it that way and see if it
+  // eventually breaks, but I don't expect it to cause many issues since the
+  // list of tokens is only used when a macro invocation mixes eager
+  // macro invocations and already expanded tokens. Think
+  // `concat!(a!(), 15, b!())`. We need to be able to expand a!(), expand b!(),
+  // and then insert the `15` token in between. In the case of `include!()`, we
+  // only have one argument. So it's either going to be a macro invocation or a
+  // string literal.
+  return AST::Fragment (nodes, std::vector<std::unique_ptr<AST::Token>> ());
+}
+} // namespace Rust
\ No newline at end of file
diff --git a/gcc/rust/expand/rust-macro-builtins-location.cc b/gcc/rust/expand/rust-macro-builtins-location.cc
new file mode 100644
index 00000000000..19857487c0b
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-location.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
+
+namespace Rust {
+tl::optional<AST::Fragment>
+MacroBuiltin::file_handler (location_t invoc_locus, AST::MacroInvocData &)
+{
+  auto current_file = LOCATION_FILE (invoc_locus);
+  auto file_str = AST::SingleASTNode (make_string (invoc_locus, current_file));
+  auto str_token
+    = make_token (Token::make_string (invoc_locus, std::move (current_file)));
+
+  return AST::Fragment ({file_str}, std::move (str_token));
+}
+
+tl::optional<AST::Fragment>
+MacroBuiltin::column_handler (location_t invoc_locus, AST::MacroInvocData &)
+{
+  auto current_column = LOCATION_COLUMN (invoc_locus);
+
+  auto column_tok = make_token (
+    Token::make_int (invoc_locus, std::to_string (current_column)));
+  auto column_no = AST::SingleASTNode (std::unique_ptr<AST::Expr> (
+    new AST::LiteralExpr (std::to_string (current_column), AST::Literal::INT,
+			  PrimitiveCoreType::CORETYPE_U32, {}, invoc_locus)));
+
+  return AST::Fragment ({column_no}, std::move (column_tok));
+}
+
+tl::optional<AST::Fragment>
+MacroBuiltin::line_handler (location_t invoc_locus, AST::MacroInvocData &)
+{
+  auto current_line = LOCATION_LINE (invoc_locus);
+
+  auto line_no = AST::SingleASTNode (std::unique_ptr<AST::Expr> (
+    new AST::LiteralExpr (std::to_string (current_line), AST::Literal::INT,
+			  PrimitiveCoreType::CORETYPE_U32, {}, invoc_locus)));
+  auto tok
+    = make_token (Token::make_int (invoc_locus, std::to_string (current_line)));
+
+  return AST::Fragment ({line_no}, std::move (tok));
+}
+} // namespace Rust
diff --git a/gcc/rust/expand/rust-macro-builtins-log-debug.cc b/gcc/rust/expand/rust-macro-builtins-log-debug.cc
new file mode 100644
index 00000000000..56bd3034b08
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-log-debug.cc
@@ -0,0 +1,31 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
+
+namespace Rust {
+tl::optional<AST::Fragment>
+MacroBuiltin::assert_handler (location_t invoc_locus,
+			      AST::MacroInvocData &invoc)
+{
+  rust_debug ("assert!() called");
+
+  return AST::Fragment::create_error ();
+}
+} // namespace Rust
\ No newline at end of file
diff --git a/gcc/rust/expand/rust-macro-builtins-test-bench.cc b/gcc/rust/expand/rust-macro-builtins-test-bench.cc
new file mode 100644
index 00000000000..62bb5935280
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-test-bench.cc
@@ -0,0 +1,20 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
diff --git a/gcc/rust/expand/rust-macro-builtins-trait.cc b/gcc/rust/expand/rust-macro-builtins-trait.cc
new file mode 100644
index 00000000000..62bb5935280
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-trait.cc
@@ -0,0 +1,20 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
diff --git a/gcc/rust/expand/rust-macro-builtins-utility.cc b/gcc/rust/expand/rust-macro-builtins-utility.cc
new file mode 100644
index 00000000000..c5932b3d978
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-builtins-utility.cc
@@ -0,0 +1,294 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-fmt.h"
+#include "rust-macro-builtins.h"
+#include "rust-macro-builtins-helpers.h"
+
+namespace Rust {
+
+/* Expand builtin macro compile_error!("error"), which forces a compile error
+   during the compile time. */
+tl::optional<AST::Fragment>
+MacroBuiltin::compile_error_handler (location_t invoc_locus,
+				     AST::MacroInvocData &invoc)
+{
+  auto lit_expr
+    = parse_single_string_literal (BuiltinMacro::CompileError,
+				   invoc.get_delim_tok_tree (), invoc_locus,
+				   invoc.get_expander ());
+  if (lit_expr == nullptr)
+    return AST::Fragment::create_error ();
+
+  rust_assert (lit_expr->is_literal ());
+
+  std::string error_string = lit_expr->as_string ();
+  rust_error_at (invoc_locus, "%s", error_string.c_str ());
+
+  return AST::Fragment::create_error ();
+}
+
+/* Expand builtin macro concat!(), which joins all the literal parameters
+   into a string with no delimiter. */
+
+// This is a weird one. We want to do something where, if something cannot be
+// expanded yet (i.e. macro invocation?) we return the whole MacroInvocation
+// node again but expanded as much as possible.
+// Is that possible? How do we do that?
+//
+// Let's take a few examples:
+//
+// 1. concat!(1, 2, true);
+// 2. concat!(a!(), 2, true);
+// 3. concat!(concat!(1, false), 2, true);
+// 4. concat!(concat!(1, a!()), 2, true);
+//
+// 1. We simply want to return the new fragment: "12true"
+// 2. We want to return `concat!(a_expanded, 2, true)` as a fragment
+// 3. We want to return `concat!(1, false, 2, true)`
+// 4. We want to return `concat!(concat!(1, a_expanded), 2, true);
+//
+// How do we do that?
+//
+// For each (un)expanded fragment: we check if it is expanded fully
+//
+// 1. What is expanded fully?
+// 2. How to check?
+//
+// If it is expanded fully and not a literal, then we error out.
+// Otherwise we simply emplace it back and keep going.
+//
+// In the second case, we must mark that this concat invocation still has some
+// expansion to do: This allows us to return a `MacroInvocation { ... }` as an
+// AST fragment, instead of a completed string.
+//
+// This means that we must change all the `try_expand_many_*` APIs and so on to
+// return some sort of index or way to signify that we might want to reuse some
+// bits and pieces of the original token tree.
+//
+// Now, before that: How do we resolve the names used in a builtin macro
+// invocation?
+// Do we split the two passes of parsing the token tree and then expanding it?
+// Can we do that easily?
+tl::optional<AST::Fragment>
+MacroBuiltin::concat_handler (location_t invoc_locus,
+			      AST::MacroInvocData &invoc)
+{
+  auto invoc_token_tree = invoc.get_delim_tok_tree ();
+  MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
+  Parser<MacroInvocLexer> parser (lex);
+
+  auto str = std::string ();
+  bool has_error = false;
+
+  auto last_token_id = macro_end_token (invoc_token_tree, parser);
+
+  auto start = lex.get_offs ();
+  /* NOTE: concat! could accept no argument, so we don't have any checks here */
+  auto expanded_expr = try_expand_many_expr (parser, last_token_id,
+					     invoc.get_expander (), has_error);
+  auto end = lex.get_offs ();
+
+  auto tokens = lex.get_token_slice (start, end);
+
+  auto pending_invocations = check_for_eager_invocations (expanded_expr);
+  if (!pending_invocations.empty ())
+    return make_eager_builtin_invocation (BuiltinMacro::Concat, invoc_locus,
+					  invoc.get_delim_tok_tree (),
+					  std::move (pending_invocations));
+
+  for (auto &expr : expanded_expr)
+    {
+      if (!expr->is_literal ()
+	  && expr->get_ast_kind () != AST::Kind::MACRO_INVOCATION)
+	{
+	  has_error = true;
+	  rust_error_at (expr->get_locus (), "expected a literal");
+	  // diagnostics copied from rustc
+	  rust_inform (expr->get_locus (),
+		       "only literals (like %<\"foo\"%>, %<42%> and "
+		       "%<3.14%>) can be passed to %<concat!()%>");
+	  continue;
+	}
+      auto *literal = static_cast<AST::LiteralExpr *> (expr.get ());
+      if (literal->get_lit_type () == AST::Literal::BYTE
+	  || literal->get_lit_type () == AST::Literal::BYTE_STRING)
+	{
+	  has_error = true;
+	  rust_error_at (expr->get_locus (),
+			 "cannot concatenate a byte string literal");
+	  continue;
+	}
+      str += literal->as_string ();
+    }
+
+  parser.skip_token (last_token_id);
+
+  if (has_error)
+    return AST::Fragment::create_error ();
+
+  auto node = AST::SingleASTNode (make_string (invoc_locus, str));
+  auto str_tok = make_token (Token::make_string (invoc_locus, std::move (str)));
+
+  return AST::Fragment ({node}, std::move (str_tok));
+}
+
+/* Expand builtin macro env!(), which inspects an environment variable at
+   compile time. */
+tl::optional<AST::Fragment>
+MacroBuiltin::env_handler (location_t invoc_locus, AST::MacroInvocData &invoc)
+{
+  auto invoc_token_tree = invoc.get_delim_tok_tree ();
+  MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
+  Parser<MacroInvocLexer> parser (lex);
+
+  auto last_token_id = macro_end_token (invoc_token_tree, parser);
+  std::unique_ptr<AST::LiteralExpr> error_expr = nullptr;
+  std::unique_ptr<AST::LiteralExpr> lit_expr = nullptr;
+  bool has_error = false;
+
+  auto start = lex.get_offs ();
+  auto expanded_expr = try_expand_many_expr (parser, last_token_id,
+					     invoc.get_expander (), has_error);
+  auto end = lex.get_offs ();
+
+  auto tokens = lex.get_token_slice (start, end);
+
+  if (has_error)
+    return AST::Fragment::create_error ();
+
+  auto pending = check_for_eager_invocations (expanded_expr);
+  if (!pending.empty ())
+    return make_eager_builtin_invocation (BuiltinMacro::Env, invoc_locus,
+					  invoc_token_tree,
+					  std::move (pending));
+
+  if (expanded_expr.size () < 1 || expanded_expr.size () > 2)
+    {
+      rust_error_at (invoc_locus, "env! takes 1 or 2 arguments");
+      return AST::Fragment::create_error ();
+    }
+  if (expanded_expr.size () > 0)
+    {
+      if (!(lit_expr
+	    = try_extract_string_literal_from_fragment (invoc_locus,
+							expanded_expr[0])))
+	{
+	  return AST::Fragment::create_error ();
+	}
+    }
+  if (expanded_expr.size () > 1)
+    {
+      if (!(error_expr
+	    = try_extract_string_literal_from_fragment (invoc_locus,
+							expanded_expr[1])))
+	{
+	  return AST::Fragment::create_error ();
+	}
+    }
+
+  parser.skip_token (last_token_id);
+
+  auto env_value = getenv (lit_expr->as_string ().c_str ());
+
+  if (env_value == nullptr)
+    {
+      if (error_expr == nullptr)
+	rust_error_at (invoc_locus, "environment variable %qs not defined",
+		       lit_expr->as_string ().c_str ());
+      else
+	rust_error_at (invoc_locus, "%s", error_expr->as_string ().c_str ());
+      return AST::Fragment::create_error ();
+    }
+
+  auto node = AST::SingleASTNode (make_string (invoc_locus, env_value));
+  auto tok
+    = make_token (Token::make_string (invoc_locus, std::move (env_value)));
+
+  return AST::Fragment ({node}, std::move (tok));
+}
+
+tl::optional<AST::Fragment>
+MacroBuiltin::cfg_handler (location_t invoc_locus, AST::MacroInvocData &invoc)
+{
+  // only parse if not already parsed
+  if (!invoc.is_parsed ())
+    {
+      std::unique_ptr<AST::AttrInputMetaItemContainer> converted_input (
+	invoc.get_delim_tok_tree ().parse_to_meta_item ());
+
+      if (converted_input == nullptr)
+	{
+	  rust_debug ("DEBUG: failed to parse macro to meta item");
+	  // TODO: do something now? is this an actual error?
+	}
+      else
+	{
+	  std::vector<std::unique_ptr<AST::MetaItemInner>> meta_items (
+	    std::move (converted_input->get_items ()));
+	  invoc.set_meta_item_output (std::move (meta_items));
+	}
+    }
+
+  /* TODO: assuming that cfg! macros can only have one meta item inner, like cfg
+   * attributes */
+  if (invoc.get_meta_items ().size () != 1)
+    return AST::Fragment::create_error ();
+
+  bool result = invoc.get_meta_items ()[0]->check_cfg_predicate (
+    Session::get_instance ());
+  auto literal_exp = AST::SingleASTNode (std::unique_ptr<AST::Expr> (
+    new AST::LiteralExpr (result ? "true" : "false", AST::Literal::BOOL,
+			  PrimitiveCoreType::CORETYPE_BOOL, {}, invoc_locus)));
+  auto tok = make_token (
+    Token::make (result ? TRUE_LITERAL : FALSE_LITERAL, invoc_locus));
+
+  return AST::Fragment ({literal_exp}, std::move (tok));
+}
+
+tl::optional<AST::Fragment>
+MacroBuiltin::stringify_handler (location_t invoc_locus,
+				 AST::MacroInvocData &invoc)
+{
+  std::string content;
+  auto invoc_token_tree = invoc.get_delim_tok_tree ();
+  auto tokens = invoc_token_tree.to_token_stream ();
+
+  // Tokens stream includes the first and last delimiter
+  // which we need to skip.
+  for (auto token = tokens.cbegin () + 1; token < tokens.cend () - 1; token++)
+    {
+      // Rust stringify format has no garantees but the reference compiler
+      // removes spaces before some tokens depending on the lexer's behavior,
+      // let's mimick some of those behaviors.
+      auto token_id = (*token)->get_id ();
+      if (token_id != RIGHT_PAREN && token_id != EXCLAM
+	  && token != tokens.cbegin () + 1)
+	{
+	  content.push_back (' ');
+	}
+      content += (*token)->as_string ();
+    }
+
+  auto node = AST::SingleASTNode (make_string (invoc_locus, content));
+  auto token
+    = make_token (Token::make_string (invoc_locus, std::move (content)));
+  return AST::Fragment ({node}, std::move (token));
+}
+
+} // namespace Rust
\ No newline at end of file
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index a33a57752da..bc5bc944e77 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -40,6 +40,7 @@
 #include "rust-fmt.h"
 #include "rust-token.h"
 
+#include "rust-macro-builtins-helpers.h"
 namespace Rust {
 
 const BiMap<std::string, BuiltinMacro> MacroBuiltin::builtins = {{
@@ -149,986 +150,6 @@ builtin_macro_from_string (const std::string &identifier)
   return macro;
 }
 
-namespace {
-std::string
-make_macro_path_str (BuiltinMacro kind)
-{
-  auto str = MacroBuiltin::builtins.lookup (kind);
-  rust_assert (str.has_value ());
-
-  return str.value ();
-}
-
-static std::vector<std::unique_ptr<AST::MacroInvocation>>
-check_for_eager_invocations (
-  std::vector<std::unique_ptr<AST::Expr>> &expressions)
-{
-  std::vector<std::unique_ptr<AST::MacroInvocation>> pending;
-
-  for (auto &expr : expressions)
-    if (expr->get_ast_kind () == AST::Kind::MACRO_INVOCATION)
-      pending.emplace_back (std::unique_ptr<AST::MacroInvocation> (
-	static_cast<AST::MacroInvocation *> (expr->clone_expr ().release ())));
-
-  return pending;
-}
-
-/**
- * Shorthand function for creating unique_ptr tokens
- */
-static std::unique_ptr<AST::Token>
-make_token (const TokenPtr tok)
-{
-  return std::unique_ptr<AST::Token> (new AST::Token (tok));
-}
-
-std::unique_ptr<AST::Expr>
-make_string (location_t locus, std::string value)
-{
-  return std::unique_ptr<AST::Expr> (
-    new AST::LiteralExpr (value, AST::Literal::STRING,
-			  PrimitiveCoreType::CORETYPE_STR, {}, locus));
-}
-
-// TODO: Is this correct?
-static AST::Fragment
-make_eager_builtin_invocation (
-  BuiltinMacro kind, location_t locus, AST::DelimTokenTree arguments,
-  std::vector<std::unique_ptr<AST::MacroInvocation>> &&pending_invocations)
-{
-  auto path_str = make_macro_path_str (kind);
-
-  std::unique_ptr<AST::Expr> node = AST::MacroInvocation::Builtin (
-    kind,
-    AST::MacroInvocData (AST::SimplePath (
-			   {AST::SimplePathSegment (path_str, locus)}),
-			 std::move (arguments)),
-    {}, locus, std::move (pending_invocations));
-
-  return AST::Fragment ({AST::SingleASTNode (std::move (node))},
-			arguments.to_token_stream ());
-}
-
-/* Match the end token of a macro given the start delimiter of the macro */
-static inline TokenId
-macro_end_token (AST::DelimTokenTree &invoc_token_tree,
-		 Parser<MacroInvocLexer> &parser)
-{
-  auto last_token_id = TokenId::RIGHT_CURLY;
-  switch (invoc_token_tree.get_delim_type ())
-    {
-    case AST::DelimType::PARENS:
-      last_token_id = TokenId::RIGHT_PAREN;
-      rust_assert (parser.skip_token (LEFT_PAREN));
-      break;
-
-    case AST::DelimType::CURLY:
-      rust_assert (parser.skip_token (LEFT_CURLY));
-      break;
-
-    case AST::DelimType::SQUARE:
-      last_token_id = TokenId::RIGHT_SQUARE;
-      rust_assert (parser.skip_token (LEFT_SQUARE));
-      break;
-    }
-
-  return last_token_id;
-}
-
-/* Expand and then extract a string literal from the macro */
-static std::unique_ptr<AST::LiteralExpr>
-try_extract_string_literal_from_fragment (const location_t &parent_locus,
-					  std::unique_ptr<AST::Expr> &node)
-{
-  auto maybe_lit = static_cast<AST::LiteralExpr *> (node.get ());
-  if (!node || !node->is_literal ()
-      || maybe_lit->get_lit_type () != AST::Literal::STRING)
-    {
-      rust_error_at (parent_locus, "argument must be a string literal");
-      if (node)
-	rust_inform (node->get_locus (), "expanded from here");
-      return nullptr;
-    }
-  return std::unique_ptr<AST::LiteralExpr> (
-    static_cast<AST::LiteralExpr *> (node->clone_expr ().release ()));
-}
-
-static std::vector<std::unique_ptr<AST::Expr>>
-try_expand_many_expr (Parser<MacroInvocLexer> &parser,
-		      const TokenId last_token_id, MacroExpander *expander,
-		      bool &has_error)
-{
-  auto restrictions = Rust::ParseRestrictions ();
-  // stop parsing when encountered a braces/brackets
-  restrictions.expr_can_be_null = true;
-  // we can't use std::optional, so...
-  auto result = std::vector<std::unique_ptr<AST::Expr>> ();
-  auto empty_expr = std::vector<std::unique_ptr<AST::Expr>> ();
-
-  auto first_token = parser.peek_current_token ()->get_id ();
-  if (first_token == COMMA)
-    {
-      rust_error_at (parser.peek_current_token ()->get_locus (),
-		     "expected expression, found %<,%>");
-      has_error = true;
-      return empty_expr;
-    }
-
-  while (parser.peek_current_token ()->get_id () != last_token_id
-	 && parser.peek_current_token ()->get_id () != END_OF_FILE)
-    {
-      auto expr = parser.parse_expr (AST::AttrVec (), restrictions);
-      // something must be so wrong that the expression could not be parsed
-      rust_assert (expr);
-      result.push_back (std::move (expr));
-
-      auto next_token = parser.peek_current_token ();
-      if (!parser.skip_token (COMMA) && next_token->get_id () != last_token_id)
-	{
-	  rust_error_at (next_token->get_locus (), "expected token: %<,%>");
-	  // TODO: is this recoverable? to avoid crashing the parser in the next
-	  // fragment we have to exit early here
-	  has_error = true;
-	  return empty_expr;
-	}
-    }
-
-  return result;
-}
-
-/* Parse a single string literal from the given delimited token tree,
-   and return the LiteralExpr for it. Allow for an optional trailing comma,
-   but otherwise enforce that these are the only tokens.  */
-
-// FIXME(Arthur): This function needs a rework - it should not emit errors, it
-// should probably be smaller
-std::unique_ptr<AST::Expr>
-parse_single_string_literal (BuiltinMacro kind,
-			     AST::DelimTokenTree &invoc_token_tree,
-			     location_t invoc_locus, MacroExpander *expander)
-{
-  MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
-  Parser<MacroInvocLexer> parser (lex);
-
-  auto last_token_id = macro_end_token (invoc_token_tree, parser);
-
-  std::unique_ptr<AST::LiteralExpr> lit_expr = nullptr;
-  std::unique_ptr<AST::MacroInvocation> macro_invoc = nullptr;
-
-  if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
-    {
-      lit_expr = parser.parse_literal_expr ();
-      parser.maybe_skip_token (COMMA);
-      if (parser.peek_current_token ()->get_id () != last_token_id)
-	{
-	  lit_expr = nullptr;
-	  rust_error_at (invoc_locus, "macro takes 1 argument");
-	}
-    }
-  else if (parser.peek_current_token ()->get_id () == last_token_id)
-    rust_error_at (invoc_locus, "macro takes 1 argument");
-  else
-    {
-      macro_invoc = parser.parse_macro_invocation (AST::AttrVec ());
-
-      parser.maybe_skip_token (COMMA);
-      if (parser.peek_current_token ()->get_id () != last_token_id)
-	{
-	  lit_expr = nullptr;
-	  rust_error_at (invoc_locus, "macro takes 1 argument");
-	}
-
-      if (macro_invoc != nullptr)
-	{
-	  auto path_str = make_macro_path_str (kind);
-
-	  auto pending_invocations
-	    = std::vector<std::unique_ptr<AST::MacroInvocation>> ();
-
-	  pending_invocations.push_back (std::move (macro_invoc));
-
-	  return AST::MacroInvocation::Builtin (
-	    kind,
-	    AST::MacroInvocData (AST::SimplePath ({AST::SimplePathSegment (
-				   path_str, invoc_locus)}),
-				 std::move (invoc_token_tree)),
-	    {}, invoc_locus, std::move (pending_invocations));
-	}
-      else
-	{
-	  rust_error_at (invoc_locus, "argument must be a string literal or a "
-				      "macro which expands to a string");
-	}
-    }
-
-  parser.skip_token (last_token_id);
-
-  return std::unique_ptr<AST::Expr> (std::move (lit_expr));
-}
-
-/* Treat PATH as a path relative to the source file currently being
-   compiled, and return the absolute path for it.  */
-
-std::string
-source_relative_path (std::string path, location_t locus)
-{
-  std::string compile_fname = LOCATION_FILE (locus);
-
-  auto dir_separator_pos = compile_fname.rfind (file_separator);
-
-  /* If there is no file_separator in the path, use current dir ('.').  */
-  std::string dirname;
-  if (dir_separator_pos == std::string::npos)
-    dirname = std::string (".") + file_separator;
-  else
-    dirname = compile_fname.substr (0, dir_separator_pos) + file_separator;
-
-  return dirname + path;
-}
-
-/* Read the full contents of the file FILENAME and return them in a vector.
-   FIXME: platform specific.  */
-
-tl::optional<std::vector<uint8_t>>
-load_file_bytes (location_t invoc_locus, const char *filename)
-{
-  RAIIFile file_wrap (filename);
-  if (file_wrap.get_raw () == nullptr)
-    {
-      rust_error_at (invoc_locus, "cannot open filename %s: %m", filename);
-      return tl::nullopt;
-    }
-
-  FILE *f = file_wrap.get_raw ();
-  fseek (f, 0L, SEEK_END);
-  long fsize = ftell (f);
-  fseek (f, 0L, SEEK_SET);
-
-  std::vector<uint8_t> buf (fsize);
-
-  if (fsize > 0 && fread (&buf[0], fsize, 1, f) != 1)
-    {
-      rust_error_at (invoc_locus, "error reading file %s: %m", filename);
-      return std::vector<uint8_t> ();
-    }
-
-  return buf;
-}
-} // namespace
-
-tl::optional<AST::Fragment>
-MacroBuiltin::assert_handler (location_t invoc_locus,
-			      AST::MacroInvocData &invoc)
-{
-  rust_debug ("assert!() called");
-
-  return AST::Fragment::create_error ();
-}
-
-tl::optional<AST::Fragment>
-MacroBuiltin::file_handler (location_t invoc_locus, AST::MacroInvocData &)
-{
-  auto current_file = LOCATION_FILE (invoc_locus);
-  auto file_str = AST::SingleASTNode (make_string (invoc_locus, current_file));
-  auto str_token
-    = make_token (Token::make_string (invoc_locus, std::move (current_file)));
-
-  return AST::Fragment ({file_str}, std::move (str_token));
-}
-
-tl::optional<AST::Fragment>
-MacroBuiltin::column_handler (location_t invoc_locus, AST::MacroInvocData &)
-{
-  auto current_column = LOCATION_COLUMN (invoc_locus);
-
-  auto column_tok = make_token (
-    Token::make_int (invoc_locus, std::to_string (current_column)));
-  auto column_no = AST::SingleASTNode (std::unique_ptr<AST::Expr> (
-    new AST::LiteralExpr (std::to_string (current_column), AST::Literal::INT,
-			  PrimitiveCoreType::CORETYPE_U32, {}, invoc_locus)));
-
-  return AST::Fragment ({column_no}, std::move (column_tok));
-}
-
-/* Expand builtin macro include_bytes!("filename"), which includes the contents
-   of the given file as reference to a byte array. Yields an expression of type
-   &'static [u8; N].  */
-
-tl::optional<AST::Fragment>
-MacroBuiltin::include_bytes_handler (location_t invoc_locus,
-				     AST::MacroInvocData &invoc)
-{
-  /* Get target filename from the macro invocation, which is treated as a path
-     relative to the include!-ing file (currently being compiled).  */
-  auto lit_expr
-    = parse_single_string_literal (BuiltinMacro::IncludeBytes,
-				   invoc.get_delim_tok_tree (), invoc_locus,
-				   invoc.get_expander ());
-  if (lit_expr == nullptr)
-    return AST::Fragment::create_error ();
-
-  rust_assert (lit_expr->is_literal ());
-
-  std::string target_filename
-    = source_relative_path (lit_expr->as_string (), invoc_locus);
-
-  auto maybe_bytes = load_file_bytes (invoc_locus, target_filename.c_str ());
-
-  if (!maybe_bytes.has_value ())
-    return AST::Fragment::create_error ();
-
-  std::vector<uint8_t> bytes = maybe_bytes.value ();
-
-  /* Is there a more efficient way to do this?  */
-  std::vector<std::unique_ptr<AST::Expr>> elts;
-
-  // We create the tokens for a borrow expression of a byte array, so
-  // & [ <byte0>, <byte1>, ... ]
-  std::vector<std::unique_ptr<AST::Token>> toks;
-  toks.emplace_back (make_token (Token::make (AMP, invoc_locus)));
-  toks.emplace_back (make_token (Token::make (LEFT_SQUARE, invoc_locus)));
-
-  for (uint8_t b : bytes)
-    {
-      elts.emplace_back (
-	new AST::LiteralExpr (std::string (1, (char) b), AST::Literal::BYTE,
-			      PrimitiveCoreType::CORETYPE_U8,
-			      {} /* outer_attrs */, invoc_locus));
-      toks.emplace_back (make_token (Token::make_byte_char (invoc_locus, b)));
-      toks.emplace_back (make_token (Token::make (COMMA, invoc_locus)));
-    }
-
-  toks.emplace_back (make_token (Token::make (RIGHT_SQUARE, invoc_locus)));
-
-  auto elems = std::unique_ptr<AST::ArrayElems> (
-    new AST::ArrayElemsValues (std::move (elts), invoc_locus));
-
-  auto array = std::unique_ptr<AST::Expr> (
-    new AST::ArrayExpr (std::move (elems), {}, {}, invoc_locus));
-
-  auto borrow = std::unique_ptr<AST::Expr> (
-    new AST::BorrowExpr (std::move (array), false, false, {}, invoc_locus));
-
-  auto node = AST::SingleASTNode (std::move (borrow));
-
-  return AST::Fragment ({node}, std::move (toks));
-} // namespace Rust
-
-/* Expand builtin macro include_str!("filename"), which includes the contents
-   of the given file as a string. The file must be UTF-8 encoded. Yields an
-   expression of type &'static str.  */
-
-tl::optional<AST::Fragment>
-MacroBuiltin::include_str_handler (location_t invoc_locus,
-				   AST::MacroInvocData &invoc)
-{
-  /* Get target filename from the macro invocation, which is treated as a path
-     relative to the include!-ing file (currently being compiled).  */
-  auto lit_expr
-    = parse_single_string_literal (BuiltinMacro::IncludeStr,
-				   invoc.get_delim_tok_tree (), invoc_locus,
-				   invoc.get_expander ());
-  if (lit_expr == nullptr)
-    return AST::Fragment::create_error ();
-
-  if (!lit_expr->is_literal ())
-    {
-      auto token_tree = invoc.get_delim_tok_tree ();
-      return AST::Fragment ({AST::SingleASTNode (std::move (lit_expr))},
-			    token_tree.to_token_stream ());
-    }
-
-  std::string target_filename
-    = source_relative_path (lit_expr->as_string (), invoc_locus);
-
-  auto maybe_bytes = load_file_bytes (invoc_locus, target_filename.c_str ());
-
-  if (!maybe_bytes.has_value ())
-    return AST::Fragment::create_error ();
-
-  std::vector<uint8_t> bytes = maybe_bytes.value ();
-
-  /* FIXME: reuse lexer */
-  int expect_single = 0;
-  for (uint8_t b : bytes)
-    {
-      if (expect_single)
-	{
-	  if ((b & 0xC0) != 0x80)
-	    /* character was truncated, exit with expect_single != 0 */
-	    break;
-	  expect_single--;
-	}
-      else if (b & 0x80)
-	{
-	  if (b >= 0xF8)
-	    {
-	      /* more than 4 leading 1s */
-	      expect_single = 1;
-	      break;
-	    }
-	  else if (b >= 0xF0)
-	    {
-	      /* 4 leading 1s */
-	      expect_single = 3;
-	    }
-	  else if (b >= 0xE0)
-	    {
-	      /* 3 leading 1s */
-	      expect_single = 2;
-	    }
-	  else if (b >= 0xC0)
-	    {
-	      /* 2 leading 1s */
-	      expect_single = 1;
-	    }
-	  else
-	    {
-	      /* only 1 leading 1 */
-	      expect_single = 1;
-	      break;
-	    }
-	}
-    }
-
-  std::string str;
-  if (expect_single)
-    rust_error_at (invoc_locus, "%s was not a valid utf-8 file",
-		   target_filename.c_str ());
-  else
-    str = std::string ((const char *) bytes.data (), bytes.size ());
-
-  auto node = AST::SingleASTNode (make_string (invoc_locus, str));
-  auto str_tok = make_token (Token::make_string (invoc_locus, std::move (str)));
-
-  return AST::Fragment ({node}, std::move (str_tok));
-}
-
-/* Expand builtin macro compile_error!("error"), which forces a compile error
-   during the compile time. */
-tl::optional<AST::Fragment>
-MacroBuiltin::compile_error_handler (location_t invoc_locus,
-				     AST::MacroInvocData &invoc)
-{
-  auto lit_expr
-    = parse_single_string_literal (BuiltinMacro::CompileError,
-				   invoc.get_delim_tok_tree (), invoc_locus,
-				   invoc.get_expander ());
-  if (lit_expr == nullptr)
-    return AST::Fragment::create_error ();
-
-  rust_assert (lit_expr->is_literal ());
-
-  std::string error_string = lit_expr->as_string ();
-  rust_error_at (invoc_locus, "%s", error_string.c_str ());
-
-  return AST::Fragment::create_error ();
-}
-
-/* Expand builtin macro concat!(), which joins all the literal parameters
-   into a string with no delimiter. */
-
-// This is a weird one. We want to do something where, if something cannot be
-// expanded yet (i.e. macro invocation?) we return the whole MacroInvocation
-// node again but expanded as much as possible.
-// Is that possible? How do we do that?
-//
-// Let's take a few examples:
-//
-// 1. concat!(1, 2, true);
-// 2. concat!(a!(), 2, true);
-// 3. concat!(concat!(1, false), 2, true);
-// 4. concat!(concat!(1, a!()), 2, true);
-//
-// 1. We simply want to return the new fragment: "12true"
-// 2. We want to return `concat!(a_expanded, 2, true)` as a fragment
-// 3. We want to return `concat!(1, false, 2, true)`
-// 4. We want to return `concat!(concat!(1, a_expanded), 2, true);
-//
-// How do we do that?
-//
-// For each (un)expanded fragment: we check if it is expanded fully
-//
-// 1. What is expanded fully?
-// 2. How to check?
-//
-// If it is expanded fully and not a literal, then we error out.
-// Otherwise we simply emplace it back and keep going.
-//
-// In the second case, we must mark that this concat invocation still has some
-// expansion to do: This allows us to return a `MacroInvocation { ... }` as an
-// AST fragment, instead of a completed string.
-//
-// This means that we must change all the `try_expand_many_*` APIs and so on to
-// return some sort of index or way to signify that we might want to reuse some
-// bits and pieces of the original token tree.
-//
-// Now, before that: How do we resolve the names used in a builtin macro
-// invocation?
-// Do we split the two passes of parsing the token tree and then expanding it?
-// Can we do that easily?
-tl::optional<AST::Fragment>
-MacroBuiltin::concat_handler (location_t invoc_locus,
-			      AST::MacroInvocData &invoc)
-{
-  auto invoc_token_tree = invoc.get_delim_tok_tree ();
-  MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
-  Parser<MacroInvocLexer> parser (lex);
-
-  auto str = std::string ();
-  bool has_error = false;
-
-  auto last_token_id = macro_end_token (invoc_token_tree, parser);
-
-  auto start = lex.get_offs ();
-  /* NOTE: concat! could accept no argument, so we don't have any checks here */
-  auto expanded_expr = try_expand_many_expr (parser, last_token_id,
-					     invoc.get_expander (), has_error);
-  auto end = lex.get_offs ();
-
-  auto tokens = lex.get_token_slice (start, end);
-
-  auto pending_invocations = check_for_eager_invocations (expanded_expr);
-  if (!pending_invocations.empty ())
-    return make_eager_builtin_invocation (BuiltinMacro::Concat, invoc_locus,
-					  invoc.get_delim_tok_tree (),
-					  std::move (pending_invocations));
-
-  for (auto &expr : expanded_expr)
-    {
-      if (!expr->is_literal ()
-	  && expr->get_ast_kind () != AST::Kind::MACRO_INVOCATION)
-	{
-	  has_error = true;
-	  rust_error_at (expr->get_locus (), "expected a literal");
-	  // diagnostics copied from rustc
-	  rust_inform (expr->get_locus (),
-		       "only literals (like %<\"foo\"%>, %<42%> and "
-		       "%<3.14%>) can be passed to %<concat!()%>");
-	  continue;
-	}
-      auto *literal = static_cast<AST::LiteralExpr *> (expr.get ());
-      if (literal->get_lit_type () == AST::Literal::BYTE
-	  || literal->get_lit_type () == AST::Literal::BYTE_STRING)
-	{
-	  has_error = true;
-	  rust_error_at (expr->get_locus (),
-			 "cannot concatenate a byte string literal");
-	  continue;
-	}
-      str += literal->as_string ();
-    }
-
-  parser.skip_token (last_token_id);
-
-  if (has_error)
-    return AST::Fragment::create_error ();
-
-  auto node = AST::SingleASTNode (make_string (invoc_locus, str));
-  auto str_tok = make_token (Token::make_string (invoc_locus, std::move (str)));
-
-  return AST::Fragment ({node}, std::move (str_tok));
-}
-
-/* Expand builtin macro env!(), which inspects an environment variable at
-   compile time. */
-tl::optional<AST::Fragment>
-MacroBuiltin::env_handler (location_t invoc_locus, AST::MacroInvocData &invoc)
-{
-  auto invoc_token_tree = invoc.get_delim_tok_tree ();
-  MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
-  Parser<MacroInvocLexer> parser (lex);
-
-  auto last_token_id = macro_end_token (invoc_token_tree, parser);
-  std::unique_ptr<AST::LiteralExpr> error_expr = nullptr;
-  std::unique_ptr<AST::LiteralExpr> lit_expr = nullptr;
-  bool has_error = false;
-
-  auto start = lex.get_offs ();
-  auto expanded_expr = try_expand_many_expr (parser, last_token_id,
-					     invoc.get_expander (), has_error);
-  auto end = lex.get_offs ();
-
-  auto tokens = lex.get_token_slice (start, end);
-
-  if (has_error)
-    return AST::Fragment::create_error ();
-
-  auto pending = check_for_eager_invocations (expanded_expr);
-  if (!pending.empty ())
-    return make_eager_builtin_invocation (BuiltinMacro::Env, invoc_locus,
-					  invoc_token_tree,
-					  std::move (pending));
-
-  if (expanded_expr.size () < 1 || expanded_expr.size () > 2)
-    {
-      rust_error_at (invoc_locus, "env! takes 1 or 2 arguments");
-      return AST::Fragment::create_error ();
-    }
-  if (expanded_expr.size () > 0)
-    {
-      if (!(lit_expr
-	    = try_extract_string_literal_from_fragment (invoc_locus,
-							expanded_expr[0])))
-	{
-	  return AST::Fragment::create_error ();
-	}
-    }
-  if (expanded_expr.size () > 1)
-    {
-      if (!(error_expr
-	    = try_extract_string_literal_from_fragment (invoc_locus,
-							expanded_expr[1])))
-	{
-	  return AST::Fragment::create_error ();
-	}
-    }
-
-  parser.skip_token (last_token_id);
-
-  auto env_value = getenv (lit_expr->as_string ().c_str ());
-
-  if (env_value == nullptr)
-    {
-      if (error_expr == nullptr)
-	rust_error_at (invoc_locus, "environment variable %qs not defined",
-		       lit_expr->as_string ().c_str ());
-      else
-	rust_error_at (invoc_locus, "%s", error_expr->as_string ().c_str ());
-      return AST::Fragment::create_error ();
-    }
-
-  auto node = AST::SingleASTNode (make_string (invoc_locus, env_value));
-  auto tok
-    = make_token (Token::make_string (invoc_locus, std::move (env_value)));
-
-  return AST::Fragment ({node}, std::move (tok));
-}
-
-tl::optional<AST::Fragment>
-MacroBuiltin::cfg_handler (location_t invoc_locus, AST::MacroInvocData &invoc)
-{
-  // only parse if not already parsed
-  if (!invoc.is_parsed ())
-    {
-      std::unique_ptr<AST::AttrInputMetaItemContainer> converted_input (
-	invoc.get_delim_tok_tree ().parse_to_meta_item ());
-
-      if (converted_input == nullptr)
-	{
-	  rust_debug ("DEBUG: failed to parse macro to meta item");
-	  // TODO: do something now? is this an actual error?
-	}
-      else
-	{
-	  std::vector<std::unique_ptr<AST::MetaItemInner>> meta_items (
-	    std::move (converted_input->get_items ()));
-	  invoc.set_meta_item_output (std::move (meta_items));
-	}
-    }
-
-  /* TODO: assuming that cfg! macros can only have one meta item inner, like cfg
-   * attributes */
-  if (invoc.get_meta_items ().size () != 1)
-    return AST::Fragment::create_error ();
-
-  bool result = invoc.get_meta_items ()[0]->check_cfg_predicate (
-    Session::get_instance ());
-  auto literal_exp = AST::SingleASTNode (std::unique_ptr<AST::Expr> (
-    new AST::LiteralExpr (result ? "true" : "false", AST::Literal::BOOL,
-			  PrimitiveCoreType::CORETYPE_BOOL, {}, invoc_locus)));
-  auto tok = make_token (
-    Token::make (result ? TRUE_LITERAL : FALSE_LITERAL, invoc_locus));
-
-  return AST::Fragment ({literal_exp}, std::move (tok));
-}
-
-/* Expand builtin macro include!(), which includes a source file at the current
- scope compile time. */
-
-tl::optional<AST::Fragment>
-MacroBuiltin::include_handler (location_t invoc_locus,
-			       AST::MacroInvocData &invoc)
-{
-  /* Get target filename from the macro invocation, which is treated as a path
-     relative to the include!-ing file (currently being compiled).  */
-  auto lit_expr
-    = parse_single_string_literal (BuiltinMacro::Include,
-				   invoc.get_delim_tok_tree (), invoc_locus,
-				   invoc.get_expander ());
-  if (lit_expr == nullptr)
-    return AST::Fragment::create_error ();
-
-  rust_assert (lit_expr->is_literal ());
-
-  std::string filename
-    = source_relative_path (lit_expr->as_string (), invoc_locus);
-  auto target_filename
-    = Rust::Session::get_instance ().include_extra_file (std::move (filename));
-
-  RAIIFile target_file (target_filename);
-  Linemap *linemap = Session::get_instance ().linemap;
-
-  if (!target_file.ok ())
-    {
-      rust_error_at (lit_expr->get_locus (),
-		     "cannot open included file %qs: %m", target_filename);
-      return AST::Fragment::create_error ();
-    }
-
-  rust_debug ("Attempting to parse included file %s", target_filename);
-
-  Lexer lex (target_filename, std::move (target_file), linemap);
-  Parser<Lexer> parser (lex);
-
-  auto parsed_items = parser.parse_items ();
-  bool has_error = !parser.get_errors ().empty ();
-
-  for (const auto &error : parser.get_errors ())
-    error.emit ();
-
-  if (has_error)
-    {
-      // inform the user that the errors above are from a included file
-      rust_inform (invoc_locus, "included from here");
-      return AST::Fragment::create_error ();
-    }
-
-  std::vector<AST::SingleASTNode> nodes{};
-  for (auto &item : parsed_items)
-    {
-      AST::SingleASTNode node (std::move (item));
-      nodes.push_back (node);
-    }
-
-  // FIXME: This returns an empty vector of tokens and works fine, but is that
-  // the expected behavior? `include` macros are a bit harder to reason about
-  // since they include tokens. Furthermore, our lexer has no easy way to return
-  // a slice of tokens like the MacroInvocLexer. So it gets even harder to
-  // extrac tokens from here. For now, let's keep it that way and see if it
-  // eventually breaks, but I don't expect it to cause many issues since the
-  // list of tokens is only used when a macro invocation mixes eager
-  // macro invocations and already expanded tokens. Think
-  // `concat!(a!(), 15, b!())`. We need to be able to expand a!(), expand b!(),
-  // and then insert the `15` token in between. In the case of `include!()`, we
-  // only have one argument. So it's either going to be a macro invocation or a
-  // string literal.
-  return AST::Fragment (nodes, std::vector<std::unique_ptr<AST::Token>> ());
-}
-
-tl::optional<AST::Fragment>
-MacroBuiltin::line_handler (location_t invoc_locus, AST::MacroInvocData &)
-{
-  auto current_line = LOCATION_LINE (invoc_locus);
-
-  auto line_no = AST::SingleASTNode (std::unique_ptr<AST::Expr> (
-    new AST::LiteralExpr (std::to_string (current_line), AST::Literal::INT,
-			  PrimitiveCoreType::CORETYPE_U32, {}, invoc_locus)));
-  auto tok
-    = make_token (Token::make_int (invoc_locus, std::to_string (current_line)));
-
-  return AST::Fragment ({line_no}, std::move (tok));
-}
-
-tl::optional<AST::Fragment>
-MacroBuiltin::stringify_handler (location_t invoc_locus,
-				 AST::MacroInvocData &invoc)
-{
-  std::string content;
-  auto invoc_token_tree = invoc.get_delim_tok_tree ();
-  auto tokens = invoc_token_tree.to_token_stream ();
-
-  // Tokens stream includes the first and last delimiter
-  // which we need to skip.
-  for (auto token = tokens.cbegin () + 1; token < tokens.cend () - 1; token++)
-    {
-      // Rust stringify format has no garantees but the reference compiler
-      // removes spaces before some tokens depending on the lexer's behavior,
-      // let's mimick some of those behaviors.
-      auto token_id = (*token)->get_id ();
-      if (token_id != RIGHT_PAREN && token_id != EXCLAM
-	  && token != tokens.cbegin () + 1)
-	{
-	  content.push_back (' ');
-	}
-      content += (*token)->as_string ();
-    }
-
-  auto node = AST::SingleASTNode (make_string (invoc_locus, content));
-  auto token
-    = make_token (Token::make_string (invoc_locus, std::move (content)));
-  return AST::Fragment ({node}, std::move (token));
-}
-
-struct FormatArgsInput
-{
-  std::string format_str;
-  AST::FormatArguments args;
-  // bool is_literal?
-};
-
-struct FormatArgsParseError
-{
-  enum class Kind
-  {
-    MissingArguments
-  } kind;
-};
-
-static tl::expected<FormatArgsInput, FormatArgsParseError>
-format_args_parse_arguments (AST::MacroInvocData &invoc)
-{
-  MacroInvocLexer lex (invoc.get_delim_tok_tree ().to_token_stream ());
-  Parser<MacroInvocLexer> parser (lex);
-
-  // TODO: check if EOF - return that format_args!() requires at least one
-  // argument
-
-  auto args = AST::FormatArguments ();
-  auto last_token_id = macro_end_token (invoc.get_delim_tok_tree (), parser);
-  std::unique_ptr<AST::Expr> format_expr = nullptr;
-
-  // TODO: Handle the case where we're not parsing a string literal (macro
-  // invocation for e.g.)
-  if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
-    format_expr = parser.parse_literal_expr ();
-
-  // TODO(Arthur): Clean this up - if we haven't parsed a string literal but a
-  // macro invocation, what do we do here? return a tl::unexpected?
-  auto format_str = static_cast<AST::LiteralExpr &> (*format_expr)
-		      .get_literal ()
-		      .as_string ();
-
-  // TODO: Allow implicit captures ONLY if the the first arg is a string literal
-  // and not a macro invocation
-
-  // TODO: How to consume all of the arguments until the delimiter?
-
-  // TODO: What we then want to do is as follows:
-  // for each token, check if it is an identifier
-  //     yes? is the next token an equal sign (=)
-  //          yes?
-  //              -> if that identifier is already present in our map, error
-  //              out
-  //              -> parse an expression, return a FormatArgument::Named
-  //     no?
-  //         -> if there have been named arguments before, error out
-  //         (positional after named error)
-  //         -> parse an expression, return a FormatArgument::Normal
-  while (parser.peek_current_token ()->get_id () != last_token_id)
-    {
-      parser.skip_token (COMMA);
-
-      if (parser.peek_current_token ()->get_id () == IDENTIFIER
-	  && parser.peek (1)->get_id () == EQUAL)
-	{
-	  // FIXME: This is ugly - just add a parser.parse_identifier()?
-	  auto ident_tok = parser.peek_current_token ();
-	  auto ident = Identifier (ident_tok);
-
-	  parser.skip_token (IDENTIFIER);
-	  parser.skip_token (EQUAL);
-
-	  auto expr = parser.parse_expr ();
-
-	  // TODO: Handle graciously
-	  if (!expr)
-	    rust_unreachable ();
-
-	  args.push (AST::FormatArgument::named (ident, std::move (expr)));
-	}
-      else
-	{
-	  auto expr = parser.parse_expr ();
-
-	  // TODO: Handle graciously
-	  if (!expr)
-	    rust_unreachable ();
-
-	  args.push (AST::FormatArgument::normal (std::move (expr)));
-	}
-      // we need to skip commas, don't we?
-    }
-
-  return FormatArgsInput{std::move (format_str), std::move (args)};
-}
-
-tl::optional<AST::Fragment>
-MacroBuiltin::format_args_handler (location_t invoc_locus,
-				   AST::MacroInvocData &invoc,
-				   AST::FormatArgs::Newline nl)
-{
-  auto input = format_args_parse_arguments (invoc);
-
-  if (!input)
-    {
-      rust_error_at (invoc_locus,
-		     "could not parse arguments to %<format_args!()%>");
-      return tl::nullopt;
-    }
-
-  // TODO(Arthur): We need to handle this
-  // // if it is not a literal, it's an eager macro invocation - return it
-  // if (!fmt_expr->is_literal ())
-  //   {
-  //     auto token_tree = invoc.get_delim_tok_tree ();
-  //     return AST::Fragment ({AST::SingleASTNode (std::move (fmt_expr))},
-  // 	    token_tree.to_token_stream ());
-  //   }
-
-  // TODO(Arthur): Handle this as well - raw strings are special for the
-  // format_args parser auto fmt_str = static_cast<AST::LiteralExpr &>
-  // (*fmt_arg.get ()); Switch on the format string to know if the string is raw
-  // or cooked switch (fmt_str.get_lit_type ())
-  //   {
-  //   // case AST::Literal::RAW_STRING:
-  //   case AST::Literal::STRING:
-  //     break;
-  //   case AST::Literal::CHAR:
-  //   case AST::Literal::BYTE:
-  //   case AST::Literal::BYTE_STRING:
-  //   case AST::Literal::INT:
-  //   case AST::Literal::FLOAT:
-  //   case AST::Literal::BOOL:
-  //   case AST::Literal::ERROR:
-  //     rust_unreachable ();
-  //   }
-
-  bool append_newline = nl == AST::FormatArgs::Newline::Yes;
-
-  auto fmt_str = std::move (input->format_str);
-  if (append_newline)
-    fmt_str += '\n';
-
-  auto pieces = Fmt::Pieces::collect (fmt_str, append_newline);
-
-  // TODO:
-  // do the transformation into an AST::FormatArgs node
-  // return that
-  // expand it during lowering
-
-  // TODO: we now need to take care of creating `unfinished_literal`? this is
-  // for creating the `template`
-
-  auto fmt_args_node = AST::FormatArgs (invoc_locus, std::move (pieces),
-					std::move (input->args));
-
-  auto expanded
-    = Fmt::expand_format_args (fmt_args_node,
-			       invoc.get_delim_tok_tree ().to_token_stream ());
-
-  if (!expanded.has_value ())
-    return AST::Fragment::create_error ();
-
-  return *expanded;
-
-  // auto node = std::unique_ptr<AST::Expr> (fmt_args_node);
-  // auto single_node = AST::SingleASTNode (std::move (node));
-
-  // return AST::Fragment ({std::move (single_node)},
-  // 	invoc.get_delim_tok_tree ().to_token_stream ());
-}
-
 tl::optional<AST::Fragment>
 MacroBuiltin::sorry (location_t invoc_locus, AST::MacroInvocData &invoc)
 {
diff --git a/gcc/rust/expand/rust-macro-builtins.h b/gcc/rust/expand/rust-macro-builtins.h
index 62961561716..ea1919ba619 100644
--- a/gcc/rust/expand/rust-macro-builtins.h
+++ b/gcc/rust/expand/rust-macro-builtins.h
@@ -31,9 +31,9 @@ namespace Rust {
 // transcriber and extra info if necessary
 // then make a global map<string, BuiltinMacro>
 
-/**
- * All builtin macros possible
- */
+//
+// All builtin macros possible
+//
 enum class BuiltinMacro
 {
   Assert,
@@ -79,42 +79,43 @@ enum class BuiltinMacro
 tl::optional<BuiltinMacro>
 builtin_macro_from_string (const std::string &identifier);
 
-/**
- * This class provides a list of builtin macros implemented by the compiler.
- * The functions defined are called "builtin transcribers" in that they replace
- * the transcribing part of a macro definition.
- *
- * Like regular macro transcribers, they are responsible for building and
- * returning an AST fragment: basically a vector of AST nodes put together.
- *
- * Unlike regular declarative macros where each match arm has its own associated
- * transcriber, builtin transcribers are responsible for handling all match arms
- * of the macro. This means that you should take extra care when implementing a
- * builtin containing multiple match arms: You will probably need to do some
- * lookahead in order to determine which match arm the user intended to use.
- *
- * An example of this is the `assert!()` macro:
- *
- * ```
- *  macro_rules! assert {
- *	($cond:expr $(,)?) => {{ ... }};
- *	($cond : expr, $ ($arg : tt) +) = > {{ ... }};
- * }
- * ```
- *
- * If more tokens exist beyond the optional comma, they need to be handled as
- * a token-tree for a custom panic message.
- *
- * These builtin macros with empty transcribers are defined in the standard
- * library. They are marked with a special attribute, `#[rustc_builtin_macro]`.
- * When this attribute is present on a macro definition, the compiler should
- * look for an associated transcriber in the mappings. Meaning that you must
- * remember to insert your transcriber in the `builtin_macros` map of the
- *`Mappings`.
- *
- * This map is built as a static variable in the `insert_macro_def()` method
- * of the `Mappings` class.
- */
+//
+//    This class provides a list of builtin macros implemented by the compiler.
+//    The functions defined are called "builtin transcribers" in that they
+//    replace the transcribing part of a macro definition.
+//
+//    Like regular macro transcribers, they are responsible for building and
+//    returning an AST fragment: basically a vector of AST nodes put together.
+//
+//    Unlike regular declarative macros where each match arm has its own
+//    associated transcriber, builtin transcribers are responsible for handling
+//    all match arms of the macro. This means that you should take extra care
+//    when implementing a builtin containing multiple match arms: You will
+//    probably need to do some lookahead in order to determine which match arm
+//    the user intended to use.
+//
+//    An example of this is the `assert!()` macro:
+//
+//    ```
+//    macro_rules! assert {
+//    ($cond:expr $(,)?) => {{ ... }};
+//    ($cond : expr, $ ($arg : tt) +) = > {{ ... }};
+//    }
+//    ```
+//
+//    If more tokens exist beyond the optional comma, they need to be handled as
+//    a token-tree for a custom panic message.
+//
+//    These builtin macros with empty transcribers are defined in the standard
+//    library. They are marked with a special attribute,
+//    `#[rustc_builtin_macro]`. When this attribute is present on a macro
+//    definition, the compiler should look for an associated transcriber in the
+//    mappings. Meaning that you must remember to insert your transcriber in the
+//    `builtin_macros` map of the `Mappings`.
+//
+//    This map is built as a static variable in the `insert_macro_def()` method
+//    of the `Mappings` class.
+
 class MacroBuiltin
 {
 public:
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 058/125] gccrs: Placate clang-format re 'gcc/rust/lex/rust-lex.cc'
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (55 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 057/125] gccrs: Split up rust-macro-builtins.cc Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 059/125] gccrs: nr2.0: Add new ImmutableNameResolutionCtx class Arthur Cohen
                   ` (66 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Thomas Schwinge

From: Thomas Schwinge <tschwinge@baylibre.com>

Reformat the upstream GCC commit 61644aea34c4623d16273ff705f8b8b1ff2d87f0
"gccrs: tokenize Unicode identifiers" change to 'gcc/rust/lex/rust-lex.cc'
to clang-format's liking.

	gcc/rust/
	* lex/rust-lex.cc (is_identifier_start): Placate clang-format.
---
 gcc/rust/lex/rust-lex.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc
index bf6bf4c8446..9c2203160cd 100644
--- a/gcc/rust/lex/rust-lex.cc
+++ b/gcc/rust/lex/rust-lex.cc
@@ -128,7 +128,8 @@ is_non_decimal_int_literal_separator (uint32_t character)
 bool
 is_identifier_start (uint32_t codepoint)
 {
-  return (cpp_check_xid_property (codepoint) & CPP_XID_START) || codepoint == '_';
+  return (cpp_check_xid_property (codepoint) & CPP_XID_START)
+	 || codepoint == '_';
 }
 
 bool
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 059/125] gccrs: nr2.0: Add new ImmutableNameResolutionCtx class.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (56 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 058/125] gccrs: Placate clang-format re 'gcc/rust/lex/rust-lex.cc' Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 060/125] gccrs: sesh: Add late name resolution 2.0 Arthur Cohen
                   ` (65 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* Make-lang.in: Compile it.
	* resolve/rust-immutable-name-resolution-context.cc: New file.
	* resolve/rust-immutable-name-resolution-context.h: New file.
---
 gcc/rust/Make-lang.in                         |  1 +
 .../rust-immutable-name-resolution-context.cc | 56 +++++++++++++++++++
 .../rust-immutable-name-resolution-context.h  | 55 ++++++++++++++++++
 3 files changed, 112 insertions(+)
 create mode 100644 gcc/rust/resolve/rust-immutable-name-resolution-context.cc
 create mode 100644 gcc/rust/resolve/rust-immutable-name-resolution-context.h

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 10af0814372..24229c02770 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -134,6 +134,7 @@ GRS_OBJS = \
     rust/rust-toplevel-name-resolver-2.0.o \
     rust/rust-early-name-resolver-2.0.o \
     rust/rust-late-name-resolver-2.0.o \
+	rust/rust-immutable-name-resolution-context.o \
     rust/rust-early-name-resolver.o \
     rust/rust-name-resolver.o \
     rust/rust-ast-resolve.o \
diff --git a/gcc/rust/resolve/rust-immutable-name-resolution-context.cc b/gcc/rust/resolve/rust-immutable-name-resolution-context.cc
new file mode 100644
index 00000000000..3894e27cd20
--- /dev/null
+++ b/gcc/rust/resolve/rust-immutable-name-resolution-context.cc
@@ -0,0 +1,56 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-immutable-name-resolution-context.h"
+
+namespace Rust {
+namespace Resolver2_0 {
+
+static ImmutableNameResolutionContext *instance = nullptr;
+
+const ImmutableNameResolutionContext &
+ImmutableNameResolutionContext::init (const NameResolutionContext &ctx)
+{
+  rust_assert (!instance);
+
+  instance = new ImmutableNameResolutionContext (ctx);
+
+  return *instance;
+}
+
+const ImmutableNameResolutionContext &
+ImmutableNameResolutionContext::get ()
+{
+  rust_assert (instance);
+
+  return *instance;
+}
+
+const NameResolutionContext &
+ImmutableNameResolutionContext::resolver () const
+{
+  return ctx;
+}
+
+ImmutableNameResolutionContext::ImmutableNameResolutionContext (
+  const NameResolutionContext &ctx)
+  : ctx (ctx)
+{}
+
+} // namespace Resolver2_0
+} // namespace Rust
diff --git a/gcc/rust/resolve/rust-immutable-name-resolution-context.h b/gcc/rust/resolve/rust-immutable-name-resolution-context.h
new file mode 100644
index 00000000000..9f9e7764cd2
--- /dev/null
+++ b/gcc/rust/resolve/rust-immutable-name-resolution-context.h
@@ -0,0 +1,55 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_IMMUTABLE_NRCTX_H
+#define RUST_IMMUTABLE_NRCTX_H
+
+#include "rust-name-resolution-context.h"
+
+namespace Rust {
+namespace Resolver2_0 {
+
+/**
+ * Once the name resolution pass is complete, the typechecker can access it
+ *
+ * FIXME: More documentation
+ */
+class ImmutableNameResolutionContext
+{
+public:
+  /** FIXME: Documentation */
+  static const ImmutableNameResolutionContext &
+  init (const NameResolutionContext &ctx);
+
+  /** FIXME: Documentation */
+  static const ImmutableNameResolutionContext &get ();
+
+  const NameResolutionContext &resolver () const;
+
+private:
+  ImmutableNameResolutionContext (const NameResolutionContext &ctx);
+  ImmutableNameResolutionContext (const ImmutableNameResolutionContext &other)
+    = default;
+
+  const NameResolutionContext &ctx;
+};
+
+} // namespace Resolver2_0
+} // namespace Rust
+
+#endif //! RUST_IMMUTABLE_NRCTX_H
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 060/125] gccrs: sesh: Add late name resolution 2.0
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (57 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 059/125] gccrs: nr2.0: Add new ImmutableNameResolutionCtx class Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 061/125] gccrs: session-manager: Dump name resolution pass Arthur Cohen
                   ` (64 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* rust-session-manager.cc (Session::compile_crate): Create name resolution
	context for Session::expansion and subsequent name resolution passes.
	(Session::expansion): Take name resolution context as a parameter
	instead.
	* rust-session-manager.h (Session::expansion): Fix declaration.
---
 gcc/rust/rust-session-manager.cc | 14 +++++++++-----
 gcc/rust/rust-session-manager.h  |  3 ++-
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index ea99d019f64..40adeb20de4 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -42,6 +42,7 @@
 #include "rust-early-name-resolver.h"
 #include "rust-name-resolution-context.h"
 #include "rust-early-name-resolver-2.0.h"
+#include "rust-late-name-resolver-2.0.h"
 #include "rust-cfg-strip.h"
 #include "rust-expand-visitor.h"
 #include "rust-unicode.h"
@@ -591,8 +592,10 @@ Session::compile_crate (const char *filename)
   if (last_step == CompileOptions::CompileStep::Expansion)
     return;
 
+  auto name_resolution_ctx = Resolver2_0::NameResolutionContext ();
   // expansion pipeline stage
-  expansion (parsed_crate);
+
+  expansion (parsed_crate, name_resolution_ctx);
   rust_debug ("\033[0;31mSUCCESSFULLY FINISHED EXPANSION \033[0m");
   if (options.dump_option_enabled (CompileOptions::EXPANSION_DUMP))
     {
@@ -617,7 +620,10 @@ Session::compile_crate (const char *filename)
     return;
 
   // resolution pipeline stage
-  Resolver::NameResolution::Resolve (parsed_crate);
+  if (flag_name_resolution_2_0)
+    Resolver2_0::Late (name_resolution_ctx).go (parsed_crate);
+  else
+    Resolver::NameResolution::Resolve (parsed_crate);
 
   if (options.dump_option_enabled (CompileOptions::RESOLUTION_DUMP))
     {
@@ -881,7 +887,7 @@ Session::injection (AST::Crate &crate)
 }
 
 void
-Session::expansion (AST::Crate &crate)
+Session::expansion (AST::Crate &crate, Resolver2_0::NameResolutionContext &ctx)
 {
   rust_debug ("started expansion");
 
@@ -908,8 +914,6 @@ Session::expansion (AST::Crate &crate)
       if (saw_errors ())
 	break;
 
-      auto ctx = Resolver2_0::NameResolutionContext ();
-
       if (flag_name_resolution_2_0)
 	{
 	  Resolver2_0::Early early (ctx);
diff --git a/gcc/rust/rust-session-manager.h b/gcc/rust/rust-session-manager.h
index 41aad607905..9a5691f45ee 100644
--- a/gcc/rust/rust-session-manager.h
+++ b/gcc/rust/rust-session-manager.h
@@ -24,6 +24,7 @@
 #include "rust-backend.h"
 #include "rust-hir-map.h"
 #include "safe-ctype.h"
+#include "rust-name-resolution-context.h"
 
 #include "config.h"
 #include "rust-system.h"
@@ -413,7 +414,7 @@ private:
   /* Expansion pipeline stage. TODO maybe move to another object? Expands all
    * macros, maybe build test harness in future, AST validation, maybe create
    * macro crate (if not rustdoc).*/
-  void expansion (AST::Crate &crate);
+  void expansion (AST::Crate &crate, Resolver2_0::NameResolutionContext &ctx);
 
   // handle cfg_option
   bool handle_cfg_option (std::string &data);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 061/125] gccrs: session-manager: Dump name resolution pass.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (58 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 060/125] gccrs: sesh: Add late name resolution 2.0 Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 062/125] gccrs: session manager: Init Immutable name resolver Arthur Cohen
                   ` (63 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* rust-session-manager.cc: Add files for dumping name resolution, call
	name resolution dump function.
	(Session::dump_name_resolution): New.
	* rust-session-manager.h: New declaration.
---
 gcc/rust/rust-session-manager.cc | 30 +++++++++++++++++++++++++++---
 gcc/rust/rust-session-manager.h  |  1 +
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 40adeb20de4..64e0190f716 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -69,6 +69,10 @@ const char *kASTDumpFile = "gccrs.ast.dump";
 const char *kASTPrettyDumpFile = "gccrs.ast-pretty.dump";
 const char *kASTPrettyDumpFileExpanded = "gccrs.ast-pretty-expanded.dump";
 const char *kASTExpandedDumpFile = "gccrs.ast-expanded.dump";
+const char *kASTmacroResolutionDumpFile = "gccrs.ast-macro-resolution.dump";
+const char *kASTlabelResolutionDumpFile = "gccrs.ast-label-resolution.dump";
+const char *kASTtypeResolutionDumpFile = "gccrs.ast-type-resolution.dump";
+const char *kASTvalueResolutionDumpFile = "gccrs.ast-value-resolution.dump";
 const char *kHIRDumpFile = "gccrs.hir.dump";
 const char *kHIRPrettyDumpFile = "gccrs.hir-pretty.dump";
 const char *kHIRTypeResolutionDumpFile = "gccrs.type-resolution.dump";
@@ -86,6 +90,7 @@ Session::get_instance ()
 
 static std::string
 infer_crate_name (const std::string &filename)
+
 {
   if (filename == "-")
     return kDefaultCrateName;
@@ -626,9 +631,7 @@ Session::compile_crate (const char *filename)
     Resolver::NameResolution::Resolve (parsed_crate);
 
   if (options.dump_option_enabled (CompileOptions::RESOLUTION_DUMP))
-    {
-      // TODO: what do I dump here? resolved names? AST with resolved names?
-    }
+    dump_name_resolution (name_resolution_ctx);
 
   if (saw_errors ())
     return;
@@ -982,6 +985,27 @@ Session::dump_ast_pretty (AST::Crate &crate, bool expanded) const
   out.close ();
 }
 
+void
+Session::dump_name_resolution (Resolver2_0::NameResolutionContext &ctx) const
+{
+  // YES this is ugly but NO GCC 4.8 does not allow us to make it fancier :(
+  std::string types_content = ctx.types.as_debug_string ();
+  std::ofstream types_stream{kASTtypeResolutionDumpFile};
+  types_stream << types_content;
+
+  std::string macros_content = ctx.macros.as_debug_string ();
+  std::ofstream macros_stream{kASTmacroResolutionDumpFile};
+  macros_stream << macros_content;
+
+  std::string labels_content = ctx.labels.as_debug_string ();
+  std::ofstream labels_stream{kASTlabelResolutionDumpFile};
+  labels_stream << labels_content;
+
+  std::string values_content = ctx.values.as_debug_string ();
+  std::ofstream values_stream{kASTvalueResolutionDumpFile};
+  values_stream << values_content;
+}
+
 void
 Session::dump_hir (HIR::Crate &crate) const
 {
diff --git a/gcc/rust/rust-session-manager.h b/gcc/rust/rust-session-manager.h
index 9a5691f45ee..845b53ab6db 100644
--- a/gcc/rust/rust-session-manager.h
+++ b/gcc/rust/rust-session-manager.h
@@ -396,6 +396,7 @@ private:
 
   void dump_lex (Parser<Lexer> &parser) const;
   void dump_ast_pretty (AST::Crate &crate, bool expanded = false) const;
+  void dump_name_resolution (Resolver2_0::NameResolutionContext &ctx) const;
   void dump_hir (HIR::Crate &crate) const;
   void dump_hir_pretty (HIR::Crate &crate) const;
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 062/125] gccrs: session manager: Init Immutable name resolver.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (59 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 061/125] gccrs: session-manager: Dump name resolution pass Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:56 ` [PATCH 063/125] gccrs: nr2.0: Add lookup of resolved nodes Arthur Cohen
                   ` (62 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* rust-session-manager.cc (Session::compile_crate): Create an immutable
	view of the name resolution context.
---
 gcc/rust/rust-session-manager.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 64e0190f716..1c7e2766d71 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -18,6 +18,7 @@
 
 #include "rust-session-manager.h"
 #include "rust-diagnostics.h"
+#include "rust-immutable-name-resolution-context.h"
 #include "rust-unsafe-checker.h"
 #include "rust-lex.h"
 #include "rust-parse.h"
@@ -659,6 +660,9 @@ Session::compile_crate (const char *filename)
   if (last_step == CompileOptions::CompileStep::TypeCheck)
     return;
 
+  // name resolution is done, we now freeze the name resolver for type checking
+  Resolver2_0::ImmutableNameResolutionContext::init (name_resolution_ctx);
+
   // type resolve
   Resolver::TypeResolution::Resolve (hir);
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 063/125] gccrs: nr2.0: Add lookup of resolved nodes.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (60 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 062/125] gccrs: session manager: Init Immutable name resolver Arthur Cohen
@ 2024-08-01 14:56 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 064/125] gccrs: typecheck: Start using nr2.0 properly Arthur Cohen
                   ` (61 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* resolve/rust-name-resolution-context.cc (NameResolutionContext::lookup):
	Add lookup function.
	* resolve/rust-name-resolution-context.h: Include mappings and optional.
---
 gcc/rust/resolve/rust-name-resolution-context.cc | 13 +++++++++++++
 gcc/rust/resolve/rust-name-resolution-context.h  |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/gcc/rust/resolve/rust-name-resolution-context.cc b/gcc/rust/resolve/rust-name-resolution-context.cc
index f35db7e925e..9fd8d52968a 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.cc
+++ b/gcc/rust/resolve/rust-name-resolution-context.cc
@@ -17,6 +17,8 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-name-resolution-context.h"
+#include "optional.h"
+#include "rust-mapping-common.h"
 
 namespace Rust {
 namespace Resolver2_0 {
@@ -52,6 +54,17 @@ NameResolutionContext::map_usage (NodeId usage, NodeId definition)
   rust_assert (inserted);
 }
 
+tl::optional<NodeId>
+NameResolutionContext::lookup (NodeId usage)
+{
+  auto it = resolved_nodes.find (usage);
+
+  if (it == resolved_nodes.end ())
+    return tl::nullopt;
+
+  return it->second;
+}
+
 void
 NameResolutionContext::scoped (Rib rib, NodeId id,
 			       std::function<void (void)> lambda,
diff --git a/gcc/rust/resolve/rust-name-resolution-context.h b/gcc/rust/resolve/rust-name-resolution-context.h
index bc3c4bb5ddb..e896ca05360 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.h
+++ b/gcc/rust/resolve/rust-name-resolution-context.h
@@ -19,6 +19,7 @@
 #ifndef RUST_NAME_RESOLVER_2_0_H
 #define RUST_NAME_RESOLVER_2_0_H
 
+#include "optional.h"
 #include "rust-forever-stack.h"
 #include "rust-hir-map.h"
 
@@ -180,7 +181,9 @@ public:
   Analysis::Mappings &mappings;
 
   // TODO: Rename
+  // TODO: Use newtype pattern for Usage and Definition
   void map_usage (NodeId usage, NodeId definition);
+  tl::optional<NodeId> lookup (NodeId usage);
 
 private:
   /* Map of "usage" nodes which have been resolved to a "definition" node */
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 064/125] gccrs: typecheck: Start using nr2.0 properly
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (61 preceding siblings ...)
  2024-08-01 14:56 ` [PATCH 063/125] gccrs: nr2.0: Add lookup of resolved nodes Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 065/125] gccrs: backend: Use new name resolver where necessary Arthur Cohen
                   ` (60 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

Fetch the ImmutableNrCtx in order to access name resolver during
typechecking.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Start
	fetching name resolution information in the typechecker.
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
	Likewise.
	* typecheck/rust-hir-type-check-path.cc: Use nr 2.0.
---
 .../typecheck/rust-hir-type-check-item.cc     | 91 +++++++++++++++----
 .../typecheck/rust-hir-type-check-path.cc     | 16 +++-
 .../typecheck/rust-hir-type-check-type.cc     | 24 ++++-
 3 files changed, 105 insertions(+), 26 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.cc b/gcc/rust/typecheck/rust-hir-type-check-item.cc
index 4bbd28021a0..4ab946e1c2a 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-item.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-item.cc
@@ -17,12 +17,17 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-hir-type-check-item.h"
+#include "rust-canonical-path.h"
+#include "rust-diagnostics.h"
 #include "rust-hir-type-check-enumitem.h"
 #include "rust-hir-type-check-implitem.h"
 #include "rust-hir-type-check-type.h"
 #include "rust-hir-type-check-expr.h"
 #include "rust-hir-type-check-pattern.h"
 #include "rust-hir-trait-resolve.h"
+#include "rust-identifier.h"
+#include "rust-session-manager.h"
+#include "rust-immutable-name-resolution-context.h"
 #include "rust-substitution-mapper.h"
 #include "rust-type-util.h"
 #include "rust-tyty-variance-analysis.h"
@@ -185,11 +190,30 @@ TypeCheckItem::visit (HIR::TupleStruct &struct_decl)
     }
 
   // get the path
-  const CanonicalPath *canonical_path = nullptr;
-  bool ok = mappings->lookup_canonical_path (
-    struct_decl.get_mappings ().get_nodeid (), &canonical_path);
-  rust_assert (ok);
-  RustIdent ident{*canonical_path, struct_decl.get_locus ()};
+
+  auto path = CanonicalPath::create_empty ();
+
+  // FIXME: HACK: ARTHUR: Disgusting
+  if (flag_name_resolution_2_0)
+    {
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+      auto canonical_path = nr_ctx.values.to_canonical_path (
+	struct_decl.get_mappings ().get_nodeid ());
+
+      path = canonical_path.value ();
+    }
+  else
+    {
+      const CanonicalPath *canonical_path = nullptr;
+      bool ok = mappings->lookup_canonical_path (
+	struct_decl.get_mappings ().get_nodeid (), &canonical_path);
+      rust_assert (ok);
+
+      path = *canonical_path;
+    }
+
+  RustIdent ident{path, struct_decl.get_locus ()};
 
   // its a single variant ADT
   std::vector<TyTy::VariantDef *> variants;
@@ -248,12 +272,29 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
       context->insert_type (field.get_mappings (), ty_field->get_field_type ());
     }
 
-  // get the path
-  const CanonicalPath *canonical_path = nullptr;
-  bool ok = mappings->lookup_canonical_path (
-    struct_decl.get_mappings ().get_nodeid (), &canonical_path);
-  rust_assert (ok);
-  RustIdent ident{*canonical_path, struct_decl.get_locus ()};
+  auto path = CanonicalPath::create_empty ();
+
+  // FIXME: HACK: ARTHUR: Disgusting
+  if (flag_name_resolution_2_0)
+    {
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+      auto canonical_path = nr_ctx.values.to_canonical_path (
+	struct_decl.get_mappings ().get_nodeid ());
+
+      path = canonical_path.value ();
+    }
+  else
+    {
+      const CanonicalPath *canonical_path = nullptr;
+      bool ok = mappings->lookup_canonical_path (
+	struct_decl.get_mappings ().get_nodeid (), &canonical_path);
+      rust_assert (ok);
+
+      path = *canonical_path;
+    }
+
+  RustIdent ident{path, struct_decl.get_locus ()};
 
   // its a single variant ADT
   std::vector<TyTy::VariantDef *> variants;
@@ -510,13 +551,29 @@ TypeCheckItem::visit (HIR::Function &function)
       TypeCheckPattern::Resolve (param.get_param_name ().get (), param_tyty);
     }
 
-  const CanonicalPath *canonical_path = nullptr;
-  bool ok
-    = mappings->lookup_canonical_path (function.get_mappings ().get_nodeid (),
-				       &canonical_path);
-  rust_assert (ok);
+  auto path = CanonicalPath::create_empty ();
+
+  // FIXME: HACK: ARTHUR: Disgusting
+  if (flag_name_resolution_2_0)
+    {
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+      auto canonical_path = nr_ctx.values.to_canonical_path (
+	function.get_mappings ().get_nodeid ());
+
+      path = canonical_path.value ();
+    }
+  else
+    {
+      const CanonicalPath *canonical_path = nullptr;
+      bool ok = mappings->lookup_canonical_path (
+	function.get_mappings ().get_nodeid (), &canonical_path);
+      rust_assert (ok);
+
+      path = *canonical_path;
+    }
 
-  RustIdent ident{*canonical_path, function.get_locus ()};
+  RustIdent ident{path, function.get_locus ()};
 
   auto fn_type = new TyTy::FnType (
     function.get_mappings ().get_hirid (),
diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc
index ad31fb74a80..cdb506dacbe 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-path.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc
@@ -24,6 +24,8 @@
 #include "rust-hir-path-probe.h"
 #include "rust-type-util.h"
 #include "rust-hir-type-bounds.h"
+#include "rust-session-manager.h"
+#include "rust-immutable-name-resolution-context.h"
 
 namespace Rust {
 namespace Resolver {
@@ -197,12 +199,18 @@ TypeCheckExpr::resolve_root_path (HIR::PathInExpression &expr, size_t *offset,
       bool is_root = *offset == 0;
       NodeId ast_node_id = seg.get_mappings ().get_nodeid ();
 
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
       // then lookup the reference_node_id
       NodeId ref_node_id = UNKNOWN_NODEID;
-      if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
-	{
-	  resolver->lookup_resolved_type (ast_node_id, &ref_node_id);
-	}
+
+      if (flag_name_resolution_2_0)
+	// assign the ref_node_id if we've found something
+	nr_ctx.lookup (expr.get_mappings ().get_nodeid ())
+	  .map ([&ref_node_id] (NodeId resolved) { ref_node_id = resolved; });
+      else if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
+	resolver->lookup_resolved_type (ast_node_id, &ref_node_id);
 
       // ref_node_id is the NodeId that the segments refers to.
       if (ref_node_id == UNKNOWN_NODEID)
diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc
index a132b386a96..588e5bce88e 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-type.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc
@@ -17,10 +17,13 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-hir-type-check-type.h"
+#include "options.h"
 #include "rust-hir-trait-resolve.h"
 #include "rust-hir-type-check-expr.h"
 #include "rust-hir-path-probe.h"
 #include "rust-hir-type-bounds.h"
+#include "rust-immutable-name-resolution-context.h"
+#include "rust-mapping-common.h"
 #include "rust-substitution-mapper.h"
 #include "rust-type-util.h"
 
@@ -129,6 +132,8 @@ TypeCheckType::visit (HIR::TupleType &tuple)
 void
 TypeCheckType::visit (HIR::TypePath &path)
 {
+  rust_debug ("{ARTHUR}: Path visited: %s", path.as_string ().c_str ());
+
   // this can happen so we need to look up the root then resolve the
   // remaining segments if possible
   size_t offset = 0;
@@ -336,12 +341,21 @@ TypeCheckType::resolve_root_path (HIR::TypePath &path, size_t *offset,
       bool is_root = *offset == 0;
       NodeId ast_node_id = seg->get_mappings ().get_nodeid ();
 
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
       // then lookup the reference_node_id
       NodeId ref_node_id = UNKNOWN_NODEID;
-      if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
-	{
-	  resolver->lookup_resolved_type (ast_node_id, &ref_node_id);
-	}
+
+      // FIXME: HACK: ARTHUR: Remove this
+      if (flag_name_resolution_2_0)
+	// assign the ref_node_id if we've found something
+	nr_ctx.lookup (path.get_mappings ().get_nodeid ())
+	  .map ([&ref_node_id, &path] (NodeId resolved) {
+	    ref_node_id = resolved;
+	  });
+      else if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
+	resolver->lookup_resolved_type (ast_node_id, &ref_node_id);
 
       // ref_node_id is the NodeId that the segments refers to.
       if (ref_node_id == UNKNOWN_NODEID)
@@ -349,7 +363,7 @@ TypeCheckType::resolve_root_path (HIR::TypePath &path, size_t *offset,
 	  if (is_root)
 	    {
 	      rust_error_at (seg->get_locus (),
-			     "unknown reference for resolved name: %<%s%>",
+			     "unknown reference for resolved name: %qs",
 			     seg->get_ident_segment ().as_string ().c_str ());
 	      return new TyTy::ErrorType (path.get_mappings ().get_hirid ());
 	    }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 065/125] gccrs: backend: Use new name resolver where necessary
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (62 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 064/125] gccrs: typecheck: Start using nr2.0 properly Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 066/125] gccrs: nr2.0: Start using newtype pattern for Usage and Declaration Arthur Cohen
                   ` (59 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc: Use new ImmutableNrCtx.
	* backend/rust-compile-context.h: Likewise.
	* backend/rust-compile-expr.cc: Likewise.
	* backend/rust-compile-item.cc: Likewise.
---
 gcc/rust/backend/rust-compile-base.cc   |  1 +
 gcc/rust/backend/rust-compile-context.h |  1 +
 gcc/rust/backend/rust-compile-expr.cc   | 22 ++++++++++++++----
 gcc/rust/backend/rust-compile-item.cc   | 31 ++++++++++++++++++++-----
 4 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index 4d6f0275b00..584d6a03ea9 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -31,6 +31,7 @@
 #include "rust-type-util.h"
 #include "rust-compile-implitem.h"
 #include "rust-attribute-values.h"
+#include "rust-immutable-name-resolution-context.h"
 
 #include "fold-const.h"
 #include "stringpool.h"
diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h
index 36a36e79f68..671aee196c2 100644
--- a/gcc/rust/backend/rust-compile-context.h
+++ b/gcc/rust/backend/rust-compile-context.h
@@ -27,6 +27,7 @@
 #include "rust-hir-full.h"
 #include "rust-mangle.h"
 #include "rust-tree.h"
+#include "rust-immutable-name-resolution-context.h"
 
 namespace Rust {
 namespace Compile {
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 65de24bf9d8..6a9bb73ffe0 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -2311,11 +2311,23 @@ CompileExpr::generate_closure_function (HIR::ClosureExpr &expr,
   if (is_block_expr)
     {
       auto body_mappings = function_body->get_mappings ();
-      Resolver::Rib *rib = nullptr;
-      bool ok
-	= ctx->get_resolver ()->find_name_rib (body_mappings.get_nodeid (),
-					       &rib);
-      rust_assert (ok);
+      if (flag_name_resolution_2_0)
+	{
+	  auto nr_ctx
+	    = Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+	  auto candidate = nr_ctx.values.to_rib (body_mappings.get_nodeid ());
+
+	  rust_assert (candidate.has_value ());
+	}
+      else
+	{
+	  Resolver::Rib *rib = nullptr;
+	  bool ok
+	    = ctx->get_resolver ()->find_name_rib (body_mappings.get_nodeid (),
+						   &rib);
+	  rust_assert (ok);
+	}
     }
 
   tree enclosing_scope = NULL_TREE;
diff --git a/gcc/rust/backend/rust-compile-item.cc b/gcc/rust/backend/rust-compile-item.cc
index 234ad2aa59c..8feed51efa4 100644
--- a/gcc/rust/backend/rust-compile-item.cc
+++ b/gcc/rust/backend/rust-compile-item.cc
@@ -19,6 +19,7 @@
 #include "rust-compile-item.h"
 #include "rust-compile-implitem.h"
 #include "rust-compile-extern.h"
+#include "rust-immutable-name-resolution-context.h"
 
 namespace Rust {
 namespace Compile {
@@ -149,12 +150,30 @@ CompileItem::visit (HIR::Function &function)
 	}
     }
 
-  const Resolver::CanonicalPath *canonical_path = nullptr;
-  bool ok = ctx->get_mappings ()->lookup_canonical_path (
-    function.get_mappings ().get_nodeid (), &canonical_path);
-  rust_assert (ok);
+  Resolver::CanonicalPath canonical_path
+    = Resolver::CanonicalPath::create_empty ();
+
+  if (flag_name_resolution_2_0)
+    {
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+      auto path = nr_ctx.values.to_canonical_path (
+	function.get_mappings ().get_nodeid ());
+
+      canonical_path = path.value ();
+    }
+  else
+    {
+      const Resolver::CanonicalPath *path = nullptr;
+      bool ok = ctx->get_mappings ()->lookup_canonical_path (
+	function.get_mappings ().get_nodeid (), &path);
+      rust_assert (ok);
+
+      canonical_path = *path;
+    }
 
-  const std::string asm_name = ctx->mangle_item (fntype, *canonical_path);
+  const std::string asm_name = ctx->mangle_item (fntype, canonical_path);
 
   // items can be forward compiled which means we may not need to invoke this
   // code. We might also have already compiled this generic function as well.
@@ -181,7 +200,7 @@ CompileItem::visit (HIR::Function &function)
 			function.get_function_params (),
 			function.get_qualifiers (), function.get_visibility (),
 			function.get_outer_attrs (), function.get_locus (),
-			function.get_definition ().get (), canonical_path,
+			function.get_definition ().get (), &canonical_path,
 			fntype);
   reference = address_expression (fndecl, ref_locus);
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 066/125] gccrs: nr2.0: Start using newtype pattern for Usage and Declaration
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (63 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 065/125] gccrs: backend: Use new name resolver where necessary Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 067/125] gccrs: late: Setup builtin types properly, change Rib API Arthur Cohen
                   ` (58 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* resolve/rust-name-resolution-context.cc (NameResolutionContext::map_usage):
	Use newtype pattern.
	(NameResolutionContext::lookup): Likewise.
	* resolve/rust-name-resolution-context.h (class Usage): New class.
	(class Definition): Likewise.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Create instances
	of Usage and Definition.
---
 .../resolve/rust-late-name-resolver-2.0.cc    |  4 +--
 .../resolve/rust-name-resolution-context.cc   |  6 ++---
 .../resolve/rust-name-resolution-context.h    | 27 +++++++++++++++++--
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index e5a4f234871..50034073edf 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -142,7 +142,7 @@ Late::visit (AST::IdentifierExpr &expr)
       return;
     }
 
-  ctx.map_usage (expr.get_node_id (), *resolved);
+  ctx.map_usage (Usage (expr.get_node_id ()), Definition (*resolved));
 
   // in the old resolver, resolutions are kept in the resolver, not the mappings
   // :/ how do we deal with that?
@@ -173,7 +173,7 @@ Late::visit (AST::TypePath &type)
 
   auto resolved = ctx.types.get (type.get_segments ().back ()->as_string ());
 
-  ctx.map_usage (type.get_node_id (), *resolved);
+  ctx.map_usage (Usage (type.get_node_id ()), Definition (*resolved));
 }
 
 } // namespace Resolver2_0
diff --git a/gcc/rust/resolve/rust-name-resolution-context.cc b/gcc/rust/resolve/rust-name-resolution-context.cc
index 9fd8d52968a..0340d28f127 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.cc
+++ b/gcc/rust/resolve/rust-name-resolution-context.cc
@@ -46,7 +46,7 @@ NameResolutionContext::insert (Identifier name, NodeId id, Namespace ns)
 }
 
 void
-NameResolutionContext::map_usage (NodeId usage, NodeId definition)
+NameResolutionContext::map_usage (Usage usage, Definition definition)
 {
   auto inserted = resolved_nodes.emplace (usage, definition).second;
 
@@ -57,12 +57,12 @@ NameResolutionContext::map_usage (NodeId usage, NodeId definition)
 tl::optional<NodeId>
 NameResolutionContext::lookup (NodeId usage)
 {
-  auto it = resolved_nodes.find (usage);
+  auto it = resolved_nodes.find (Usage (usage));
 
   if (it == resolved_nodes.end ())
     return tl::nullopt;
 
-  return it->second;
+  return it->second.id;
 }
 
 void
diff --git a/gcc/rust/resolve/rust-name-resolution-context.h b/gcc/rust/resolve/rust-name-resolution-context.h
index e896ca05360..8702900d0f3 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.h
+++ b/gcc/rust/resolve/rust-name-resolution-context.h
@@ -133,6 +133,28 @@ change?
 correct
 */
 
+// FIXME: Documentation
+class Usage
+{
+public:
+  explicit Usage (NodeId id) : id (id) {}
+
+  // TODO: move to name-resolution-ctx.cc
+  // storing it as a key in a map
+  bool operator< (const Usage other) const { return other.id < id; }
+
+  NodeId id;
+};
+
+// FIXME: Documentation
+class Definition
+{
+public:
+  explicit Definition (NodeId id) : id (id) {}
+
+  NodeId id;
+};
+
 // Now our resolver, which keeps track of all the `ForeverStack`s we could want
 class NameResolutionContext
 {
@@ -182,12 +204,13 @@ public:
 
   // TODO: Rename
   // TODO: Use newtype pattern for Usage and Definition
-  void map_usage (NodeId usage, NodeId definition);
+  void map_usage (Usage usage, Definition definition);
+
   tl::optional<NodeId> lookup (NodeId usage);
 
 private:
   /* Map of "usage" nodes which have been resolved to a "definition" node */
-  std::map<NodeId, NodeId> resolved_nodes;
+  std::map<Usage, Definition> resolved_nodes;
 };
 
 } // namespace Resolver2_0
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 067/125] gccrs: late: Setup builtin types properly, change Rib API
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (64 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 066/125] gccrs: nr2.0: Start using newtype pattern for Usage and Declaration Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 068/125] gccrs: Fix duplicate detection Arthur Cohen
                   ` (57 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.hxx: Start using Rib::Definition for
	shadowable information.
	* resolve/rust-late-name-resolver-2.0.cc (next_node_id): New.
	(next_hir_id): New.
	(Late::setup_builtin_types): Improve builtin type setup.
	* resolve/rust-rib.cc (Rib::Definition::Definition): New constructor.
	(Rib::Definition::Shadowable): Likewise.
	(Rib::Definition::NonShadowable): Likewise.
	(Rib::Rib): Fix general constructor.
	(Rib::insert): Use Definition class.
	(Rib::get): Likewise.
	* resolve/rust-rib.h: New Definition class, new prototypes.
---
 gcc/rust/resolve/rust-forever-stack.hxx       | 22 +++--
 .../resolve/rust-late-name-resolver-2.0.cc    | 84 +++++++++++++------
 gcc/rust/resolve/rust-rib.cc                  | 38 +++++++--
 gcc/rust/resolve/rust-rib.h                   | 30 +++++--
 4 files changed, 126 insertions(+), 48 deletions(-)

diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index 0aa9943191e..a2fdce98362 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -100,9 +100,9 @@ ForeverStack<N>::pop ()
 }
 
 static tl::expected<NodeId, DuplicateNameError>
-insert_inner (Rib &rib, std::string name, NodeId node, bool can_shadow)
+insert_inner (Rib &rib, std::string name, Rib::Definition definition)
 {
-  return rib.insert (name, node, can_shadow);
+  return rib.insert (name, definition);
 }
 
 template <Namespace N>
@@ -115,7 +115,8 @@ ForeverStack<N>::insert (Identifier name, NodeId node)
   // pass, we might end up in a situation where it is okay to re-add new names.
   // Do we just ignore that here? Do we keep track of if the Rib is new or not?
   // should our cursor have info on the current node like "is it newly pushed"?
-  return insert_inner (innermost_rib, name.as_string (), node, false);
+  return insert_inner (innermost_rib, name.as_string (),
+		       Rib::Definition::NonShadowable (node));
 }
 
 template <Namespace N>
@@ -126,7 +127,8 @@ ForeverStack<N>::insert_at_root (Identifier name, NodeId node)
 
   // inserting in the root of the crate is never a shadowing operation, even for
   // macros
-  return insert_inner (root_rib, name.as_string (), node, false);
+  return insert_inner (root_rib, name.as_string (),
+		       Rib::Definition::NonShadowable (node));
 }
 
 // Specialization for Macros and Labels - where we are allowed to shadow
@@ -135,14 +137,16 @@ template <>
 inline tl::expected<NodeId, DuplicateNameError>
 ForeverStack<Namespace::Macros>::insert (Identifier name, NodeId node)
 {
-  return insert_inner (peek (), name.as_string (), node, true);
+  return insert_inner (peek (), name.as_string (),
+		       Rib::Definition::Shadowable (node));
 }
 
 template <>
 inline tl::expected<NodeId, DuplicateNameError>
 ForeverStack<Namespace::Labels>::insert (Identifier name, NodeId node)
 {
-  return insert_inner (peek (), name.as_string (), node, true);
+  return insert_inner (peek (), name.as_string (),
+		       Rib::Definition::Shadowable (node));
 }
 
 template <Namespace N>
@@ -455,10 +459,10 @@ template <Namespace N>
 tl::optional<std::pair<typename ForeverStack<N>::Node &, std::string>>
 ForeverStack<N>::dfs (ForeverStack<N>::Node &starting_point, NodeId to_find)
 {
-  auto &values = starting_point.rib.get_values ();
+  auto values = starting_point.rib.get_values ();
 
   for (auto &kv : values)
-    if (kv.second == to_find)
+    if (kv.second.id == to_find)
       return {{starting_point, kv.first}};
 
   for (auto &child : starting_point.children)
@@ -568,7 +572,7 @@ ForeverStack<N>::stream_rib (std::stringstream &stream, const Rib &rib,
   stream << next << "rib: {\n";
 
   for (const auto &kv : rib.get_values ())
-    stream << next_next << kv.first << ": " << kv.second << "\n";
+    stream << next_next << kv.first << ": " << kv.second.id << "\n";
 
   stream << next << "},\n";
 }
diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 50034073edf..3090bbeff2a 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -18,8 +18,10 @@
 
 #include "optional.h"
 #include "rust-ast-full.h"
+#include "rust-hir-map.h"
 #include "rust-late-name-resolver-2.0.h"
 #include "rust-default-resolver.h"
+#include "rust-name-resolution-context.h"
 #include "rust-path.h"
 #include "rust-tyty.h"
 #include "rust-hir-type-check.h"
@@ -29,41 +31,75 @@ namespace Resolver2_0 {
 
 Late::Late (NameResolutionContext &ctx) : DefaultResolver (ctx) {}
 
+static NodeId
+next_node_id ()
+{
+  return Analysis::Mappings::get ()->get_next_node_id ();
+};
+
+static HirId
+next_hir_id ()
+{
+  return Analysis::Mappings::get ()->get_next_hir_id ();
+};
+
 void
 Late::setup_builtin_types ()
 {
-  auto next_id = [this] () { return ctx.mappings.get_next_hir_id (); };
-
-  static const std::pair<std::string, TyTy::BaseType *> builtins[] = {
-    {"u8", new TyTy::UintType (next_id (), TyTy::UintType::U8)},
-    {"u16", new TyTy::UintType (next_id (), TyTy::UintType::U16)},
-    {"u32", new TyTy::UintType (next_id (), TyTy::UintType::U32)},
-    {"u64", new TyTy::UintType (next_id (), TyTy::UintType::U64)},
-    {"u128", new TyTy::UintType (next_id (), TyTy::UintType::U128)},
-    {"i8", new TyTy::IntType (next_id (), TyTy::IntType::I8)},
-    {"i16", new TyTy::IntType (next_id (), TyTy::IntType::I16)},
-    {"i32", new TyTy::IntType (next_id (), TyTy::IntType::I32)},
-    {"i64", new TyTy::IntType (next_id (), TyTy::IntType::I64)},
-    {"i128", new TyTy::IntType (next_id (), TyTy::IntType::I128)},
-    {"f32", new TyTy::FloatType (next_id (), TyTy::FloatType::F32)},
-    {"f64", new TyTy::FloatType (next_id (), TyTy::FloatType::F64)},
-    {"usize", new TyTy::USizeType (next_id ())},
-    {"isize", new TyTy::ISizeType (next_id ())},
-    // missing char, str, never, ()
-    // does name resolution play a part for this? or is it all at typechecking?
-    // yeah it seems to be name resolution as well, which makes sense
+  // access the global type context to setup the TyTys
+  auto &ty_ctx = *Resolver::TypeCheckContext::get ();
+
+  // Late builtin type struct helper
+  struct LType
+  {
+    std::string name;
+    NodeId node_id;
+    NodeId hir_id;
+    TyTy::BaseType *type;
+
+    explicit LType (std::string name, TyTy::BaseType *type)
+      : name (name), node_id (next_node_id ()), hir_id (type->get_ref ()),
+	type (type)
+    {}
+  };
+
+  static const LType builtins[] = {
+    {LType ("u8", new TyTy::UintType (next_hir_id (), TyTy::UintType::U8))},
+    {LType ("u16", new TyTy::UintType (next_hir_id (), TyTy::UintType::U16))},
+    {LType ("u32", new TyTy::UintType (next_hir_id (), TyTy::UintType::U32))},
+    {LType ("u64", new TyTy::UintType (next_hir_id (), TyTy::UintType::U64))},
+    {LType ("u128", new TyTy::UintType (next_hir_id (), TyTy::UintType::U128))},
+    {LType ("i8", new TyTy::IntType (next_hir_id (), TyTy::IntType::I8))},
+    {LType ("i16", new TyTy::IntType (next_hir_id (), TyTy::IntType::I16))},
+    {LType ("i32", new TyTy::IntType (next_hir_id (), TyTy::IntType::I32))},
+    {LType ("i64", new TyTy::IntType (next_hir_id (), TyTy::IntType::I64))},
+    {LType ("i128", new TyTy::IntType (next_hir_id (), TyTy::IntType::I128))},
+    {LType ("f32", new TyTy::FloatType (next_hir_id (), TyTy::FloatType::F32))},
+    {LType ("f64", new TyTy::FloatType (next_hir_id (), TyTy::FloatType::F64))},
+    {LType ("usize", new TyTy::USizeType (next_hir_id ()))},
+    {LType ("isize", new TyTy::ISizeType (next_hir_id ()))},
+    {LType ("char", new TyTy::CharType (next_hir_id ()))},
+    {LType ("str", new TyTy::StrType (next_hir_id ()))},
+    {LType ("!", new TyTy::NeverType (next_hir_id ()))},
+
+    // the unit type `()` does not play a part in name-resolution - so we only
+    // insert it in the type context...
   };
 
   for (const auto &builtin : builtins)
     {
       // we should be able to use `insert_at_root` or `insert` here, since we're
       // at the root :) hopefully!
-      auto ok
-	= ctx.types.insert (builtin.first, builtin.second->get_ref ()
-			    /* FIXME: Invalid! This returns an *HirId* */);
-
+      auto ok = ctx.types.insert (builtin.name, builtin.node_id);
       rust_assert (ok);
+
+      ctx.mappings.insert_node_to_hir (builtin.node_id, builtin.hir_id);
+      ty_ctx.insert_builtin (builtin.hir_id, builtin.node_id, builtin.type);
     }
+
+  // ...here!
+  auto *unit_type = TyTy::TupleType::get_unit_type (next_hir_id ());
+  ty_ctx.insert_builtin (unit_type->get_ref (), next_node_id (), unit_type);
 }
 
 void
diff --git a/gcc/rust/resolve/rust-rib.cc b/gcc/rust/resolve/rust-rib.cc
index a1981498673..dee3a09ad49 100644
--- a/gcc/rust/resolve/rust-rib.cc
+++ b/gcc/rust/resolve/rust-rib.cc
@@ -17,10 +17,27 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-rib.h"
+#include "rust-name-resolution-context.h"
 
 namespace Rust {
 namespace Resolver2_0 {
 
+Rib::Definition::Definition (NodeId id, bool shadowable)
+  : id (id), shadowable (shadowable)
+{}
+
+Rib::Definition
+Rib::Definition::Shadowable (NodeId id)
+{
+  return Definition (id, true);
+}
+
+Rib::Definition
+Rib::Definition::NonShadowable (NodeId id)
+{
+  return Definition (id, false);
+}
+
 DuplicateNameError::DuplicateNameError (std::string name, NodeId existing)
   : name (name), existing (existing)
 {}
@@ -31,20 +48,23 @@ Rib::Rib (Kind kind, std::string identifier, NodeId id)
   : Rib (kind, {{identifier, id}})
 {}
 
-Rib::Rib (Kind kind, std::unordered_map<std::string, NodeId> values)
-  : kind (kind), values (std::move (values))
-{}
+Rib::Rib (Kind kind, std::unordered_map<std::string, NodeId> to_insert)
+  : kind (kind)
+{
+  for (auto &value : to_insert)
+    values.insert ({value.first, Definition::NonShadowable (value.second)});
+}
 
 tl::expected<NodeId, DuplicateNameError>
-Rib::insert (std::string name, NodeId id, bool can_shadow)
+Rib::insert (std::string name, Definition def)
 {
-  auto res = values.insert ({name, id});
-  auto inserted_id = res.first->second;
+  auto res = values.insert ({name, def});
+  auto inserted_id = res.first->second.id;
   auto existed = !res.second;
 
   // if we couldn't insert, the element already exists - exit with an error,
   // unless shadowing is allowed
-  if (existed && !can_shadow)
+  if (existed && !def.shadowable)
     return tl::make_unexpected (DuplicateNameError (name, inserted_id));
 
   // return the NodeId
@@ -59,10 +79,10 @@ Rib::get (const std::string &name)
   if (it == values.end ())
     return {};
 
-  return it->second;
+  return it->second.id;
 }
 
-const std::unordered_map<std::string, NodeId> &
+const std::unordered_map<std::string, Rib::Definition> &
 Rib::get_values () const
 {
   return values;
diff --git a/gcc/rust/resolve/rust-rib.h b/gcc/rust/resolve/rust-rib.h
index da777bb9ba7..732ad76b805 100644
--- a/gcc/rust/resolve/rust-rib.h
+++ b/gcc/rust/resolve/rust-rib.h
@@ -103,6 +103,24 @@ struct DuplicateNameError
 class Rib
 {
 public:
+  // TODO: Rename the class? to what? Binding? Declaration?
+  // This is useful for items which are in namespaces where shadowing is not
+  // allowed, but which are still shadowable! for example, when you do a glob
+  // import, if a later import has the same name as an item imported in the glob
+  // import, that glob imported item will need to get shadowed
+  class Definition
+  {
+  public:
+    static Definition NonShadowable (NodeId id);
+    static Definition Shadowable (NodeId id);
+
+    NodeId id;
+    bool shadowable;
+
+  private:
+    Definition (NodeId id, bool shadowable);
+  };
+
   enum class Kind
   {
     Normal,
@@ -131,15 +149,14 @@ public:
    * Insert a new node in the rib
    *
    * @param name The name associated with the AST node
-   * @param id Its NodeId
-   * @param can_shadow If the newly inserted value can shadow an existing one
+   * @param def The `Definition` to insert
    *
    * @return `DuplicateNameError` if the node is already present in the rib. The
    *         `DuplicateNameError` class contains the NodeId of the existing
    * node. Returns the new NodeId on success.
    */
-  tl::expected<NodeId, DuplicateNameError> insert (std::string name, NodeId id,
-						   bool can_shadow = false);
+  tl::expected<NodeId, DuplicateNameError> insert (std::string name,
+						   Definition def);
 
   /**
    * Access an inserted NodeId.
@@ -149,10 +166,11 @@ public:
   tl::optional<NodeId> get (const std::string &name);
 
   /* View all the values stored in the rib */
-  const std::unordered_map<std::string, NodeId> &get_values () const;
+  const std::unordered_map<std::string, Definition> &get_values () const;
 
 private:
-  std::unordered_map<std::string, NodeId> values;
+  // TODO: Switch this to (NodeId, shadowable = false);
+  std::unordered_map<std::string, Definition> values;
 };
 
 } // namespace Resolver2_0
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 068/125] gccrs: Fix duplicate detection
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (65 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 067/125] gccrs: late: Setup builtin types properly, change Rib API Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 069/125] gccrs: Emit error on identical use declarations Arthur Cohen
                   ` (56 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The resolver did report duplicate symbols when being run multiple times
even if the node id was the same. This commit adds an additional
condition, the error will only be reported if the existing node id is
different from the current node id.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_or_error_out):
	Add new constraint to duplicate errors.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 446a1c6a41b..407892bb7bb 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -47,11 +47,8 @@ TopLevel::insert_or_error_out (const Identifier &identifier,
 
   auto result = ctx.insert (identifier, node_id, ns);
 
-  if (!result)
+  if (!result && result.error ().existing != node_id)
     {
-      // can we do something like check if the node id is the same? if it is the
-      // same, it's not an error, just the resolver running multiple times?
-
       rich_location rich_loc (line_table, locus);
       rich_loc.add_range (node_locations[result.error ().existing]);
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 069/125] gccrs: Emit error on identical use declarations
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (66 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 068/125] gccrs: Fix duplicate detection Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 070/125] gccrs: Change error message on unresolved import Arthur Cohen
                   ` (55 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The compiler did not emit any warning when a same target was declared
from different sources.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
	Use the new dict to track down already resolved use declarations.
	* resolve/rust-toplevel-name-resolver-2.0.h: Add new dict to store
	previous use declarations.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../rust-toplevel-name-resolver-2.0.cc        | 76 ++++++++++---------
 .../resolve/rust-toplevel-name-resolver-2.0.h |  4 +
 2 files changed, 46 insertions(+), 34 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 407892bb7bb..94cc3cb62d9 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -319,40 +319,48 @@ TopLevel::handle_use_dec (AST::SimplePath path)
 
   auto found = false;
 
-  auto resolve_and_insert = [this, &found, &declared_name,
-			     locus] (Namespace ns,
-				     const AST::SimplePath &path) {
-    tl::optional<NodeId> resolved = tl::nullopt;
-
-    // FIXME: resolve_path needs to return an `expected<NodeId, Error>` so
-    // that we can improve it with hints or location or w/ever. and maybe
-    // only emit it the first time.
-    switch (ns)
-      {
-      case Namespace::Values:
-	resolved = ctx.values.resolve_path (path.get_segments ());
-	break;
-      case Namespace::Types:
-	resolved = ctx.types.resolve_path (path.get_segments ());
-	break;
-      case Namespace::Macros:
-	resolved = ctx.macros.resolve_path (path.get_segments ());
-	break;
-      case Namespace::Labels:
-	// TODO: Is that okay?
-	rust_unreachable ();
-      }
-
-    // FIXME: Ugly
-    (void) resolved.map ([this, &found, &declared_name, locus, ns] (NodeId id) {
-      found = true;
-
-      // what do we do with the id?
-      insert_or_error_out (declared_name, locus, id, ns);
-
-      return id;
-    });
-  };
+  auto resolve_and_insert
+    = [this, &found, &declared_name, locus] (Namespace ns,
+					     const AST::SimplePath &path) {
+	tl::optional<NodeId> resolved = tl::nullopt;
+
+	// FIXME: resolve_path needs to return an `expected<NodeId, Error>` so
+	// that we can improve it with hints or location or w/ever. and maybe
+	// only emit it the first time.
+	switch (ns)
+	  {
+	  case Namespace::Values:
+	    resolved = ctx.values.resolve_path (path.get_segments ());
+	    break;
+	  case Namespace::Types:
+	    resolved = ctx.types.resolve_path (path.get_segments ());
+	    break;
+	  case Namespace::Macros:
+	    resolved = ctx.macros.resolve_path (path.get_segments ());
+	    break;
+	  case Namespace::Labels:
+	    // TODO: Is that okay?
+	    rust_unreachable ();
+	  }
+
+	// FIXME: Ugly
+	(void) resolved.map (
+	  [this, &found, &declared_name, locus, ns, path] (NodeId id) {
+	    found = true;
+
+	    // what do we do with the id?
+	    insert_or_error_out (declared_name, locus, id, ns);
+	    auto result = node_forwarding.find (id);
+	    if (result != node_forwarding.cend ()
+		&& result->second != path.get_node_id ())
+	      rust_error_at (path.get_locus (), "%<%s%> defined multiple times",
+			     declared_name.c_str ());
+	    else // No previous thing has inserted this into our scope
+	      node_forwarding.insert ({id, path.get_node_id ()});
+
+	    return id;
+	  });
+      };
 
   // do this for all namespaces (even Labels?)
 
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
index ac11f310370..0a766bab259 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
@@ -60,6 +60,10 @@ private:
   // FIXME: Do we move these to our mappings?
   std::unordered_map<NodeId, location_t> node_locations;
 
+  // Store node forwarding for use declaration, the link between a
+  // "new" local name and its definition.
+  std::unordered_map<NodeId, NodeId> node_forwarding;
+
   void visit (AST::Module &module) override;
   void visit (AST::MacroRulesDefinition &macro) override;
   void visit (AST::Function &function) override;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 070/125] gccrs: Change error message on unresolved import
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (67 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 069/125] gccrs: Emit error on identical use declarations Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 071/125] gccrs: Prevent error emission on resolver reentry Arthur Cohen
                   ` (54 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The error message did not match rustc's.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Change
	error message.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 94cc3cb62d9..72c3560b9da 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -478,8 +478,7 @@ TopLevel::visit (AST::UseDeclaration &use)
   for (auto &path : paths)
     if (!handle_use_dec (path))
       rust_error_at (path.get_final_segment ().get_locus (), ErrorCode::E0433,
-		     "could not resolve import %qs",
-		     path.as_string ().c_str ());
+		     "unresolved import %qs", path.as_string ().c_str ());
 }
 
 } // namespace Resolver2_0
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 071/125] gccrs: Prevent error emission on resolver reentry
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (68 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 070/125] gccrs: Change error message on unresolved import Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 072/125] gccrs: late: Add bool builtin type Arthur Cohen
                   ` (53 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The resolver was emitting an error when meeting the same symbol twice.
What is important here is the origin of the resolved symbol, we should
emit an error when the name is similar but the symbol isn't be not when
the resolver is simply meeting the exact same symbol.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (insert_macros): Add
	constraint over the ast node id.
	(TopLevel::visit): Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 72c3560b9da..3b1ccc1d3c5 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -91,7 +91,7 @@ insert_macros (std::vector<PROC_MACRO> &macros, NameResolutionContext &ctx)
     {
       auto res = ctx.macros.insert (macro.get_name (), macro.get_node_id ());
 
-      if (!res)
+      if (!res && res.error ().existing != macro.get_node_id ())
 	{
 	  rust_error_at (UNKNOWN_LOCATION, ErrorCode::E0428,
 			 "macro %qs defined multiple times",
@@ -167,7 +167,7 @@ TopLevel::visit (AST::MacroRulesDefinition &macro)
     {
       auto res = ctx.macros.insert_at_root (macro.get_rule_name (),
 					    macro.get_node_id ());
-      if (!res)
+      if (!res && res.error ().existing != macro.get_node_id ())
 	{
 	  // TODO: Factor this
 	  rich_location rich_loc (line_table, macro.get_locus ());
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 072/125] gccrs: late: Add bool builtin type
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (69 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 071/125] gccrs: Prevent error emission on resolver reentry Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 073/125] gccrs: Add modules to type namespace Arthur Cohen
                   ` (52 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::setup_builtin_types):
	Setup bool as builtin type.
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 3090bbeff2a..ee06c4efc2e 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -64,6 +64,7 @@ Late::setup_builtin_types ()
   };
 
   static const LType builtins[] = {
+    {LType ("bool", new TyTy::BoolType (next_hir_id ()))},
     {LType ("u8", new TyTy::UintType (next_hir_id (), TyTy::UintType::U8))},
     {LType ("u16", new TyTy::UintType (next_hir_id (), TyTy::UintType::U16))},
     {LType ("u32", new TyTy::UintType (next_hir_id (), TyTy::UintType::U32))},
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 073/125] gccrs: Add modules to type namespace
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (70 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 072/125] gccrs: late: Add bool builtin type Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 074/125] gccrs: Add name resolution for on globbing use decl Arthur Cohen
                   ` (51 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Module
	should be added to the type namespace in order to be retrieved later.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 3b1ccc1d3c5..5e6f5e9bd78 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -72,7 +72,7 @@ TopLevel::go (AST::Crate &crate)
 void
 TopLevel::visit (AST::Module &module)
 {
-  // FIXME: Do we need to insert the module in the type namespace?
+  insert_or_error_out (module.get_name (), module, Namespace::Types);
 
   auto sub_visitor = [this, &module] () {
     for (auto &item : module.get_items ())
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 074/125] gccrs: Add name resolution for on globbing use decl
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (71 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 073/125] gccrs: Add modules to type namespace Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 075/125] gccrs: Shape up name resolver for normal direct calls Arthur Cohen
                   ` (50 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

This is the first part of the code required to enable globbing on use
declarations.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
	Insert names into their namespace.
	(TopLevel::visit): Insert ast module.
	(TopLevel::handle_use_dec): Resolve use declaration.
	(TopLevel::handle_use_glob): Use globbing visitor.
	(flatten_list): Use globbing path vector.
	(flatten_glob): Likewise.
	(flatten): Likewise.
	(prefix_subpaths): Add a function to prefix subpath.
	* resolve/rust-toplevel-name-resolver-2.0.h (class GlobbingVisitor):
	Add globbing visitor.
	* util/rust-hir-map.cc (Mappings::insert_ast_module): Add function to
	insert module in module hashmap.
	(Mappings::lookup_ast_module): Add function to retrieve ast module.
	* util/rust-hir-map.h: Add module map and getter/setter prototypes.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../rust-toplevel-name-resolver-2.0.cc        | 179 +++++++++++++++---
 .../resolve/rust-toplevel-name-resolver-2.0.h |  23 +++
 gcc/rust/util/rust-hir-map.cc                 |  19 ++
 gcc/rust/util/rust-hir-map.h                  |   3 +
 4 files changed, 199 insertions(+), 25 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 5e6f5e9bd78..3122d41412f 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -25,6 +25,87 @@
 namespace Rust {
 namespace Resolver2_0 {
 
+void
+GlobbingVisitor::visit (AST::Module &module)
+{
+  if (module.get_visibility ().is_public ())
+    ctx.insert (module.get_name (), module.get_node_id (), Namespace::Types);
+}
+
+void
+GlobbingVisitor::visit (AST::MacroRulesDefinition &macro)
+{
+  if (macro.get_visibility ().is_public ())
+    ctx.insert (macro.get_rule_name (), macro.get_node_id (),
+		Namespace::Macros);
+}
+
+void
+GlobbingVisitor::visit (AST::Function &function)
+{
+  if (function.get_visibility ().is_public ())
+    ctx.insert (function.get_function_name (), function.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::StaticItem &static_item)
+{
+  if (static_item.get_visibility ().is_public ())
+    ctx.insert (static_item.get_identifier (), static_item.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::StructStruct &struct_item)
+{
+  if (struct_item.get_visibility ().is_public ())
+    ctx.insert (struct_item.get_identifier (), struct_item.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::TupleStruct &tuple_struct)
+{
+  if (tuple_struct.get_visibility ().is_public ())
+    ctx.insert (tuple_struct.get_identifier (), tuple_struct.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::Enum &enum_item)
+{
+  if (enum_item.get_visibility ().is_public ())
+    ctx.insert (enum_item.get_identifier (), enum_item.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::Union &union_item)
+{
+  if (union_item.get_visibility ().is_public ())
+    ctx.insert (union_item.get_identifier (), union_item.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::ConstantItem &const_item)
+{
+  if (const_item.get_visibility ().is_public ())
+    ctx.insert (const_item.get_identifier (), const_item.get_node_id (),
+		Namespace::Values);
+}
+
+void
+GlobbingVisitor::visit (AST::ExternCrate &crate)
+{}
+
+void
+GlobbingVisitor::visit (AST::UseDeclaration &use)
+{
+  // Handle cycles ?
+}
+
 TopLevel::TopLevel (NameResolutionContext &resolver)
   : DefaultResolver (resolver)
 {}
@@ -81,6 +162,10 @@ TopLevel::visit (AST::Module &module)
 
   ctx.scoped (Rib::Kind::Module, module.get_node_id (), sub_visitor,
 	      module.get_name ());
+
+  if (Analysis::Mappings::get ()->lookup_ast_module (module.get_node_id ())
+      == tl::nullopt)
+    Analysis::Mappings::get ()->insert_ast_module (&module);
 }
 
 template <typename PROC_MACRO>
@@ -302,13 +387,26 @@ TopLevel::visit (AST::ConstantItem &const_item)
 }
 
 bool
-TopLevel::handle_use_dec (AST::SimplePath path)
+TopLevel::handle_use_glob (AST::SimplePath glob)
 {
-  // TODO: Glob imports can get shadowed by regular imports and regular items.
-  // So we need to store them in a specific way in the ForeverStack - which can
-  // also probably be used by labels and macros etc. Like store it as a
-  // `Shadowable(NodeId)` instead of just a `NodeId`
+  auto resolved = ctx.types.resolve_path (glob.get_segments ());
+  if (!resolved.has_value ())
+    return false;
+
+  auto result = Analysis::Mappings::get ()->lookup_ast_module (*resolved);
+
+  if (!result.has_value ())
+    return false;
+
+  GlobbingVisitor gvisitor (ctx);
+  gvisitor.visit (*result.value ());
+
+  return true;
+}
 
+bool
+TopLevel::handle_use_dec (AST::SimplePath path)
+{
   auto locus = path.get_final_segment ().get_locus ();
   auto declared_name = path.get_final_segment ().as_string ();
 
@@ -377,14 +475,17 @@ static void
 flatten_rebind (const AST::UseTreeRebind &glob,
 		std::vector<AST::SimplePath> &paths);
 static void
-flatten_list (const AST::UseTreeList &glob,
-	      std::vector<AST::SimplePath> &paths);
+flatten_list (const AST::UseTreeList &glob, std::vector<AST::SimplePath> &paths,
+	      std::vector<AST::SimplePath> &glob_paths,
+	      NameResolutionContext &ctx);
 static void
 flatten_glob (const AST::UseTreeGlob &glob,
-	      std::vector<AST::SimplePath> &paths);
+	      std::vector<AST::SimplePath> &glob_paths,
+	      NameResolutionContext &ctx);
 
 static void
-flatten (const AST::UseTree *tree, std::vector<AST::SimplePath> &paths)
+flatten (const AST::UseTree *tree, std::vector<AST::SimplePath> &paths,
+	 std::vector<AST::SimplePath> &glob_paths, NameResolutionContext &ctx)
 {
   switch (tree->get_kind ())
     {
@@ -395,13 +496,12 @@ flatten (const AST::UseTree *tree, std::vector<AST::SimplePath> &paths)
       }
       case AST::UseTree::List: {
 	auto list = static_cast<const AST::UseTreeList *> (tree);
-	flatten_list (*list, paths);
+	flatten_list (*list, paths, glob_paths, ctx);
 	break;
       }
       case AST::UseTree::Glob: {
-	rust_sorry_at (tree->get_locus (), "cannot resolve glob imports yet");
 	auto glob = static_cast<const AST::UseTreeGlob *> (tree);
-	flatten_glob (*glob, paths);
+	flatten_glob (*glob, glob_paths, ctx);
 	break;
       }
       break;
@@ -432,8 +532,28 @@ flatten_rebind (const AST::UseTreeRebind &rebind,
     }
 }
 
+/** Prefix a list of subpath
+ * @param prefix A prefix for all subpath
+ * @param subs List of subpath to prefix
+ * @param size List where results should be stored
+ */
+static void
+prefix_subpaths (AST::SimplePath prefix, std::vector<AST::SimplePath> subs,
+		 std::vector<AST::SimplePath> &results)
+{
+  for (auto &sub : subs)
+    {
+      auto new_path = prefix;
+      std::copy (sub.get_segments ().begin (), sub.get_segments ().end (),
+		 std::back_inserter (new_path.get_segments ()));
+      results.emplace_back (new_path);
+    }
+}
+
 static void
-flatten_list (const AST::UseTreeList &list, std::vector<AST::SimplePath> &paths)
+flatten_list (const AST::UseTreeList &list, std::vector<AST::SimplePath> &paths,
+	      std::vector<AST::SimplePath> &glob_paths,
+	      NameResolutionContext &ctx)
 {
   auto prefix = AST::SimplePath::create_empty ();
   if (list.has_path ())
@@ -442,43 +562,52 @@ flatten_list (const AST::UseTreeList &list, std::vector<AST::SimplePath> &paths)
   for (const auto &tree : list.get_trees ())
     {
       auto sub_paths = std::vector<AST::SimplePath> ();
-      flatten (tree.get (), sub_paths);
-
-      for (auto &sub_path : sub_paths)
-	{
-	  auto new_path = prefix;
-	  std::copy (sub_path.get_segments ().begin (),
-		     sub_path.get_segments ().end (),
-		     std::back_inserter (new_path.get_segments ()));
+      auto sub_globs = std::vector<AST::SimplePath> ();
+      flatten (tree.get (), sub_paths, sub_globs, ctx);
 
-	  paths.emplace_back (new_path);
-	}
+      prefix_subpaths (prefix, sub_paths, paths);
+      prefix_subpaths (prefix, sub_globs, glob_paths);
     }
 }
 
 static void
-flatten_glob (const AST::UseTreeGlob &glob, std::vector<AST::SimplePath> &paths)
+flatten_glob (const AST::UseTreeGlob &glob, std::vector<AST::SimplePath> &paths,
+	      NameResolutionContext &ctx)
 {
   if (glob.has_path ())
     paths.emplace_back (glob.get_path ());
+
+  // (PE): Get path rib
+  auto rib = ctx.values.resolve_path (glob.get_path ().get_segments ())
+	       .and_then ([&] (NodeId id) { return ctx.values.to_rib (id); });
+  if (rib.has_value ())
+    {
+      auto value = rib.value ().get_values ();
+    }
 }
 
 void
 TopLevel::visit (AST::UseDeclaration &use)
 {
   auto paths = std::vector<AST::SimplePath> ();
+  auto glob_path = std::vector<AST::SimplePath> ();
 
   // FIXME: How do we handle `use foo::{self}` imports? Some beforehand cleanup?
   // How do we handle module imports in general? Should they get added to all
   // namespaces?
 
   const auto &tree = use.get_tree ();
-  flatten (tree.get (), paths);
+  flatten (tree.get (), paths, glob_path, this->ctx);
 
   for (auto &path : paths)
     if (!handle_use_dec (path))
       rust_error_at (path.get_final_segment ().get_locus (), ErrorCode::E0433,
 		     "unresolved import %qs", path.as_string ().c_str ());
+
+  for (auto &glob : glob_path)
+    if (!handle_use_glob (glob))
+      rust_error_at (glob.get_final_segment ().get_locus (), ErrorCode::E0433,
+		     "unresolved import %qs", glob.as_string ().c_str ());
 }
 
 } // namespace Resolver2_0
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
index 0a766bab259..31535a9b22e 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
@@ -26,6 +26,28 @@
 namespace Rust {
 namespace Resolver2_0 {
 
+class GlobbingVisitor : public AST::DefaultASTVisitor
+{
+  using AST::DefaultASTVisitor::visit;
+
+public:
+  GlobbingVisitor (NameResolutionContext &ctx) : ctx (ctx) {}
+
+  void visit (AST::Module &module) override;
+  void visit (AST::MacroRulesDefinition &macro) override;
+  void visit (AST::Function &function) override;
+  void visit (AST::StaticItem &static_item) override;
+  void visit (AST::StructStruct &struct_item) override;
+  void visit (AST::TupleStruct &tuple_struct) override;
+  void visit (AST::Enum &enum_item) override;
+  void visit (AST::Union &union_item) override;
+  void visit (AST::ConstantItem &const_item) override;
+  void visit (AST::ExternCrate &crate) override;
+  void visit (AST::UseDeclaration &use) override;
+
+private:
+  NameResolutionContext &ctx;
+};
 /**
  * The `TopLevel` visitor takes care of collecting all the definitions in a
  * crate, and inserting them into the proper namespaces. These definitions can
@@ -85,6 +107,7 @@ private:
   // UseTreeList for example
   // FIXME: Should that return `found`?
   bool handle_use_dec (AST::SimplePath path);
+  bool handle_use_glob (AST::SimplePath glob);
 
   void visit (AST::UseDeclaration &use) override;
 };
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc
index c62c11189ae..05b26d64069 100644
--- a/gcc/rust/util/rust-hir-map.cc
+++ b/gcc/rust/util/rust-hir-map.cc
@@ -17,9 +17,11 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-hir-map.h"
+#include "optional.h"
 #include "rust-ast-full.h"
 #include "rust-diagnostics.h"
 #include "rust-hir-full.h"
+#include "rust-item.h"
 #include "rust-macro-builtins.h"
 #include "rust-mapping-common.h"
 #include "rust-attribute-values.h"
@@ -1158,6 +1160,23 @@ Mappings::lookup_module_children (NodeId module)
   return it->second;
 }
 
+void
+Mappings::insert_ast_module (AST::Module *module)
+{
+  rust_assert (modules.find (module->get_node_id ()) == modules.end ());
+  modules[module->get_node_id ()] = module;
+}
+
+tl::optional<AST::Module *>
+Mappings::lookup_ast_module (NodeId id)
+{
+  auto it = modules.find (id);
+  if (it == modules.end ())
+    return tl::nullopt;
+
+  return {it->second};
+}
+
 void
 Mappings::insert_module_child_item (NodeId module,
 				    Resolver::CanonicalPath child)
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h
index 927c01251db..92af0673f95 100644
--- a/gcc/rust/util/rust-hir-map.h
+++ b/gcc/rust/util/rust-hir-map.h
@@ -328,6 +328,8 @@ public:
   void insert_visibility (NodeId id, Privacy::ModuleVisibility visibility);
   bool lookup_visibility (NodeId id, Privacy::ModuleVisibility &def);
 
+  void insert_ast_module (AST::Module *);
+  tl::optional<AST::Module *> lookup_ast_module (NodeId id);
   void insert_module_child (NodeId module, NodeId child);
   tl::optional<std::vector<NodeId> &> lookup_module_children (NodeId module);
 
@@ -427,6 +429,7 @@ private:
   std::map<NodeId, std::vector<NodeId>> module_child_map;
   std::map<NodeId, std::vector<Resolver::CanonicalPath>> module_child_items;
   std::map<NodeId, NodeId> child_to_parent_module_map;
+  std::map<NodeId, AST::Module *> modules;
 
   // AST mappings
   std::map<NodeId, AST::Item *> ast_item_mappings;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 075/125] gccrs: Shape up name resolver for normal direct calls
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (72 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 074/125] gccrs: Add name resolution for on globbing use decl Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 076/125] gccrs: Add call to globbing visitor Arthur Cohen
                   ` (49 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Direct function calls did not work anymore due to the transition to the
new resolver.

gcc/rust/ChangeLog:

	* checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id):
	Add code path for the resolver 2.0
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove failing
	label context resolve call.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/checks/lints/rust-lint-marklive.cc   | 23 +++++++++++++++----
 .../resolve/rust-late-name-resolver-2.0.cc    |  3 ++-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/checks/lints/rust-lint-marklive.cc b/gcc/rust/checks/lints/rust-lint-marklive.cc
index 8787a9d8550..1a0a0a2b904 100644
--- a/gcc/rust/checks/lints/rust-lint-marklive.cc
+++ b/gcc/rust/checks/lints/rust-lint-marklive.cc
@@ -20,8 +20,10 @@
 // from live codes are live, and everything else is dead.
 
 #include "rust-lint-marklive.h"
+#include "options.h"
 #include "rust-hir-full.h"
 #include "rust-name-resolver.h"
+#include "rust-immutable-name-resolution-context.h"
 
 namespace Rust {
 namespace Analysis {
@@ -270,12 +272,25 @@ MarkLive::mark_hir_id (HirId id)
 void
 MarkLive::find_ref_node_id (NodeId ast_node_id, NodeId &ref_node_id)
 {
-  if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
+  if (flag_name_resolution_2_0)
     {
-      if (!resolver->lookup_resolved_type (ast_node_id, &ref_node_id))
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+      nr_ctx.lookup (ast_node_id).map ([&ref_node_id] (NodeId resolved) {
+	ref_node_id = resolved;
+      });
+    }
+  else
+    {
+      if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
 	{
-	  bool ok = resolver->lookup_resolved_misc (ast_node_id, &ref_node_id);
-	  rust_assert (ok);
+	  if (!resolver->lookup_resolved_type (ast_node_id, &ref_node_id))
+	    {
+	      bool ok
+		= resolver->lookup_resolved_misc (ast_node_id, &ref_node_id);
+	      rust_assert (ok);
+	    }
 	}
     }
 }
diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index ee06c4efc2e..68eb88a1e4c 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -196,8 +196,9 @@ Late::visit (AST::PathInExpression &expr)
   // in a function item` error here?
   // do we emit it in `get<Namespace::Labels>`?
 
-  auto label = ctx.labels.resolve_path (expr.get_segments ());
   auto value = ctx.values.resolve_path (expr.get_segments ());
+
+  ctx.map_usage (Usage (expr.get_node_id ()), Definition (*value));
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 076/125] gccrs: Add call to globbing visitor
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (73 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 075/125] gccrs: Shape up name resolver for normal direct calls Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 077/125] gccrs: Make globbing definition shadowable by default Arthur Cohen
                   ` (48 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Globbing visitor did not visit subitems.

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add a check
	for missing item.
	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::go):
	Add a new function in the visitor to dispatch the visitor to items in
	the given module.
	(TopLevel::handle_use_glob): Change call to visitor to use the pointer.
	* resolve/rust-toplevel-name-resolver-2.0.h: Add prototype for new
	member function.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc     | 2 ++
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 9 ++++++++-
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h  | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 68eb88a1e4c..d8bd9ac524f 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -197,6 +197,8 @@ Late::visit (AST::PathInExpression &expr)
   // do we emit it in `get<Namespace::Labels>`?
 
   auto value = ctx.values.resolve_path (expr.get_segments ());
+  if (!value.has_value ())
+    rust_unreachable (); // Should have been resolved earlier
 
   ctx.map_usage (Usage (expr.get_node_id ()), Definition (*value));
 }
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 3122d41412f..501204174f2 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -25,6 +25,13 @@
 namespace Rust {
 namespace Resolver2_0 {
 
+void
+GlobbingVisitor::go (AST::Module *module)
+{
+  for (auto &i : module->get_items ())
+    visit (i);
+}
+
 void
 GlobbingVisitor::visit (AST::Module &module)
 {
@@ -399,7 +406,7 @@ TopLevel::handle_use_glob (AST::SimplePath glob)
     return false;
 
   GlobbingVisitor gvisitor (ctx);
-  gvisitor.visit (*result.value ());
+  gvisitor.go (result.value ());
 
   return true;
 }
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
index 31535a9b22e..f5e224fa049 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
@@ -33,6 +33,7 @@ class GlobbingVisitor : public AST::DefaultASTVisitor
 public:
   GlobbingVisitor (NameResolutionContext &ctx) : ctx (ctx) {}
 
+  void go (AST::Module *module);
   void visit (AST::Module &module) override;
   void visit (AST::MacroRulesDefinition &macro) override;
   void visit (AST::Function &function) override;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 077/125] gccrs: Make globbing definition shadowable by default
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (74 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 076/125] gccrs: Add call to globbing visitor Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 078/125] gccrs: Add support for ambiguous use declarations Arthur Cohen
                   ` (47 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Elements from glob use declaration shall be shadowable by default.

gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: Add a new function prototype to insert
	a shadowable definition.
	* resolve/rust-forever-stack.hxx: Add the new insert_shadowable
	function to insert shadowable definition into the forever stack.
	* resolve/rust-name-resolution-context.cc (NameResolutionContext::insert_shadowable):
	Likewise with the name resolution context.
	* resolve/rust-name-resolution-context.h: Add name resolution context
	insert_shadowable member function prototype.
	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
	Insert shadowable definition into the forever stack for glob use
	declaration.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-forever-stack.h         | 15 ++++++++
 gcc/rust/resolve/rust-forever-stack.hxx       | 10 ++++++
 .../resolve/rust-name-resolution-context.cc   | 19 ++++++++++
 .../resolve/rust-name-resolution-context.h    |  3 ++
 .../rust-toplevel-name-resolver-2.0.cc        | 35 ++++++++++---------
 5 files changed, 65 insertions(+), 17 deletions(-)

diff --git a/gcc/rust/resolve/rust-forever-stack.h b/gcc/rust/resolve/rust-forever-stack.h
index 01371fc7bcd..bba5875d435 100644
--- a/gcc/rust/resolve/rust-forever-stack.h
+++ b/gcc/rust/resolve/rust-forever-stack.h
@@ -437,6 +437,21 @@ public:
    */
   tl::expected<NodeId, DuplicateNameError> insert (Identifier name, NodeId id);
 
+  /**
+   * Insert a new shadowable definition in the innermost `Rib` in this stack
+   *
+   * @param name The name of the definition
+   * @param id Its NodeId
+   *
+   * @return `DuplicateNameError` if that node was already present in the Rib,
+   * the node's `NodeId` otherwise.
+   *
+   * @aborts if there are no `Rib`s inserted in the current map, this function
+   *         aborts the program.
+   */
+  tl::expected<NodeId, DuplicateNameError> insert_shadowable (Identifier name,
+							      NodeId id);
+
   /**
    * Insert a new definition at the root of this stack
    *
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index a2fdce98362..008adff4676 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -119,6 +119,16 @@ ForeverStack<N>::insert (Identifier name, NodeId node)
 		       Rib::Definition::NonShadowable (node));
 }
 
+template <Namespace N>
+tl::expected<NodeId, DuplicateNameError>
+ForeverStack<N>::insert_shadowable (Identifier name, NodeId node)
+{
+  auto &innermost_rib = peek ();
+
+  return insert_inner (innermost_rib, name.as_string (),
+		       Rib::Definition::Shadowable (node));
+}
+
 template <Namespace N>
 tl::expected<NodeId, DuplicateNameError>
 ForeverStack<N>::insert_at_root (Identifier name, NodeId node)
diff --git a/gcc/rust/resolve/rust-name-resolution-context.cc b/gcc/rust/resolve/rust-name-resolution-context.cc
index 0340d28f127..e8529b70bcb 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.cc
+++ b/gcc/rust/resolve/rust-name-resolution-context.cc
@@ -45,6 +45,25 @@ NameResolutionContext::insert (Identifier name, NodeId id, Namespace ns)
     }
 }
 
+tl::expected<NodeId, DuplicateNameError>
+NameResolutionContext::insert_shadowable (Identifier name, NodeId id,
+					  Namespace ns)
+{
+  switch (ns)
+    {
+    case Namespace::Values:
+      return values.insert_shadowable (name, id);
+    case Namespace::Types:
+      return types.insert_shadowable (name, id);
+    case Namespace::Macros:
+      return macros.insert_shadowable (name, id);
+    case Namespace::Labels:
+    default:
+      // return labels.insert (name, id);
+      rust_unreachable ();
+    }
+}
+
 void
 NameResolutionContext::map_usage (Usage usage, Definition definition)
 {
diff --git a/gcc/rust/resolve/rust-name-resolution-context.h b/gcc/rust/resolve/rust-name-resolution-context.h
index 8702900d0f3..74f110d54de 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.h
+++ b/gcc/rust/resolve/rust-name-resolution-context.h
@@ -171,6 +171,9 @@ public:
   tl::expected<NodeId, DuplicateNameError> insert (Identifier name, NodeId id,
 						   Namespace ns);
 
+  tl::expected<NodeId, DuplicateNameError>
+  insert_shadowable (Identifier name, NodeId id, Namespace ns);
+
   /**
    * Run a lambda in a "scoped" context, meaning that a new `Rib` will be pushed
    * before executing the lambda and then popped. This is useful for all kinds
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 501204174f2..7f4169a4d8e 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -36,71 +36,72 @@ void
 GlobbingVisitor::visit (AST::Module &module)
 {
   if (module.get_visibility ().is_public ())
-    ctx.insert (module.get_name (), module.get_node_id (), Namespace::Types);
+    ctx.insert_shadowable (module.get_name (), module.get_node_id (),
+			   Namespace::Types);
 }
 
 void
 GlobbingVisitor::visit (AST::MacroRulesDefinition &macro)
 {
   if (macro.get_visibility ().is_public ())
-    ctx.insert (macro.get_rule_name (), macro.get_node_id (),
-		Namespace::Macros);
+    ctx.insert_shadowable (macro.get_rule_name (), macro.get_node_id (),
+			   Namespace::Macros);
 }
 
 void
 GlobbingVisitor::visit (AST::Function &function)
 {
   if (function.get_visibility ().is_public ())
-    ctx.insert (function.get_function_name (), function.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (function.get_function_name (),
+			   function.get_node_id (), Namespace::Values);
 }
 
 void
 GlobbingVisitor::visit (AST::StaticItem &static_item)
 {
   if (static_item.get_visibility ().is_public ())
-    ctx.insert (static_item.get_identifier (), static_item.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (static_item.get_identifier (),
+			   static_item.get_node_id (), Namespace::Values);
 }
 
 void
 GlobbingVisitor::visit (AST::StructStruct &struct_item)
 {
   if (struct_item.get_visibility ().is_public ())
-    ctx.insert (struct_item.get_identifier (), struct_item.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (struct_item.get_identifier (),
+			   struct_item.get_node_id (), Namespace::Values);
 }
 
 void
 GlobbingVisitor::visit (AST::TupleStruct &tuple_struct)
 {
   if (tuple_struct.get_visibility ().is_public ())
-    ctx.insert (tuple_struct.get_identifier (), tuple_struct.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (tuple_struct.get_identifier (),
+			   tuple_struct.get_node_id (), Namespace::Values);
 }
 
 void
 GlobbingVisitor::visit (AST::Enum &enum_item)
 {
   if (enum_item.get_visibility ().is_public ())
-    ctx.insert (enum_item.get_identifier (), enum_item.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (enum_item.get_identifier (),
+			   enum_item.get_node_id (), Namespace::Values);
 }
 
 void
 GlobbingVisitor::visit (AST::Union &union_item)
 {
   if (union_item.get_visibility ().is_public ())
-    ctx.insert (union_item.get_identifier (), union_item.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (union_item.get_identifier (),
+			   union_item.get_node_id (), Namespace::Values);
 }
 
 void
 GlobbingVisitor::visit (AST::ConstantItem &const_item)
 {
   if (const_item.get_visibility ().is_public ())
-    ctx.insert (const_item.get_identifier (), const_item.get_node_id (),
-		Namespace::Values);
+    ctx.insert_shadowable (const_item.get_identifier (),
+			   const_item.get_node_id (), Namespace::Values);
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 078/125] gccrs: Add support for ambiguous use declarations
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (75 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 077/125] gccrs: Make globbing definition shadowable by default Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 079/125] gccrs: Add tuple struct constructor to value namespace Arthur Cohen
                   ` (46 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Glob use declarations may lead to ambiguous situation where two
definitions with the same name are imported in a given scope. The
compiler now handles shadowable items inserted after non shadowable
items. An error is now thrown when multiple shadowable items are imported
and used in the same rib.

gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc (Early::visit): Adapt
	resolved type to the new API.
	(Early::visit_attributes): Retrieve the node id from the definition.
	* resolve/rust-forever-stack.h: Change the return type of getter
	functions. Those functions now return a definition type instead of a
	node id.
	* resolve/rust-forever-stack.hxx: Change member function implementation
	in the forever stack to accomodate it's API changes.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Use internal
	node id. Emit an error when resolving multiple ambiguous values.
	* resolve/rust-rib.cc (Rib::Definition::Definition): Add a default
	constructor.
	(Rib::Definition::is_ambiguous): Add a new function to determine
	whether a function definition is ambiguous or not.
	(Rib::Definition::to_string): Add a member function to convert a given
	definition to a string.
	(Rib::insert): Add new rules for value insertion in a rib. Insertion
	order does not impact the result anymore: inserting a shadowable value
	after a non shadowable one does not trigger an error anymore. All
	shadowable values inserted in a rib are kepts until being replaced by a
	non shadowable one.
	(Rib::get): Return a definition instead of a node id.
	* resolve/rust-rib.h: Update function prototypes.
	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob):
	Update return value container to match the new function's prototype.
	(TopLevel::handle_use_dec): Likewise.
	(flatten_glob): Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../resolve/rust-early-name-resolver-2.0.cc   | 18 ++---
 gcc/rust/resolve/rust-forever-stack.h         | 10 +--
 gcc/rust/resolve/rust-forever-stack.hxx       | 39 ++++++-----
 .../resolve/rust-late-name-resolver-2.0.cc    | 17 +++--
 gcc/rust/resolve/rust-rib.cc                  | 69 +++++++++++++++----
 gcc/rust/resolve/rust-rib.h                   | 19 ++++-
 .../rust-toplevel-name-resolver-2.0.cc        | 41 ++++++-----
 7 files changed, 142 insertions(+), 71 deletions(-)

diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
index 982c696d2af..af148b0c1c0 100644
--- a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
@@ -152,9 +152,11 @@ Early::visit (AST::MacroInvocation &invoc)
 
   // https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope
 
-  tl::optional<NodeId> definition = tl::nullopt;
+  tl::optional<Rib::Definition> definition = tl::nullopt;
   if (path.get_segments ().size () == 1)
-    definition = textual_scope.get (path.get_final_segment ().as_string ());
+    definition
+      = textual_scope.get (path.get_final_segment ().as_string ())
+	  .map ([] (NodeId id) { return Rib::Definition::NonShadowable (id); });
 
   // we won't have changed `definition` from `nullopt` if there are more
   // than one segments in our path
@@ -169,13 +171,13 @@ Early::visit (AST::MacroInvocation &invoc)
       return;
     }
 
-  insert_once (invoc, *definition);
+  insert_once (invoc, definition->get_node_id ());
 
   // now do we need to keep mappings or something? or insert "uses" into our
   // ForeverStack? can we do that? are mappings simpler?
   auto mappings = Analysis::Mappings::get ();
   AST::MacroRulesDefinition *rules_def = nullptr;
-  if (!mappings->lookup_macro_def (definition.value (), &rules_def))
+  if (!mappings->lookup_macro_def (definition->get_node_id (), &rules_def))
     {
       // Macro definition not found, maybe it is not expanded yet.
       return;
@@ -212,8 +214,8 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
 		  continue;
 		}
 
-	      auto pm_def
-		= mappings->lookup_derive_proc_macro_def (definition.value ());
+	      auto pm_def = mappings->lookup_derive_proc_macro_def (
+		definition->get_node_id ());
 
 	      rust_assert (pm_def.has_value ());
 
@@ -234,8 +236,8 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
 			     "could not resolve attribute macro invocation");
 	      return;
 	    }
-	  auto pm_def
-	    = mappings->lookup_attribute_proc_macro_def (definition.value ());
+	  auto pm_def = mappings->lookup_attribute_proc_macro_def (
+	    definition->get_node_id ());
 
 	  rust_assert (pm_def.has_value ());
 
diff --git a/gcc/rust/resolve/rust-forever-stack.h b/gcc/rust/resolve/rust-forever-stack.h
index bba5875d435..3dab45e7e77 100644
--- a/gcc/rust/resolve/rust-forever-stack.h
+++ b/gcc/rust/resolve/rust-forever-stack.h
@@ -480,21 +480,21 @@ public:
    * @param name Name of the identifier to locate in this scope or an outermore
    *        scope
    *
-   * @return a valid option with the NodeId if the identifier is present in the
-   *         current map, an empty one otherwise.
+   * @return a valid option with the Definition if the identifier is present in
+   * the current map, an empty one otherwise.
    */
-  tl::optional<NodeId> get (const Identifier &name);
+  tl::optional<Rib::Definition> get (const Identifier &name);
 
   /**
    * Resolve a path to its definition in the current `ForeverStack`
    *
    * // TODO: Add documentation for `segments`
    *
-   * @return a valid option with the NodeId if the path is present in the
+   * @return a valid option with the Definition if the path is present in the
    *         current map, an empty one otherwise.
    */
   template <typename S>
-  tl::optional<NodeId> resolve_path (const std::vector<S> &segments);
+  tl::optional<Rib::Definition> resolve_path (const std::vector<S> &segments);
 
   // FIXME: Documentation
   tl::optional<Resolver::CanonicalPath> to_canonical_path (NodeId id);
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index 008adff4676..6b622b8aef1 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -90,11 +90,13 @@ ForeverStack<N>::pop ()
   rust_debug ("popping link");
 
   for (const auto &kv : cursor ().rib.get_values ())
-    rust_debug ("current_rib: k: %s, v: %d", kv.first.c_str (), kv.second);
+    rust_debug ("current_rib: k: %s, v: %s", kv.first.c_str (),
+		kv.second.to_string ().c_str ());
 
   if (cursor ().parent.has_value ())
     for (const auto &kv : cursor ().parent.value ().rib.get_values ())
-      rust_debug ("new cursor: k: %s, v: %d", kv.first.c_str (), kv.second);
+      rust_debug ("new cursor: k: %s, v: %s", kv.first.c_str (),
+		  kv.second.to_string ().c_str ());
 
   update_cursor (cursor ().parent.value ());
 }
@@ -222,22 +224,22 @@ ForeverStack<N>::update_cursor (Node &new_cursor)
 }
 
 template <Namespace N>
-tl::optional<NodeId>
+tl::optional<Rib::Definition>
 ForeverStack<N>::get (const Identifier &name)
 {
-  tl::optional<NodeId> resolved_node = tl::nullopt;
+  tl::optional<Rib::Definition> resolved_definition = tl::nullopt;
 
   // TODO: Can we improve the API? have `reverse_iter` return an optional?
-  reverse_iter ([&resolved_node, &name] (Node &current) {
+  reverse_iter ([&resolved_definition, &name] (Node &current) {
     auto candidate = current.rib.get (name.as_string ());
 
     return candidate.map_or (
-      [&resolved_node] (NodeId found) {
+      [&resolved_definition] (Rib::Definition found) {
 	// for most namespaces, we do not need to care about various ribs - they
 	// are available from all contexts if defined in the current scope, or
 	// an outermore one. so if we do have a candidate, we can return it
 	// directly and stop iterating
-	resolved_node = found;
+	resolved_definition = found;
 
 	return KeepGoing::No;
       },
@@ -245,16 +247,16 @@ ForeverStack<N>::get (const Identifier &name)
       KeepGoing::Yes);
   });
 
-  return resolved_node;
+  return resolved_definition;
 }
 
 template <>
-tl::optional<NodeId> inline ForeverStack<Namespace::Labels>::get (
+tl::optional<Rib::Definition> inline ForeverStack<Namespace::Labels>::get (
   const Identifier &name)
 {
-  tl::optional<NodeId> resolved_node = tl::nullopt;
+  tl::optional<Rib::Definition> resolved_definition = tl::nullopt;
 
-  reverse_iter ([&resolved_node, &name] (Node &current) {
+  reverse_iter ([&resolved_definition, &name] (Node &current) {
     // looking up for labels cannot go through function ribs
     // TODO: What other ribs?
     if (current.rib.kind == Rib::Kind::Function)
@@ -264,15 +266,15 @@ tl::optional<NodeId> inline ForeverStack<Namespace::Labels>::get (
 
     // FIXME: Factor this in a function with the generic `get`
     return candidate.map_or (
-      [&resolved_node] (NodeId found) {
-	resolved_node = found;
+      [&resolved_definition] (Rib::Definition found) {
+	resolved_definition = found;
 
 	return KeepGoing::No;
       },
       KeepGoing::Yes);
   });
 
-  return resolved_node;
+  return resolved_definition;
 }
 
 /* Check if an iterator points to the last element */
@@ -444,7 +446,7 @@ ForeverStack<N>::resolve_segments (
 
 template <Namespace N>
 template <typename S>
-tl::optional<NodeId>
+tl::optional<Rib::Definition>
 ForeverStack<N>::resolve_path (const std::vector<S> &segments)
 {
   // TODO: What to do if segments.empty() ?
@@ -472,8 +474,9 @@ ForeverStack<N>::dfs (ForeverStack<N>::Node &starting_point, NodeId to_find)
   auto values = starting_point.rib.get_values ();
 
   for (auto &kv : values)
-    if (kv.second.id == to_find)
-      return {{starting_point, kv.first}};
+    for (auto id : kv.second.ids)
+      if (id == to_find)
+	return {{starting_point, kv.first}};
 
   for (auto &child : starting_point.children)
     {
@@ -582,7 +585,7 @@ ForeverStack<N>::stream_rib (std::stringstream &stream, const Rib &rib,
   stream << next << "rib: {\n";
 
   for (const auto &kv : rib.get_values ())
-    stream << next_next << kv.first << ": " << kv.second.id << "\n";
+    stream << next_next << kv.first << ": " << kv.second.to_string () << "\n";
 
   stream << next << "},\n";
 }
diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index d8bd9ac524f..5c8d976b417 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -159,7 +159,7 @@ Late::visit (AST::IdentifierExpr &expr)
 {
   // TODO: same thing as visit(PathInExpression) here?
 
-  tl::optional<NodeId> resolved = tl::nullopt;
+  tl::optional<Rib::Definition> resolved = tl::nullopt;
   auto label = ctx.labels.get (expr.get_ident ());
   auto value = ctx.values.get (expr.get_ident ());
 
@@ -179,7 +179,8 @@ Late::visit (AST::IdentifierExpr &expr)
       return;
     }
 
-  ctx.map_usage (Usage (expr.get_node_id ()), Definition (*resolved));
+  ctx.map_usage (Usage (expr.get_node_id ()),
+		 Definition (resolved->get_node_id ()));
 
   // in the old resolver, resolutions are kept in the resolver, not the mappings
   // :/ how do we deal with that?
@@ -200,7 +201,14 @@ Late::visit (AST::PathInExpression &expr)
   if (!value.has_value ())
     rust_unreachable (); // Should have been resolved earlier
 
-  ctx.map_usage (Usage (expr.get_node_id ()), Definition (*value));
+  if (value->is_ambiguous ())
+    {
+      rust_error_at (expr.get_locus (), ErrorCode::E0659, "%qs is ambiguous",
+		     expr.as_string ().c_str ());
+      return;
+    }
+  ctx.map_usage (Usage (expr.get_node_id ()),
+		 Definition (value->get_node_id ()));
 }
 
 void
@@ -213,7 +221,8 @@ Late::visit (AST::TypePath &type)
 
   auto resolved = ctx.types.get (type.get_segments ().back ()->as_string ());
 
-  ctx.map_usage (Usage (type.get_node_id ()), Definition (*resolved));
+  ctx.map_usage (Usage (type.get_node_id ()),
+		 Definition (resolved->get_node_id ()));
 }
 
 } // namespace Resolver2_0
diff --git a/gcc/rust/resolve/rust-rib.cc b/gcc/rust/resolve/rust-rib.cc
index dee3a09ad49..a73e2bd6f75 100644
--- a/gcc/rust/resolve/rust-rib.cc
+++ b/gcc/rust/resolve/rust-rib.cc
@@ -23,9 +23,30 @@ namespace Rust {
 namespace Resolver2_0 {
 
 Rib::Definition::Definition (NodeId id, bool shadowable)
-  : id (id), shadowable (shadowable)
+  : ids ({id}), shadowable (shadowable)
 {}
 
+bool
+Rib::Definition::is_ambiguous () const
+{
+  return shadowable && ids.size () > 1;
+}
+
+std::string
+Rib::Definition::to_string () const
+{
+  std::stringstream out;
+  out << (shadowable ? "(S)" : "(NS)") << "[";
+  std::string sep;
+  for (auto id : ids)
+    {
+      out << sep << id;
+      sep = ",";
+    }
+  out << "]";
+  return out.str ();
+}
+
 Rib::Definition
 Rib::Definition::Shadowable (NodeId id)
 {
@@ -58,28 +79,46 @@ Rib::Rib (Kind kind, std::unordered_map<std::string, NodeId> to_insert)
 tl::expected<NodeId, DuplicateNameError>
 Rib::insert (std::string name, Definition def)
 {
-  auto res = values.insert ({name, def});
-  auto inserted_id = res.first->second.id;
-  auto existed = !res.second;
-
-  // if we couldn't insert, the element already exists - exit with an error,
-  // unless shadowing is allowed
-  if (existed && !def.shadowable)
-    return tl::make_unexpected (DuplicateNameError (name, inserted_id));
-
-  // return the NodeId
-  return inserted_id;
+  auto it = values.find (name);
+  if (it == values.end ())
+    {
+      /* No old value */
+      values[name] = def;
+    }
+  else if (it->second.shadowable && def.shadowable)
+    { /* Both shadowable */
+      auto &current = values[name];
+      for (auto id : def.ids)
+	{
+	  if (std::find (current.ids.cbegin (), current.ids.cend (), id)
+	      == current.ids.cend ())
+	    {
+	      current.ids.push_back (id);
+	    }
+	}
+    }
+  else if (it->second.shadowable)
+    { /* Only old shadowable : replace value */
+      values[name] = def;
+    }
+  else /* Neither are shadowable */
+    {
+      return tl::make_unexpected (
+	DuplicateNameError (name, it->second.ids.back ()));
+    }
+
+  return def.ids.back ();
 }
 
-tl::optional<NodeId>
+tl::optional<Rib::Definition>
 Rib::get (const std::string &name)
 {
   auto it = values.find (name);
 
   if (it == values.end ())
-    return {};
+    return tl::nullopt;
 
-  return it->second.id;
+  return it->second;
 }
 
 const std::unordered_map<std::string, Rib::Definition> &
diff --git a/gcc/rust/resolve/rust-rib.h b/gcc/rust/resolve/rust-rib.h
index 732ad76b805..3db17b4840a 100644
--- a/gcc/rust/resolve/rust-rib.h
+++ b/gcc/rust/resolve/rust-rib.h
@@ -114,9 +114,24 @@ public:
     static Definition NonShadowable (NodeId id);
     static Definition Shadowable (NodeId id);
 
-    NodeId id;
+    std::vector<NodeId> ids;
     bool shadowable;
 
+    Definition () = default;
+
+    Definition &operator= (const Definition &) = default;
+    Definition (Definition const &) = default;
+
+    bool is_ambiguous () const;
+
+    NodeId get_node_id ()
+    {
+      rust_assert (!is_ambiguous ());
+      return ids[0];
+    }
+
+    std::string to_string () const;
+
   private:
     Definition (NodeId id, bool shadowable);
   };
@@ -163,7 +178,7 @@ public:
    *
    * @return tl::nullopt if the key does not exist, the NodeId otherwise
    */
-  tl::optional<NodeId> get (const std::string &name);
+  tl::optional<Rib::Definition> get (const std::string &name);
 
   /* View all the values stored in the rib */
   const std::unordered_map<std::string, Definition> &get_values () const;
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 7f4169a4d8e..6929bdb641e 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -401,7 +401,8 @@ TopLevel::handle_use_glob (AST::SimplePath glob)
   if (!resolved.has_value ())
     return false;
 
-  auto result = Analysis::Mappings::get ()->lookup_ast_module (*resolved);
+  auto result
+    = Analysis::Mappings::get ()->lookup_ast_module (resolved->get_node_id ());
 
   if (!result.has_value ())
     return false;
@@ -428,7 +429,7 @@ TopLevel::handle_use_dec (AST::SimplePath path)
   auto resolve_and_insert
     = [this, &found, &declared_name, locus] (Namespace ns,
 					     const AST::SimplePath &path) {
-	tl::optional<NodeId> resolved = tl::nullopt;
+	tl::optional<Rib::Definition> resolved = tl::nullopt;
 
 	// FIXME: resolve_path needs to return an `expected<NodeId, Error>` so
 	// that we can improve it with hints or location or w/ever. and maybe
@@ -450,22 +451,22 @@ TopLevel::handle_use_dec (AST::SimplePath path)
 	  }
 
 	// FIXME: Ugly
-	(void) resolved.map (
-	  [this, &found, &declared_name, locus, ns, path] (NodeId id) {
-	    found = true;
-
-	    // what do we do with the id?
-	    insert_or_error_out (declared_name, locus, id, ns);
-	    auto result = node_forwarding.find (id);
-	    if (result != node_forwarding.cend ()
-		&& result->second != path.get_node_id ())
-	      rust_error_at (path.get_locus (), "%<%s%> defined multiple times",
-			     declared_name.c_str ());
-	    else // No previous thing has inserted this into our scope
-	      node_forwarding.insert ({id, path.get_node_id ()});
-
-	    return id;
-	  });
+	(void) resolved.map ([this, &found, &declared_name, locus, ns,
+			      path] (Rib::Definition def) {
+	  found = true;
+
+	  // what do we do with the id?
+	  insert_or_error_out (declared_name, locus, def.get_node_id (), ns);
+	  auto result = node_forwarding.find (def.get_node_id ());
+	  if (result != node_forwarding.cend ()
+	      && result->second != path.get_node_id ())
+	    rust_error_at (path.get_locus (), "%<%s%> defined multiple times",
+			   declared_name.c_str ());
+	  else // No previous thing has inserted this into our scope
+	    node_forwarding.insert ({def.get_node_id (), path.get_node_id ()});
+
+	  return def.get_node_id ();
+	});
       };
 
   // do this for all namespaces (even Labels?)
@@ -587,7 +588,9 @@ flatten_glob (const AST::UseTreeGlob &glob, std::vector<AST::SimplePath> &paths,
 
   // (PE): Get path rib
   auto rib = ctx.values.resolve_path (glob.get_path ().get_segments ())
-	       .and_then ([&] (NodeId id) { return ctx.values.to_rib (id); });
+	       .and_then ([&] (Rib::Definition def) {
+		 return ctx.values.to_rib (def.get_node_id ());
+	       });
   if (rib.has_value ())
     {
       auto value = rib.value ().get_values ();
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 079/125] gccrs: Add tuple struct constructor to value namespace
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (76 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 078/125] gccrs: Add support for ambiguous use declarations Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 080/125] gccrs: Change error message to match test Arthur Cohen
                   ` (45 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

A tuple struct constructor should be inserted in the value namespace
during name resolution in order to reject multiple definitions of the
function.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
	the struct constructor to the value namespace.

gcc/testsuite/ChangeLog:

	* rust/compile/name_resolution22.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 3 +++
 gcc/testsuite/rust/compile/name_resolution22.rs     | 5 +++++
 2 files changed, 8 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/name_resolution22.rs

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 6929bdb641e..4134b9a4620 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -337,6 +337,9 @@ TopLevel::visit (AST::TupleStruct &tuple_struct)
 {
   insert_or_error_out (tuple_struct.get_struct_name (), tuple_struct,
 		       Namespace::Types);
+
+  insert_or_error_out (tuple_struct.get_struct_name (), tuple_struct,
+		       Namespace::Values);
 }
 
 void
diff --git a/gcc/testsuite/rust/compile/name_resolution22.rs b/gcc/testsuite/rust/compile/name_resolution22.rs
new file mode 100644
index 00000000000..c49331ef38c
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution22.rs
@@ -0,0 +1,5 @@
+// { dg-options "-frust-name-resolution-2.0" }
+struct Marker;
+struct Foo(Marker);
+
+fn Foo(m: Marker) {} // { dg-error ".Foo. defined multiple times" }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 080/125] gccrs: Change error message to match test
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (77 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 079/125] gccrs: Add tuple struct constructor to value namespace Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 081/125] gccrs: Visit function return type in default resolver Arthur Cohen
                   ` (44 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Error message did not match the test from the previous name resolver when
a given path cannot be resolved.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
	Change error message to match old resolver and test case.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/typecheck/rust-hir-type-check-path.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc
index cdb506dacbe..b0e52c454e9 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-path.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc
@@ -266,8 +266,10 @@ TypeCheckExpr::resolve_root_path (HIR::PathInExpression &expr, size_t *offset,
 	{
 	  if (is_root)
 	    {
-	      rust_error_at (seg.get_locus (),
-			     "failed to resolve root segment");
+	      rust_error_at (expr.get_locus (), ErrorCode::E0425,
+			     "cannot find value %qs in this scope",
+			     expr.as_simple_path ().as_string ().c_str ());
+
 	      return new TyTy::ErrorType (expr.get_mappings ().get_hirid ());
 	    }
 	  return root_tyty;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 081/125] gccrs: Visit function return type in default resolver
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (78 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 080/125] gccrs: Change error message to match test Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 082/125] gccrs: Visit constant item " Arthur Cohen
                   ` (43 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Function return type was not properly visited in the default resolver
visitor pattern.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
	function return type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-default-resolver.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index e2609d13c9a..d805bc9a511 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -79,6 +79,9 @@ DefaultResolver::visit (AST::Function &function)
 	  }
       }
 
+    if (function.has_return_type ())
+      visit (function.get_return_type ());
+
     if (function.has_body ())
       function.get_definition ().value ()->accept_vis (*this);
   };
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 082/125] gccrs: Visit constant item type in default resolver
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (79 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 081/125] gccrs: Visit function return type in default resolver Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 083/125] gccrs: Raw pointer type visitor didn't require overload Arthur Cohen
                   ` (42 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The type of constant item expression was not properly visited in the
default resolver.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
	constant item's types.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-default-resolver.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index d805bc9a511..0c2576f6e75 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -464,7 +464,10 @@ DefaultResolver::visit (AST::EnumItemDiscriminant &item)
 void
 DefaultResolver::visit (AST::ConstantItem &item)
 {
-  auto expr_vis = [this, &item] () { item.get_expr ().accept_vis (*this); };
+  auto expr_vis = [this, &item] () {
+    item.get_expr ().accept_vis (*this);
+    visit (item.get_type ());
+  };
 
   // FIXME: Why do we need a Rib here?
   ctx.scoped (Rib::Kind::Item, item.get_node_id (), expr_vis);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 083/125] gccrs: Raw pointer type visitor didn't require overload
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (80 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 082/125] gccrs: Visit constant item " Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 084/125] gccrs: Values shall be inserted in the value namespace Arthur Cohen
                   ` (41 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

This overload did not dispatch the visitor to sub members of a raw
pointer like the default one. It is therefore useless as pointed type
shall be visited to be resolved correctly.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
	function implementation.
	* resolve/rust-default-resolver.h: Remove function prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-default-resolver.cc | 4 ----
 gcc/rust/resolve/rust-default-resolver.h  | 1 -
 2 files changed, 5 deletions(-)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 0c2576f6e75..f5546181b3c 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -630,10 +630,6 @@ void
 DefaultResolver::visit (AST::TupleType &)
 {}
 
-void
-DefaultResolver::visit (AST::RawPointerType &)
-{}
-
 void
 DefaultResolver::visit (AST::ReferenceType &)
 {}
diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h
index 97ad6d78be3..a19d70bc04d 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -151,7 +151,6 @@ public:
   void visit (AST::ImplTraitTypeOneBound &);
   void visit (AST::TraitObjectTypeOneBound &);
   void visit (AST::TupleType &);
-  void visit (AST::RawPointerType &);
   void visit (AST::ReferenceType &);
   void visit (AST::ArrayType &);
   void visit (AST::SliceType &);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 084/125] gccrs: Values shall be inserted in the value namespace
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (81 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 083/125] gccrs: Raw pointer type visitor didn't require overload Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 085/125] gccrs: Unit struct constructor shall be resolved Arthur Cohen
                   ` (40 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Values were inserted in the label namespace instead of the value
namespace this lead to several bugs.

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change the
	namespace for values from "label" to "values".

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 5c8d976b417..dc7cde1b323 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -151,7 +151,10 @@ Late::visit (AST::IdentifierPattern &identifier)
   // do we insert in labels or in values
   // but values does not allow shadowing... since functions cannot shadow
   // do we insert functions in labels as well?
-  new_label (identifier.get_ident (), identifier.get_node_id ());
+  auto ok
+    = ctx.values.insert (identifier.get_ident (), identifier.get_node_id ());
+
+  rust_assert (ok);
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 085/125] gccrs: Unit struct constructor shall be resolved
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (82 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 084/125] gccrs: Values shall be inserted in the value namespace Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 086/125] gccrs: Add tuple struct to the type namespace Arthur Cohen
                   ` (39 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Unit struct have a special constructor that should be added to the struct
namespace in order to be resolved later when called. As it is a function
it should be added in the value namespace.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
	Add the struct constructor when the struct is a unit.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 4134b9a4620..75d9bb82131 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -68,8 +68,13 @@ void
 GlobbingVisitor::visit (AST::StructStruct &struct_item)
 {
   if (struct_item.get_visibility ().is_public ())
-    ctx.insert_shadowable (struct_item.get_identifier (),
-			   struct_item.get_node_id (), Namespace::Values);
+    {
+      ctx.insert_shadowable (struct_item.get_identifier (),
+			     struct_item.get_node_id (), Namespace::Types);
+      if (struct_item.is_unit_struct ())
+	ctx.insert_shadowable (struct_item.get_identifier (),
+			       struct_item.get_node_id (), Namespace::Values);
+    }
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 086/125] gccrs: Add tuple struct to the type namespace
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (83 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 085/125] gccrs: Unit struct constructor shall be resolved Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 087/125] gccrs: Change enum namespace from value to type Arthur Cohen
                   ` (38 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Only tuple struct constructor was added to the resolver.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
	Add tuple struct type to the resolver's context.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 75d9bb82131..820ba271ae0 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -81,8 +81,13 @@ void
 GlobbingVisitor::visit (AST::TupleStruct &tuple_struct)
 {
   if (tuple_struct.get_visibility ().is_public ())
-    ctx.insert_shadowable (tuple_struct.get_identifier (),
-			   tuple_struct.get_node_id (), Namespace::Values);
+    {
+      ctx.insert_shadowable (tuple_struct.get_identifier (),
+			     tuple_struct.get_node_id (), Namespace::Types);
+
+      ctx.insert_shadowable (tuple_struct.get_identifier (),
+			     tuple_struct.get_node_id (), Namespace::Values);
+    }
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 087/125] gccrs: Change enum namespace from value to type
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (84 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 086/125] gccrs: Add tuple struct to the type namespace Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 088/125] gccrs: Struct are types, not values Arthur Cohen
                   ` (37 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The enum type shall be in type namespace, not value namespace.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::visit):
	Change enum type namespace.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 820ba271ae0..b672d448151 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -95,7 +95,7 @@ GlobbingVisitor::visit (AST::Enum &enum_item)
 {
   if (enum_item.get_visibility ().is_public ())
     ctx.insert_shadowable (enum_item.get_identifier (),
-			   enum_item.get_node_id (), Namespace::Values);
+			   enum_item.get_node_id (), Namespace::Types);
 }
 
 void
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 088/125] gccrs: Struct are types, not values
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (85 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 087/125] gccrs: Change enum namespace from value to type Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 089/125] gccrs: Add constant identifiers to the value namespace Arthur Cohen
                   ` (36 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

We shall search in the right namespace. The correct namespace for struct
is type namespace.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Change
	search location for struct types.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/typecheck/rust-hir-type-check-item.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.cc b/gcc/rust/typecheck/rust-hir-type-check-item.cc
index 4ab946e1c2a..3e504e5df32 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-item.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-item.cc
@@ -279,9 +279,11 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
     {
       auto nr_ctx
 	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
-      auto canonical_path = nr_ctx.values.to_canonical_path (
+      auto canonical_path = nr_ctx.types.to_canonical_path (
 	struct_decl.get_mappings ().get_nodeid ());
 
+      if (!canonical_path.has_value ())
+	rust_unreachable ();
       path = canonical_path.value ();
     }
   else
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 089/125] gccrs: Add constant identifiers to the value namespace
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (86 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 088/125] gccrs: Struct are types, not values Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 090/125] gccrs: Remove extern block scoping Arthur Cohen
                   ` (35 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Constants could not be resolved without their identifier in the right
scope.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
	constant identifiers to the resolver.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index b672d448151..f65ec77331c 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -401,6 +401,9 @@ TopLevel::visit (AST::Union &union_item)
 void
 TopLevel::visit (AST::ConstantItem &const_item)
 {
+  insert_or_error_out (const_item.get_identifier (), const_item,
+		       Namespace::Values);
+
   auto expr_vis
     = [this, &const_item] () { const_item.get_expr ().accept_vis (*this); };
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 090/125] gccrs: Remove extern block scoping
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (87 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 089/125] gccrs: Add constant identifiers to the value namespace Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 091/125] gccrs: Remove unsafe block empty visit function Arthur Cohen
                   ` (34 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Remove extern block scoping visit function, use the default visitor visit
function instead. We do not need scoping for extern block as their
element shall be visible from the extern block scope.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
	visitor implementation and scoping.
	* resolve/rust-default-resolver.h: Remove function prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-default-resolver.cc | 12 ------------
 gcc/rust/resolve/rust-default-resolver.h  |  1 -
 2 files changed, 13 deletions(-)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index f5546181b3c..291731be5b3 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -133,18 +133,6 @@ DefaultResolver::visit (AST::TraitImpl &impl)
   ctx.scoped (Rib::Kind::TraitOrImpl, impl.get_node_id (), inner_fn);
 }
 
-void
-DefaultResolver::visit (AST::ExternBlock &block)
-{
-  auto inner_fn = [this, &block] () {
-    for (auto &item : block.get_extern_items ())
-      item->accept_vis (*this);
-  };
-
-  ctx.scoped (Rib::Kind::Normal /* FIXME: Correct? */, block.get_node_id (),
-	      inner_fn);
-}
-
 void
 DefaultResolver::visit (AST::StructStruct &type)
 {
diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h
index a19d70bc04d..0a6427ca6a6 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -49,7 +49,6 @@ public:
   void visit (AST::Trait &);
   void visit (AST::InherentImpl &);
   void visit (AST::TraitImpl &);
-  void visit (AST::ExternBlock &);
 
   // type dec nodes, which visit their fields or variants by default
   void visit (AST::StructStruct &);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 091/125] gccrs: Remove unsafe block empty visit function
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (88 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 090/125] gccrs: Remove extern block scoping Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 092/125] gccrs: Use new name resolver to compile constant items Arthur Cohen
                   ` (33 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

We need to visit subcomponents in unsafe elements, this means we can
leverage the default ast visitor's code instead of duplicating it.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
	empty visit function.
	* resolve/rust-default-resolver.h: Remove function prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-default-resolver.cc | 4 ----
 gcc/rust/resolve/rust-default-resolver.h  | 1 -
 2 files changed, 5 deletions(-)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 291731be5b3..393994808ee 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -235,10 +235,6 @@ void
 DefaultResolver::visit (AST::ReturnExpr &expr)
 {}
 
-void
-DefaultResolver::visit (AST::UnsafeBlockExpr &expr)
-{}
-
 void
 DefaultResolver::visit (AST::LoopExpr &expr)
 {}
diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h
index 0a6427ca6a6..547b5376bfc 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -66,7 +66,6 @@ public:
   void visit (AST::RangeFromToInclExpr &);
   void visit (AST::RangeToInclExpr &);
   void visit (AST::ReturnExpr &);
-  void visit (AST::UnsafeBlockExpr &);
   void visit (AST::LoopExpr &);
   void visit (AST::WhileLoopExpr &);
   void visit (AST::WhileLetLoopExpr &);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 092/125] gccrs: Use new name resolver to compile constant items
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (89 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 091/125] gccrs: Remove unsafe block empty visit function Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 093/125] gccrs: Reinject Self parameter in new resolver Arthur Cohen
                   ` (32 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Constant items were handled only by the old resolver, this lead to an
ICE when using the new resolver on some rust code containing a constant
item as the new and the old resolver cannot be used at the same time.

gcc/rust/ChangeLog:

	* backend/rust-compile-item.cc (CompileItem::visit): Check the resolver
	flag and use the new one when required.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/backend/rust-compile-item.cc | 36 +++++++++++++++++++--------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/gcc/rust/backend/rust-compile-item.cc b/gcc/rust/backend/rust-compile-item.cc
index 8feed51efa4..609528d8630 100644
--- a/gcc/rust/backend/rust-compile-item.cc
+++ b/gcc/rust/backend/rust-compile-item.cc
@@ -76,32 +76,48 @@ CompileItem::visit (HIR::StaticItem &var)
 void
 CompileItem::visit (HIR::ConstantItem &constant)
 {
-  if (ctx->lookup_const_decl (constant.get_mappings ().get_hirid (),
-			      &reference))
+  auto &mappings = constant.get_mappings ();
+
+  if (ctx->lookup_const_decl (mappings.get_hirid (), &reference))
     return;
 
   // resolve the type
   TyTy::BaseType *resolved_type = nullptr;
+
   bool ok
-    = ctx->get_tyctx ()->lookup_type (constant.get_mappings ().get_hirid (),
-				      &resolved_type);
+    = ctx->get_tyctx ()->lookup_type (mappings.get_hirid (), &resolved_type);
   rust_assert (ok);
 
   // canonical path
-  const Resolver::CanonicalPath *canonical_path = nullptr;
-  ok = ctx->get_mappings ()->lookup_canonical_path (
-    constant.get_mappings ().get_nodeid (), &canonical_path);
-  rust_assert (ok);
+  Resolver::CanonicalPath canonical_path
+    = Resolver::CanonicalPath::create_empty ();
+
+  if (flag_name_resolution_2_0)
+    {
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+      canonical_path
+	= nr_ctx.values.to_canonical_path (mappings.get_nodeid ()).value ();
+    }
+  else
+    {
+      const Resolver::CanonicalPath *canonical_path_ptr = nullptr;
+      ok = ctx->get_mappings ()->lookup_canonical_path (mappings.get_nodeid (),
+							&canonical_path_ptr);
+      rust_assert (ok);
+      canonical_path = *canonical_path_ptr;
+    }
 
   HIR::Expr *const_value_expr = constant.get_expr ().get ();
   ctx->push_const_context ();
   tree const_expr
-    = compile_constant_item (resolved_type, canonical_path, const_value_expr,
+    = compile_constant_item (resolved_type, &canonical_path, const_value_expr,
 			     constant.get_locus ());
   ctx->pop_const_context ();
 
   ctx->push_const (const_expr);
-  ctx->insert_const_decl (constant.get_mappings ().get_hirid (), const_expr);
+  ctx->insert_const_decl (mappings.get_hirid (), const_expr);
   reference = const_expr;
 }
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 093/125] gccrs: Reinject Self parameter in new resolver
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (90 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 092/125] gccrs: Use new name resolver to compile constant items Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 094/125] gccrs: Update assignment operator with cratenum Arthur Cohen
                   ` (31 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

The old resolver injected a Self generic parameter in order to help the
trait solver. This is clearly sketchy at best and should be fixed in
the future.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add
	Self generic parameter injection and a warning.
	* resolve/rust-toplevel-name-resolver-2.0.h: Add function prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../rust-toplevel-name-resolver-2.0.cc        | 23 +++++++++++++++++++
 .../resolve/rust-toplevel-name-resolver-2.0.h |  1 +
 2 files changed, 24 insertions(+)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index f65ec77331c..80b142678b9 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -186,6 +186,29 @@ TopLevel::visit (AST::Module &module)
     Analysis::Mappings::get ()->insert_ast_module (&module);
 }
 
+void
+TopLevel::visit (AST::Trait &trait)
+{
+  // FIXME: This Self injection is dodgy. It even lead to issues with metadata
+  // export in the past (#2349). We cannot tell appart injected parameters from
+  // regular ones. Dumping generic parameters highlights this Self in metadata,
+  // during debug or proc macro collection. This is clearly a hack.
+  //
+  // For now I'll keep it here in the new name resolver even if it should
+  // probably not be there. We need to find another way to solve this.
+  // Maybe an additional attribute to Trait ?
+  //
+  // From old resolver:
+  //// we need to inject an implicit self TypeParam here
+  //// FIXME: which location should be used for Rust::Identifier `Self`?
+  AST::TypeParam *implicit_self
+    = new AST::TypeParam ({"Self"}, trait.get_locus ());
+  trait.insert_implict_self (
+    std::unique_ptr<AST::GenericParam> (implicit_self));
+
+  DefaultResolver::visit (trait);
+}
+
 template <typename PROC_MACRO>
 static void
 insert_macros (std::vector<PROC_MACRO> &macros, NameResolutionContext &ctx)
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
index f5e224fa049..e226c79dfbc 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
@@ -88,6 +88,7 @@ private:
   std::unordered_map<NodeId, NodeId> node_forwarding;
 
   void visit (AST::Module &module) override;
+  void visit (AST::Trait &trait) override;
   void visit (AST::MacroRulesDefinition &macro) override;
   void visit (AST::Function &function) override;
   void visit (AST::BlockExpr &expr) override;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 094/125] gccrs: Update assignment operator with cratenum
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (91 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 093/125] gccrs: Reinject Self parameter in new resolver Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 095/125] gccrs: Prevent getting immutable context with classic nr Arthur Cohen
                   ` (30 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Crate number was not assigned with the other fields in the assignment
operator overload of a CannonicalPath.

gcc/rust/ChangeLog:

	* util/rust-canonical-path.h: Also assign crate number.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/util/rust-canonical-path.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/rust/util/rust-canonical-path.h b/gcc/rust/util/rust-canonical-path.h
index f2865eba9ae..969ac7f7cc1 100644
--- a/gcc/rust/util/rust-canonical-path.h
+++ b/gcc/rust/util/rust-canonical-path.h
@@ -51,6 +51,7 @@ public:
   CanonicalPath &operator= (const CanonicalPath &other)
   {
     segs = other.segs;
+    crate_num = other.crate_num;
     return *this;
   }
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 095/125] gccrs: Prevent getting immutable context with classic nr
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (92 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 094/125] gccrs: Update assignment operator with cratenum Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 096/125] gccrs: Fix quoted string format Arthur Cohen
                   ` (29 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Immutable name resolution context is not initialized when the classic
name resolution is in use. It can therefore not be used, the getter would
error out.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
	Only get immutable name resolution context when name resolution 2.0 is
	used.
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
	Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/typecheck/rust-hir-type-check-path.cc | 14 ++++++++------
 gcc/rust/typecheck/rust-hir-type-check-type.cc | 17 +++++++++--------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc
index b0e52c454e9..dd6ab03a362 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-path.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc
@@ -199,16 +199,18 @@ TypeCheckExpr::resolve_root_path (HIR::PathInExpression &expr, size_t *offset,
       bool is_root = *offset == 0;
       NodeId ast_node_id = seg.get_mappings ().get_nodeid ();
 
-      auto nr_ctx
-	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
-
       // then lookup the reference_node_id
       NodeId ref_node_id = UNKNOWN_NODEID;
 
       if (flag_name_resolution_2_0)
-	// assign the ref_node_id if we've found something
-	nr_ctx.lookup (expr.get_mappings ().get_nodeid ())
-	  .map ([&ref_node_id] (NodeId resolved) { ref_node_id = resolved; });
+	{
+	  auto nr_ctx
+	    = Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+	  // assign the ref_node_id if we've found something
+	  nr_ctx.lookup (expr.get_mappings ().get_nodeid ())
+	    .map ([&ref_node_id] (NodeId resolved) { ref_node_id = resolved; });
+	}
       else if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
 	resolver->lookup_resolved_type (ast_node_id, &ref_node_id);
 
diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc
index 588e5bce88e..44ebc159b23 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-type.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc
@@ -341,19 +341,20 @@ TypeCheckType::resolve_root_path (HIR::TypePath &path, size_t *offset,
       bool is_root = *offset == 0;
       NodeId ast_node_id = seg->get_mappings ().get_nodeid ();
 
-      auto nr_ctx
-	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
-
       // then lookup the reference_node_id
       NodeId ref_node_id = UNKNOWN_NODEID;
 
       // FIXME: HACK: ARTHUR: Remove this
       if (flag_name_resolution_2_0)
-	// assign the ref_node_id if we've found something
-	nr_ctx.lookup (path.get_mappings ().get_nodeid ())
-	  .map ([&ref_node_id, &path] (NodeId resolved) {
-	    ref_node_id = resolved;
-	  });
+	{
+	  auto nr_ctx
+	    = Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+	  // assign the ref_node_id if we've found something
+	  nr_ctx.lookup (path.get_mappings ().get_nodeid ())
+	    .map ([&ref_node_id, &path] (NodeId resolved) {
+	      ref_node_id = resolved;
+	    });
+	}
       else if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
 	resolver->lookup_resolved_type (ast_node_id, &ref_node_id);
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 096/125] gccrs: Fix quoted string format
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (93 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 095/125] gccrs: Prevent getting immutable context with classic nr Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 097/125] gccrs: Add mappings for struct base and struct fields Arthur Cohen
                   ` (28 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

This format dialog triggered a warning.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec):
	Replace the string format %<%s%> with the proper %qs format.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 80b142678b9..e6da8db850c 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -499,7 +499,7 @@ TopLevel::handle_use_dec (AST::SimplePath path)
 	  auto result = node_forwarding.find (def.get_node_id ());
 	  if (result != node_forwarding.cend ()
 	      && result->second != path.get_node_id ())
-	    rust_error_at (path.get_locus (), "%<%s%> defined multiple times",
+	    rust_error_at (path.get_locus (), "%qs defined multiple times",
 			   declared_name.c_str ());
 	  else // No previous thing has inserted this into our scope
 	    node_forwarding.insert ({def.get_node_id (), path.get_node_id ()});
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 097/125] gccrs: Add mappings for struct base and struct fields
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (94 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 096/125] gccrs: Fix quoted string format Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 098/125] gccrs: Fix use rebind name resolution Arthur Cohen
                   ` (27 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Definition/usage mapping during name resolution was missing.

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add mapping
	implementation.
	* resolve/rust-late-name-resolver-2.0.h: Add function visitor prototype
	override.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../resolve/rust-late-name-resolver-2.0.cc    | 21 +++++++++++++++++++
 .../resolve/rust-late-name-resolver-2.0.h     |  2 ++
 2 files changed, 23 insertions(+)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index dc7cde1b323..f580c23377b 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -228,5 +228,26 @@ Late::visit (AST::TypePath &type)
 		 Definition (resolved->get_node_id ()));
 }
 
+void
+Late::visit (AST::StructExprStructBase &s)
+{
+  auto resolved = ctx.types.get (s.get_struct_name ().as_string ());
+
+  ctx.map_usage (Usage (s.get_struct_name ().get_node_id ()),
+		 Definition (resolved->get_node_id ()));
+  DefaultResolver::visit (s);
+}
+
+void
+Late::visit (AST::StructExprStructFields &s)
+{
+  auto resolved = ctx.types.get (s.get_struct_name ().as_string ());
+
+  ctx.map_usage (Usage (s.get_struct_name ().get_node_id ()),
+		 Definition (resolved->get_node_id ()));
+
+  DefaultResolver::visit (s);
+}
+
 } // namespace Resolver2_0
 } // namespace Rust
diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.h b/gcc/rust/resolve/rust-late-name-resolver-2.0.h
index 3a8a0060f5a..ee712b305d4 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.h
@@ -46,6 +46,8 @@ public:
   void visit (AST::IdentifierExpr &) override;
   void visit (AST::PathInExpression &) override;
   void visit (AST::TypePath &) override;
+  void visit (AST::StructExprStructBase &) override;
+  void visit (AST::StructExprStructFields &) override;
 
 private:
   /* Setup Rust's builtin types (u8, i32, !...) in the resolver */
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 098/125] gccrs: Fix use rebind name resolution.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (95 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 097/125] gccrs: Add mappings for struct base and struct fields Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 099/125] gccrs: compile: resolve-path-ref: properly resolve nodeId with nr2.0 Arthur Cohen
                   ` (26 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Name resolution for rebind were missing.

gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob):
	Change function prototype to use a reference instead.
	(TopLevel::handle_use_dec): Likewise.
	(TopLevel::handle_rebind): Add name resolution on rebind use
	declarations.
	(flatten_rebind): Change prototype to accept a pair of path/alias.
	(flatten_list): Adapt call to flatten_rebind.
	(flatten): Adapt call to flatten_rebind.
	(flatten_glob): Remove unused part.
	(TopLevel::visit): Add rebind resolution.
	* resolve/rust-toplevel-name-resolver-2.0.h: Adapt function prototypes.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../rust-toplevel-name-resolver-2.0.cc        | 194 +++++++++++++-----
 .../resolve/rust-toplevel-name-resolver-2.0.h |   5 +-
 2 files changed, 151 insertions(+), 48 deletions(-)

diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index e6da8db850c..4593c67c5d3 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -17,6 +17,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-toplevel-name-resolver-2.0.h"
+#include "input.h"
 #include "optional.h"
 #include "rust-ast-full.h"
 #include "rust-hir-map.h"
@@ -434,7 +435,7 @@ TopLevel::visit (AST::ConstantItem &const_item)
 }
 
 bool
-TopLevel::handle_use_glob (AST::SimplePath glob)
+TopLevel::handle_use_glob (AST::SimplePath &glob)
 {
   auto resolved = ctx.types.resolve_path (glob.get_segments ());
   if (!resolved.has_value ())
@@ -453,7 +454,7 @@ TopLevel::handle_use_glob (AST::SimplePath glob)
 }
 
 bool
-TopLevel::handle_use_dec (AST::SimplePath path)
+TopLevel::handle_use_dec (AST::SimplePath &path)
 {
   auto locus = path.get_final_segment ().get_locus ();
   auto declared_name = path.get_final_segment ().as_string ();
@@ -508,6 +509,97 @@ TopLevel::handle_use_dec (AST::SimplePath path)
 	});
       };
 
+  resolve_and_insert (Namespace::Values, path);
+  resolve_and_insert (Namespace::Types, path);
+  resolve_and_insert (Namespace::Macros, path);
+
+  return found;
+}
+
+bool
+TopLevel::handle_rebind (std::pair<AST::SimplePath, AST::UseTreeRebind> &rebind)
+{
+  auto &path = rebind.first;
+
+  location_t locus = UNKNOWN_LOCATION;
+  std::string declared_name;
+
+  switch (rebind.second.get_new_bind_type ())
+    {
+    case AST::UseTreeRebind::NewBindType::IDENTIFIER:
+      declared_name = rebind.second.get_identifier ().as_string ();
+      locus = rebind.second.get_identifier ().get_locus ();
+      break;
+    case AST::UseTreeRebind::NewBindType::NONE:
+      declared_name = path.get_final_segment ().as_string ();
+      locus = path.get_final_segment ().get_locus ();
+      break;
+    case AST::UseTreeRebind::NewBindType::WILDCARD:
+      rust_unreachable ();
+      break;
+    }
+
+  // in what namespace do we perform path resolution? All
+  // of them? see which one matches? Error out on
+  // ambiguities? so, apparently, for each one that
+  // matches, add it to the proper namespace
+  // :(
+  auto found = false;
+
+  auto resolve_and_insert = [this, &found, &declared_name,
+			     locus] (Namespace ns,
+				     const AST::SimplePath &path) {
+    tl::optional<Rib::Definition> resolved = tl::nullopt;
+    tl::optional<Rib::Definition> resolved_bind = tl::nullopt;
+
+    std::vector<AST::SimplePathSegment> declaration_v
+      = {AST::SimplePathSegment (declared_name, locus)};
+    // FIXME: resolve_path needs to return an `expected<NodeId, Error>` so
+    // that we can improve it with hints or location or w/ever. and maybe
+    // only emit it the first time.
+    switch (ns)
+      {
+      case Namespace::Values:
+	resolved = ctx.values.resolve_path (path.get_segments ());
+	resolved_bind = ctx.values.resolve_path (declaration_v);
+	break;
+      case Namespace::Types:
+	resolved = ctx.types.resolve_path (path.get_segments ());
+	resolved_bind = ctx.types.resolve_path (declaration_v);
+	break;
+      case Namespace::Macros:
+	resolved = ctx.macros.resolve_path (path.get_segments ());
+	resolved_bind = ctx.macros.resolve_path (declaration_v);
+	break;
+      case Namespace::Labels:
+	// TODO: Is that okay?
+	rust_unreachable ();
+      }
+
+    resolved.map ([this, &found, &declared_name, locus, ns, path,
+		   &resolved_bind] (Rib::Definition def) {
+      found = true;
+
+      insert_or_error_out (declared_name, locus, def.get_node_id (), ns);
+      if (resolved_bind.has_value ())
+	{
+	  auto bind_def = resolved_bind.value ();
+	  // what do we do with the id?
+	  auto result = node_forwarding.find (bind_def.get_node_id ());
+	  if (result != node_forwarding.cend ()
+	      && result->second != path.get_node_id ())
+	    rust_error_at (path.get_locus (), "%qs defined multiple times",
+			   declared_name.c_str ());
+	}
+      else
+	{
+	  // No previous thing has inserted this into our scope
+	  node_forwarding.insert ({def.get_node_id (), path.get_node_id ()});
+	}
+      return def.get_node_id ();
+    });
+  };
+
   // do this for all namespaces (even Labels?)
 
   resolve_and_insert (Namespace::Values, path);
@@ -520,31 +612,38 @@ TopLevel::handle_use_dec (AST::SimplePath path)
 }
 
 static void
-flatten_rebind (const AST::UseTreeRebind &glob,
-		std::vector<AST::SimplePath> &paths);
+flatten_rebind (
+  const AST::UseTreeRebind &glob,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> &rebind_paths);
+
 static void
-flatten_list (const AST::UseTreeList &glob, std::vector<AST::SimplePath> &paths,
-	      std::vector<AST::SimplePath> &glob_paths,
-	      NameResolutionContext &ctx);
+flatten_list (
+  const AST::UseTreeList &glob, std::vector<AST::SimplePath> &paths,
+  std::vector<AST::SimplePath> &glob_paths,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> &rebind_paths,
+  NameResolutionContext &ctx);
 static void
 flatten_glob (const AST::UseTreeGlob &glob,
 	      std::vector<AST::SimplePath> &glob_paths,
 	      NameResolutionContext &ctx);
 
 static void
-flatten (const AST::UseTree *tree, std::vector<AST::SimplePath> &paths,
-	 std::vector<AST::SimplePath> &glob_paths, NameResolutionContext &ctx)
+flatten (
+  const AST::UseTree *tree, std::vector<AST::SimplePath> &paths,
+  std::vector<AST::SimplePath> &glob_paths,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> &rebind_paths,
+  NameResolutionContext &ctx)
 {
   switch (tree->get_kind ())
     {
       case AST::UseTree::Rebind: {
 	auto rebind = static_cast<const AST::UseTreeRebind *> (tree);
-	flatten_rebind (*rebind, paths);
+	flatten_rebind (*rebind, rebind_paths);
 	break;
       }
       case AST::UseTree::List: {
 	auto list = static_cast<const AST::UseTreeList *> (tree);
-	flatten_list (*list, paths, glob_paths, ctx);
+	flatten_list (*list, paths, glob_paths, rebind_paths, ctx);
 	break;
       }
       case AST::UseTree::Glob: {
@@ -557,27 +656,11 @@ flatten (const AST::UseTree *tree, std::vector<AST::SimplePath> &paths,
 }
 
 static void
-flatten_rebind (const AST::UseTreeRebind &rebind,
-		std::vector<AST::SimplePath> &paths)
+flatten_rebind (
+  const AST::UseTreeRebind &rebind,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> &rebind_paths)
 {
-  auto path = rebind.get_path ();
-
-  // FIXME: Do we want to emplace the rebind here as well?
-  if (rebind.has_identifier ())
-    {
-      auto rebind_path = path;
-      auto new_seg = rebind.get_identifier ();
-
-      // Add the identifier as a new path
-      rebind_path.get_segments ().back ()
-	= AST::SimplePathSegment (new_seg.as_string (), UNDEF_LOCATION);
-
-      paths.emplace_back (rebind_path);
-    }
-  else
-    {
-      paths.emplace_back (path);
-    }
+  rebind_paths.emplace_back (rebind.get_path (), rebind);
 }
 
 /** Prefix a list of subpath
@@ -599,9 +682,27 @@ prefix_subpaths (AST::SimplePath prefix, std::vector<AST::SimplePath> subs,
 }
 
 static void
-flatten_list (const AST::UseTreeList &list, std::vector<AST::SimplePath> &paths,
-	      std::vector<AST::SimplePath> &glob_paths,
-	      NameResolutionContext &ctx)
+prefix_rebinds (
+  AST::SimplePath prefix,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> subs,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> &results)
+{
+  for (auto &sub : subs)
+    {
+      auto new_path = prefix;
+      std::copy (sub.first.get_segments ().begin (),
+		 sub.first.get_segments ().end (),
+		 std::back_inserter (new_path.get_segments ()));
+      results.emplace_back (std::make_pair (new_path, sub.second));
+    }
+}
+
+static void
+flatten_list (
+  const AST::UseTreeList &list, std::vector<AST::SimplePath> &paths,
+  std::vector<AST::SimplePath> &glob_paths,
+  std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> &rebind_paths,
+  NameResolutionContext &ctx)
 {
   auto prefix = AST::SimplePath::create_empty ();
   if (list.has_path ())
@@ -611,10 +712,13 @@ flatten_list (const AST::UseTreeList &list, std::vector<AST::SimplePath> &paths,
     {
       auto sub_paths = std::vector<AST::SimplePath> ();
       auto sub_globs = std::vector<AST::SimplePath> ();
-      flatten (tree.get (), sub_paths, sub_globs, ctx);
+      auto sub_rebinds
+	= std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> ();
+      flatten (tree.get (), sub_paths, sub_globs, sub_rebinds, ctx);
 
       prefix_subpaths (prefix, sub_paths, paths);
       prefix_subpaths (prefix, sub_globs, glob_paths);
+      prefix_rebinds (prefix, sub_rebinds, rebind_paths);
     }
 }
 
@@ -624,16 +728,6 @@ flatten_glob (const AST::UseTreeGlob &glob, std::vector<AST::SimplePath> &paths,
 {
   if (glob.has_path ())
     paths.emplace_back (glob.get_path ());
-
-  // (PE): Get path rib
-  auto rib = ctx.values.resolve_path (glob.get_path ().get_segments ())
-	       .and_then ([&] (Rib::Definition def) {
-		 return ctx.values.to_rib (def.get_node_id ());
-	       });
-  if (rib.has_value ())
-    {
-      auto value = rib.value ().get_values ();
-    }
 }
 
 void
@@ -641,13 +735,15 @@ TopLevel::visit (AST::UseDeclaration &use)
 {
   auto paths = std::vector<AST::SimplePath> ();
   auto glob_path = std::vector<AST::SimplePath> ();
+  auto rebind_path
+    = std::vector<std::pair<AST::SimplePath, AST::UseTreeRebind>> ();
 
   // FIXME: How do we handle `use foo::{self}` imports? Some beforehand cleanup?
   // How do we handle module imports in general? Should they get added to all
   // namespaces?
 
   const auto &tree = use.get_tree ();
-  flatten (tree.get (), paths, glob_path, this->ctx);
+  flatten (tree.get (), paths, glob_path, rebind_path, this->ctx);
 
   for (auto &path : paths)
     if (!handle_use_dec (path))
@@ -658,6 +754,12 @@ TopLevel::visit (AST::UseDeclaration &use)
     if (!handle_use_glob (glob))
       rust_error_at (glob.get_final_segment ().get_locus (), ErrorCode::E0433,
 		     "unresolved import %qs", glob.as_string ().c_str ());
+
+  for (auto &rebind : rebind_path)
+    if (!handle_rebind (rebind))
+      rust_error_at (rebind.first.get_final_segment ().get_locus (),
+		     ErrorCode::E0433, "unresolved import %qs",
+		     rebind.first.as_string ().c_str ());
 }
 
 } // namespace Resolver2_0
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
index e226c79dfbc..fb16866aeb1 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
@@ -108,8 +108,9 @@ private:
   // Call this on all the paths of a UseDec - so each flattened path in a
   // UseTreeList for example
   // FIXME: Should that return `found`?
-  bool handle_use_dec (AST::SimplePath path);
-  bool handle_use_glob (AST::SimplePath glob);
+  bool handle_use_dec (AST::SimplePath &path);
+  bool handle_use_glob (AST::SimplePath &glob);
+  bool handle_rebind (std::pair<AST::SimplePath, AST::UseTreeRebind> &pair);
 
   void visit (AST::UseDeclaration &use) override;
 };
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 099/125] gccrs: compile: resolve-path-ref: properly resolve nodeId with nr2.0
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (96 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 098/125] gccrs: Fix use rebind name resolution Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 100/125] gccrs: nr2.0: Add new test cases Arthur Cohen
                   ` (25 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc: Attempt to resolve names
	also using new name resolution context.
	* backend/rust-compile-resolve-path.h: Add new declaration.
---
 gcc/rust/backend/rust-compile-resolve-path.cc | 112 +++++++++++-------
 gcc/rust/backend/rust-compile-resolve-path.h  |   6 +
 2 files changed, 74 insertions(+), 44 deletions(-)

diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index 366de59865e..3bb45a53750 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -17,14 +17,17 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-compile-resolve-path.h"
+#include "options.h"
 #include "rust-compile-intrinsic.h"
 #include "rust-compile-item.h"
 #include "rust-compile-implitem.h"
 #include "rust-compile-expr.h"
+#include "rust-hir-map.h"
 #include "rust-hir-trait-resolve.h"
 #include "rust-hir-path-probe.h"
 #include "rust-compile-extern.h"
 #include "rust-constexpr.h"
+#include "rust-tyty.h"
 
 namespace Rust {
 namespace Compile {
@@ -43,6 +46,50 @@ ResolvePathRef::visit (HIR::PathInExpression &expr)
 		      expr.get_mappings (), expr.get_locus (), false);
 }
 
+tree
+ResolvePathRef::attempt_constructor_expression_lookup (
+  TyTy::BaseType *lookup, Context *ctx, const Analysis::NodeMapping &mappings,
+  location_t expr_locus)
+{
+  // it might be an enum data-less enum variant
+  if (lookup->get_kind () != TyTy::TypeKind::ADT)
+    return error_mark_node;
+
+  TyTy::ADTType *adt = static_cast<TyTy::ADTType *> (lookup);
+  if (adt->is_unit ())
+    return unit_expression (ctx, expr_locus);
+
+  if (!adt->is_enum ())
+    return error_mark_node;
+
+  HirId variant_id;
+  if (!ctx->get_tyctx ()->lookup_variant_definition (mappings.get_hirid (),
+						     &variant_id))
+    return error_mark_node;
+
+  int union_disriminator = -1;
+  TyTy::VariantDef *variant = nullptr;
+  if (!adt->lookup_variant_by_id (variant_id, &variant, &union_disriminator))
+    return error_mark_node;
+
+  // this can only be for discriminant variants the others are built up
+  // using call-expr or struct-init
+  rust_assert (variant->get_variant_type ()
+	       == TyTy::VariantDef::VariantType::NUM);
+
+  // we need the actual gcc type
+  tree compiled_adt_type = TyTyResolveCompile::compile (ctx, adt);
+
+  // make the ctor for the union
+  HIR::Expr *discrim_expr = variant->get_discriminant ();
+  tree discrim_expr_node = CompileExpr::Compile (discrim_expr, ctx);
+  tree folded_discrim_expr = fold_expr (discrim_expr_node);
+  tree qualifier = folded_discrim_expr;
+
+  return Backend::constructor_expression (compiled_adt_type, true, {qualifier},
+					  union_disriminator, expr_locus);
+}
+
 tree
 ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment,
 			 const Analysis::NodeMapping &mappings,
@@ -53,52 +100,29 @@ ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment,
   rust_assert (ok);
 
   // need to look up the reference for this identifier
+
+  // this can fail because it might be a Constructor for something
+  // in that case the caller should attempt ResolvePathType::Compile
   NodeId ref_node_id = UNKNOWN_NODEID;
-  if (!ctx->get_resolver ()->lookup_resolved_name (mappings.get_nodeid (),
-						   &ref_node_id))
+  if (flag_name_resolution_2_0)
+    {
+      auto nr_ctx
+	= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+      auto resolved = nr_ctx.lookup (mappings.get_nodeid ());
+
+      if (!resolved)
+	return attempt_constructor_expression_lookup (lookup, ctx, mappings,
+						      expr_locus);
+
+      ref_node_id = *resolved;
+    }
+  else
     {
-      // this can fail because it might be a Constructor for something
-      // in that case the caller should attempt ResolvePathType::Compile
-
-      // it might be an enum data-less enum variant
-      if (lookup->get_kind () != TyTy::TypeKind::ADT)
-	return error_mark_node;
-
-      TyTy::ADTType *adt = static_cast<TyTy::ADTType *> (lookup);
-      if (adt->is_unit ())
-	return unit_expression (ctx, expr_locus);
-
-      if (!adt->is_enum ())
-	return error_mark_node;
-
-      HirId variant_id;
-      if (!ctx->get_tyctx ()->lookup_variant_definition (mappings.get_hirid (),
-							 &variant_id))
-	return error_mark_node;
-
-      int union_disriminator = -1;
-      TyTy::VariantDef *variant = nullptr;
-      if (!adt->lookup_variant_by_id (variant_id, &variant,
-				      &union_disriminator))
-	return error_mark_node;
-
-      // this can only be for discriminant variants the others are built up
-      // using call-expr or struct-init
-      rust_assert (variant->get_variant_type ()
-		   == TyTy::VariantDef::VariantType::NUM);
-
-      // we need the actual gcc type
-      tree compiled_adt_type = TyTyResolveCompile::compile (ctx, adt);
-
-      // make the ctor for the union
-      HIR::Expr *discrim_expr = variant->get_discriminant ();
-      tree discrim_expr_node = CompileExpr::Compile (discrim_expr, ctx);
-      tree folded_discrim_expr = fold_expr (discrim_expr_node);
-      tree qualifier = folded_discrim_expr;
-
-      return Backend::constructor_expression (compiled_adt_type, true,
-					      {qualifier}, union_disriminator,
-					      expr_locus);
+      if (!ctx->get_resolver ()->lookup_resolved_name (mappings.get_nodeid (),
+						       &ref_node_id))
+	return attempt_constructor_expression_lookup (lookup, ctx, mappings,
+						      expr_locus);
     }
 
   HirId ref;
diff --git a/gcc/rust/backend/rust-compile-resolve-path.h b/gcc/rust/backend/rust-compile-resolve-path.h
index ce559fc9bde..a920fccaef3 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.h
+++ b/gcc/rust/backend/rust-compile-resolve-path.h
@@ -66,6 +66,12 @@ public:
 		bool is_qualified_path);
 
   tree resolved;
+
+private:
+  tree
+  attempt_constructor_expression_lookup (TyTy::BaseType *lookup, Context *ctx,
+					 const Analysis::NodeMapping &mappings,
+					 location_t expr_locus);
 };
 
 } // namespace Compile
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 100/125] gccrs: nr2.0: Add new test cases.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (97 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 099/125] gccrs: compile: resolve-path-ref: properly resolve nodeId with nr2.0 Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 101/125] gccrs: Add globbing name resolution 2.0 test Arthur Cohen
                   ` (24 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

gcc/testsuite/ChangeLog:

	* rust/compile/name_resolution13.rs: Add new module and remove compile
	step.
	* rust/compile/name_resolution14.rs: New test.
	* rust/compile/name_resolution15.rs: New test.
	* rust/compile/name_resolution16.rs: New test.
	* rust/compile/name_resolution17.rs: New test.
	* rust/compile/name_resolution18.rs: New test.
	* rust/compile/name_resolution19.rs: New test.
	* rust/compile/name_resolution20.rs: New test.
	* rust/compile/name_resolution21.rs: New test.
---
 .../rust/compile/name_resolution13.rs         |  6 +++++-
 .../rust/compile/name_resolution14.rs         | 15 ++++++++++++++
 .../rust/compile/name_resolution15.rs         | 20 +++++++++++++++++++
 .../rust/compile/name_resolution16.rs         | 18 +++++++++++++++++
 .../rust/compile/name_resolution17.rs         | 10 ++++++++++
 .../rust/compile/name_resolution18.rs         | 15 ++++++++++++++
 .../rust/compile/name_resolution19.rs         | 20 +++++++++++++++++++
 .../rust/compile/name_resolution20.rs         | 11 ++++++++++
 .../rust/compile/name_resolution21.rs         | 12 +++++++++++
 9 files changed, 126 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/rust/compile/name_resolution14.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution15.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution16.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution17.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution18.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution19.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution20.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution21.rs

diff --git a/gcc/testsuite/rust/compile/name_resolution13.rs b/gcc/testsuite/rust/compile/name_resolution13.rs
index 52a152bf51a..33edbf9312e 100644
--- a/gcc/testsuite/rust/compile/name_resolution13.rs
+++ b/gcc/testsuite/rust/compile/name_resolution13.rs
@@ -1,4 +1,8 @@
-// { dg-additional-options "-frust-name-resolution-2.0 -frust-compile-until=lowering" }
+// { dg-options "-frust-name-resolution-2.0" }
+
+pub mod foo {
+    pub macro bar() {}
+}
 
 fn foo() {
     let b = 10;
diff --git a/gcc/testsuite/rust/compile/name_resolution14.rs b/gcc/testsuite/rust/compile/name_resolution14.rs
new file mode 100644
index 00000000000..eaef6a52f16
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution14.rs
@@ -0,0 +1,15 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+pub mod foo {
+    pub macro bar() {}
+}
+
+use foo::biz; // { dg-error "unresolved import .foo::biz. .E0433." }
+
+use foo::{bar, baz, biz};
+// { dg-error "unresolved import .foo::baz. .E0433." "" { target *-*-* } .-1 }
+// { dg-error "unresolved import .foo::biz. .E0433." "" { target *-*-* } .-2 }
+
+fn main() {
+    bar!();
+}
diff --git a/gcc/testsuite/rust/compile/name_resolution15.rs b/gcc/testsuite/rust/compile/name_resolution15.rs
new file mode 100644
index 00000000000..45f38da768a
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution15.rs
@@ -0,0 +1,20 @@
+// { dg-additional-options "-frust-name-resolution-2.0" }
+#![feature(decl_macro)]
+
+pub mod foo {
+    pub struct Foo {
+        pub a: i32,
+    }
+    pub fn Foo() {}
+    pub macro Foo() {{}}
+}
+
+pub use foo::Foo;
+
+use self::Foo as Fo;
+
+fn main() {
+    let _a = Fo();
+    let _b = Fo { a: 15 };
+    let _c = Fo!();
+}
diff --git a/gcc/testsuite/rust/compile/name_resolution16.rs b/gcc/testsuite/rust/compile/name_resolution16.rs
new file mode 100644
index 00000000000..230722ef819
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution16.rs
@@ -0,0 +1,18 @@
+// { dg-additional-options "-frust-name-resolution-2.0" }
+#![feature(decl_macro)]
+
+pub mod foo {
+    pub struct Foo {
+        pub a: i32,
+    }
+    pub fn Foo() {}
+    pub macro Foo() {{}}
+}
+
+pub use foo::Foo;
+
+fn main() {
+    let _a = Foo();
+    let _b = Foo { a: 15 };
+    let _c = Foo!();
+}
diff --git a/gcc/testsuite/rust/compile/name_resolution17.rs b/gcc/testsuite/rust/compile/name_resolution17.rs
new file mode 100644
index 00000000000..485947647a9
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution17.rs
@@ -0,0 +1,10 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+struct Foo;
+fn Foo() {} // { dg-error ".Foo. defined multiple times" }
+
+struct Marker;
+struct Bar {
+    a: Marker,
+}
+fn Bar() {} // ok, since `Bar` is not a value here
diff --git a/gcc/testsuite/rust/compile/name_resolution18.rs b/gcc/testsuite/rust/compile/name_resolution18.rs
new file mode 100644
index 00000000000..5940149d3bb
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution18.rs
@@ -0,0 +1,15 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+struct Marker;
+
+struct Foo {
+    a: Marker,
+}
+
+pub mod foo {
+    struct Foo {
+        b: Marker,
+    }
+}
+
+use foo::Foo; // { dg-error ".Foo. defined multiple times" }
diff --git a/gcc/testsuite/rust/compile/name_resolution19.rs b/gcc/testsuite/rust/compile/name_resolution19.rs
new file mode 100644
index 00000000000..9a2c84375c7
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution19.rs
@@ -0,0 +1,20 @@
+struct Marker;
+
+fn foo(a: Marker, b: Marker) -> Marker {
+    let a = b;
+
+    a
+}
+
+fn bar() {
+    let a = 15;
+
+    fn inner() {
+        // inner functions cannot capture dynamic environment
+        let b = a; // { dg-error "cannot find value .a. in this scope" }
+    }
+}
+
+fn main() {
+    let m = foo(Marker, Marker);
+}
diff --git a/gcc/testsuite/rust/compile/name_resolution20.rs b/gcc/testsuite/rust/compile/name_resolution20.rs
new file mode 100644
index 00000000000..e6c2dd5ea8f
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution20.rs
@@ -0,0 +1,11 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+pub mod foo {
+    pub macro bar() {}
+}
+
+use foo::bar;
+
+fn main() {
+    bar!();
+}
diff --git a/gcc/testsuite/rust/compile/name_resolution21.rs b/gcc/testsuite/rust/compile/name_resolution21.rs
new file mode 100644
index 00000000000..3d0af2b37b7
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution21.rs
@@ -0,0 +1,12 @@
+// { dg-additional-options "-frust-name-resolution-2.0" }
+
+pub mod foo {
+    pub macro bar() {}
+}
+
+use foo::bar;
+use foo::bar; // { dg-error ".bar. defined multiple times" }
+
+fn main() {
+    bar!();
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 101/125] gccrs: Add globbing name resolution 2.0 test
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (98 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 100/125] gccrs: nr2.0: Add new test cases Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 102/125] gccrs: Change dfs function return type to support gcc 4.8 Arthur Cohen
                   ` (23 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Add a few test for globbing to highlight function call ambiguities.

gcc/testsuite/ChangeLog:

	* rust/compile/name_resolution23.rs: New test.
	* rust/compile/name_resolution24.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 .../rust/compile/name_resolution23.rs         | 19 +++++++++++++++++++
 .../rust/compile/name_resolution24.rs         | 15 +++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/name_resolution23.rs
 create mode 100644 gcc/testsuite/rust/compile/name_resolution24.rs

diff --git a/gcc/testsuite/rust/compile/name_resolution23.rs b/gcc/testsuite/rust/compile/name_resolution23.rs
new file mode 100644
index 00000000000..50b8e811152
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution23.rs
@@ -0,0 +1,19 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+mod a {
+    pub mod b {
+        pub fn foo() {}
+        pub fn bar() {}
+        pub fn baz() {}
+    }
+    pub fn baz() {}
+}
+
+use a::b::*;
+use a::baz;
+
+pub fn func() {
+    baz();
+    foo();
+    bar();
+}
diff --git a/gcc/testsuite/rust/compile/name_resolution24.rs b/gcc/testsuite/rust/compile/name_resolution24.rs
new file mode 100644
index 00000000000..f4eb7b2d38f
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution24.rs
@@ -0,0 +1,15 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+mod a {
+    pub mod b {
+        pub fn baz() {}
+    }
+    pub fn baz() {}
+}
+
+use a::b::*;
+use a::*;
+
+pub fn func() {
+    baz(); // { dg-error ".baz. is ambiguous .E0659." }
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 102/125] gccrs: Change dfs function return type to support gcc 4.8
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (99 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 101/125] gccrs: Add globbing name resolution 2.0 test Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 103/125] gccrs: Improve parsing of raw byte string literals Arthur Cohen
                   ` (22 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

GCC 4.8 does not handle pair with references correctly. We need to use a
properly typed struct instead.

gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: Change dfs function prototype and
	declare dfs return type structure.
	* resolve/rust-forever-stack.hxx: Adapt dfs function to the new return
	type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-forever-stack.h   | 8 ++++++--
 gcc/rust/resolve/rust-forever-stack.hxx | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/resolve/rust-forever-stack.h b/gcc/rust/resolve/rust-forever-stack.h
index 3dab45e7e77..72b96bff3b3 100644
--- a/gcc/rust/resolve/rust-forever-stack.h
+++ b/gcc/rust/resolve/rust-forever-stack.h
@@ -596,10 +596,14 @@ private:
 					 SegIterator<S> iterator);
 
   /* Helper functions for forward resolution (to_canonical_path, to_rib...) */
+  struct DfsResult
+  {
+    Node &first;
+    std::string second;
+  };
 
   // FIXME: Documentation
-  tl::optional<std::pair<Node &, std::string>> dfs (Node &starting_point,
-						    NodeId to_find);
+  tl::optional<DfsResult> dfs (Node &starting_point, NodeId to_find);
   // FIXME: Documentation
   tl::optional<Rib &> dfs_rib (Node &starting_point, NodeId to_find);
 };
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index 6b622b8aef1..2c3cba59448 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -468,7 +468,7 @@ ForeverStack<N>::resolve_path (const std::vector<S> &segments)
 }
 
 template <Namespace N>
-tl::optional<std::pair<typename ForeverStack<N>::Node &, std::string>>
+tl::optional<typename ForeverStack<N>::DfsResult>
 ForeverStack<N>::dfs (ForeverStack<N>::Node &starting_point, NodeId to_find)
 {
   auto values = starting_point.rib.get_values ();
@@ -498,7 +498,7 @@ ForeverStack<N>::to_canonical_path (NodeId id)
   // back up to the root (parent().parent().parent()...) accumulate link
   // segments reverse them that's your canonical path
 
-  return dfs (root, id).map ([this, id] (std::pair<Node &, std::string> tuple) {
+  return dfs (root, id).map ([this, id] (DfsResult tuple) {
     auto containing_node = tuple.first;
     auto name = tuple.second;
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 103/125] gccrs: Improve parsing of raw byte string literals
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (100 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 102/125] gccrs: Change dfs function return type to support gcc 4.8 Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 104/125] gccrs: Recognize rustc_deprecated as a builtin attribute Arthur Cohen
                   ` (21 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* lex/rust-lex.cc
	(Lexer::parse_raw_byte_string):
	Bring handling of edge cases to par with parse_byte_string.

gcc/testsuite/ChangeLog:

	* rust/compile/raw-byte-string-loc.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/lex/rust-lex.cc                      | 23 +++++++++++++++----
 .../rust/compile/raw-byte-string-loc.rs       |  6 +++++
 2 files changed, 25 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/rust/compile/raw-byte-string-loc.rs

diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc
index 9c2203160cd..7c37e83d6cb 100644
--- a/gcc/rust/lex/rust-lex.cc
+++ b/gcc/rust/lex/rust-lex.cc
@@ -1840,14 +1840,18 @@ Lexer::parse_raw_byte_string (location_t loc)
   int length = 1;
   int hash_count = 0;
 
+  const location_t string_begin_locus = get_current_location ();
+
   // get hash count at beginnning
   skip_input ();
   current_char = peek_input ();
   length++;
+  current_column++;
   while (current_char == '#')
     {
       hash_count++;
       length++;
+      current_column++;
 
       skip_input ();
       current_char = peek_input ();
@@ -1862,6 +1866,7 @@ Lexer::parse_raw_byte_string (location_t loc)
   skip_input ();
   current_char = peek_input ();
   length++;
+  current_column++;
 
   while (true)
     {
@@ -1884,27 +1889,37 @@ Lexer::parse_raw_byte_string (location_t loc)
 	      skip_input (hash_count);
 	      current_char = peek_input ();
 	      length += hash_count + 1;
+	      current_column += hash_count + 1;
 	      break;
 	    }
 	}
-
-      if (current_char.value > 127)
+      else if (current_char.value > 127)
 	{
 	  rust_error_at (get_current_location (),
 			 "character %<%s%> in raw byte string out of range",
 			 current_char.as_string ().c_str ());
 	  current_char = 0;
 	}
+      else if (current_char.is_eof ())
+	{
+	  rust_error_at (string_begin_locus, "unended raw byte string literal");
+	  return Token::make (END_OF_FILE, get_current_location ());
+	}
 
       length++;
+      current_column++;
+      if (current_char == '\n')
+	{
+	  current_line++;
+	  current_column = 1;
+	  start_line (current_line, max_column_hint);
+	}
 
       str += current_char;
       skip_input ();
       current_char = peek_input ();
     }
 
-  current_column += length;
-
   loc += length - 1;
 
   str.shrink_to_fit ();
diff --git a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs
new file mode 100644
index 00000000000..f37d3f9694d
--- /dev/null
+++ b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs
@@ -0,0 +1,6 @@
+const X: &'static u8 = br#"12
+12"#;
+
+BREAK
+// { dg-error "unrecognised token" "" { target *-*-* } .-1 }
+// { dg-excess-errors "error 'failed to parse item' does not have location" }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 104/125] gccrs: Recognize rustc_deprecated as a builtin attribute
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (101 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 103/125] gccrs: Improve parsing of raw byte string literals Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 105/125] gccrs: Recognize unstable " Arthur Cohen
                   ` (20 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* util/rust-attribute-values.h
	(Attributes::RUSTC_DEPRECATED): New.
	* util/rust-attributes.cc
	(__definitions): Add Attributes::RUSTC_DEPRECATED.

gcc/testsuite/ChangeLog:

	* rust/compile/deprecated-fn.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/util/rust-attribute-values.h       | 1 +
 gcc/rust/util/rust-attributes.cc            | 1 +
 gcc/testsuite/rust/compile/deprecated-fn.rs | 4 ++++
 3 files changed, 6 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/deprecated-fn.rs

diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h
index e284cec1a16..04aef99be68 100644
--- a/gcc/rust/util/rust-attribute-values.h
+++ b/gcc/rust/util/rust-attribute-values.h
@@ -48,6 +48,7 @@ public:
   static constexpr auto &TARGET_FEATURE = "target_feature";
   // From now on, these are reserved by the compiler and gated through
   // #![feature(rustc_attrs)]
+  static constexpr auto &RUSTC_DEPRECATED = "rustc_deprecated";
   static constexpr auto &RUSTC_INHERIT_OVERFLOW_CHECKS
     = "rustc_inherit_overflow_checks";
   static constexpr auto &STABLE = "stable";
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index eac29808299..e10918b2f8d 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -58,6 +58,7 @@ static const BuiltinAttrDefinition __definitions[]
      {Attrs::TARGET_FEATURE, CODE_GENERATION},
      // From now on, these are reserved by the compiler and gated through
      // #![feature(rustc_attrs)]
+     {Attrs::RUSTC_DEPRECATED, STATIC_ANALYSIS},
      {Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION},
      {Attrs::STABLE, STATIC_ANALYSIS}};
 
diff --git a/gcc/testsuite/rust/compile/deprecated-fn.rs b/gcc/testsuite/rust/compile/deprecated-fn.rs
new file mode 100644
index 00000000000..4083593b30b
--- /dev/null
+++ b/gcc/testsuite/rust/compile/deprecated-fn.rs
@@ -0,0 +1,4 @@
+#![feature(rustc_attrs)]
+
+#[rustc_deprecated(since = "right now", reason = "a whim")]
+pub fn foo() {}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 105/125] gccrs: Recognize unstable as a builtin attribute
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (102 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 104/125] gccrs: Recognize rustc_deprecated as a builtin attribute Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 106/125] gccrs: Avoid parsing const unsafe/extern functions as async Arthur Cohen
                   ` (19 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* util/rust-attribute-values.h
	(Attributes::UNSTABLE): New.
	* util/rust-attributes.cc
	(__definitions): Add Attributes::UNSTABLE.

gcc/testsuite/ChangeLog:

	* rust/compile/unstable-fn.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/util/rust-attribute-values.h     | 1 +
 gcc/rust/util/rust-attributes.cc          | 3 ++-
 gcc/testsuite/rust/compile/unstable-fn.rs | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/rust/compile/unstable-fn.rs

diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h
index 04aef99be68..a8551c07dba 100644
--- a/gcc/rust/util/rust-attribute-values.h
+++ b/gcc/rust/util/rust-attribute-values.h
@@ -52,6 +52,7 @@ public:
   static constexpr auto &RUSTC_INHERIT_OVERFLOW_CHECKS
     = "rustc_inherit_overflow_checks";
   static constexpr auto &STABLE = "stable";
+  static constexpr auto &UNSTABLE = "unstable";
 };
 } // namespace Values
 } // namespace Rust
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index e10918b2f8d..84d1781d0b3 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -60,7 +60,8 @@ static const BuiltinAttrDefinition __definitions[]
      // #![feature(rustc_attrs)]
      {Attrs::RUSTC_DEPRECATED, STATIC_ANALYSIS},
      {Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION},
-     {Attrs::STABLE, STATIC_ANALYSIS}};
+     {Attrs::STABLE, STATIC_ANALYSIS},
+     {Attrs::UNSTABLE, STATIC_ANALYSIS}};
 
 BuiltinAttributeMappings *
 BuiltinAttributeMappings::get ()
diff --git a/gcc/testsuite/rust/compile/unstable-fn.rs b/gcc/testsuite/rust/compile/unstable-fn.rs
new file mode 100644
index 00000000000..4cbbebdb50e
--- /dev/null
+++ b/gcc/testsuite/rust/compile/unstable-fn.rs
@@ -0,0 +1,2 @@
+#[unstable(feature = "some_feature", issue = "12345")]
+pub fn foo() {}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 106/125] gccrs: Avoid parsing const unsafe/extern functions as async
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (103 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 105/125] gccrs: Recognize unstable " Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 107/125] gccrs: Improve parsing of raw string literals Arthur Cohen
                   ` (18 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h
	(Parser::parse_vis_item):
	Call parse_function instead of parse_async_item when finding
	UNSAFE or EXTERN_KW during lookahead.

gcc/testsuite/ChangeLog:

	* rust/compile/func-const-unsafe.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/parse/rust-parse-impl.h                | 4 ++--
 gcc/testsuite/rust/compile/func-const-unsafe.rs | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/rust/compile/func-const-unsafe.rs

diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index b6c2ca3fc0c..263ca634ea5 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -1382,10 +1382,10 @@ Parser<ManagedTokenSource>::parse_vis_item (AST::AttrVec outer_attrs)
 	case IDENTIFIER:
 	case UNDERSCORE:
 	  return parse_const_item (std::move (vis), std::move (outer_attrs));
-	case UNSAFE:
-	case EXTERN_KW:
 	case ASYNC:
 	  return parse_async_item (std::move (vis), std::move (outer_attrs));
+	case UNSAFE:
+	case EXTERN_KW:
 	case FN_KW:
 	  return parse_function (std::move (vis), std::move (outer_attrs));
 	default:
diff --git a/gcc/testsuite/rust/compile/func-const-unsafe.rs b/gcc/testsuite/rust/compile/func-const-unsafe.rs
new file mode 100644
index 00000000000..9c932bd1cb5
--- /dev/null
+++ b/gcc/testsuite/rust/compile/func-const-unsafe.rs
@@ -0,0 +1 @@
+pub const unsafe fn foo() {}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 107/125] gccrs: Improve parsing of raw string literals
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (104 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 106/125] gccrs: Avoid parsing const unsafe/extern functions as async Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 108/125] gccrs: raw-strings: Remove dg-excess-error directive Arthur Cohen
                   ` (17 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Owen Avery

From: Owen Avery <powerboat9.gamer@gmail.com>

gcc/rust/ChangeLog:

	* lex/rust-lex.cc
	(Lexer::parse_raw_string):
	Bring handling of edge cases to par with parse_raw_byte_string.

gcc/testsuite/ChangeLog:

	* rust/compile/raw-string-loc.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
---
 gcc/rust/lex/rust-lex.cc                     | 21 +++++++++++++++++---
 gcc/testsuite/rust/compile/raw-string-loc.rs |  6 ++++++
 2 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/rust/compile/raw-string-loc.rs

diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc
index 7c37e83d6cb..e5c9148976c 100644
--- a/gcc/rust/lex/rust-lex.cc
+++ b/gcc/rust/lex/rust-lex.cc
@@ -2152,6 +2152,9 @@ Lexer::parse_raw_string (location_t loc, int initial_hash_count)
   str.reserve (16); // some sensible default
 
   int length = 1 + initial_hash_count;
+  current_column += length;
+
+  const location_t string_begin_locus = get_current_location ();
 
   if (initial_hash_count > 0)
     skip_input (initial_hash_count - 1);
@@ -2162,10 +2165,11 @@ Lexer::parse_raw_string (location_t loc, int initial_hash_count)
     rust_error_at (get_current_location (), "raw string has no opening %<\"%>");
 
   length++;
+  current_column++;
   skip_input ();
   current_char = peek_input ();
 
-  while (!current_char.is_eof ())
+  while (true)
     {
       if (current_char.value == '"')
 	{
@@ -2186,19 +2190,30 @@ Lexer::parse_raw_string (location_t loc, int initial_hash_count)
 	      skip_input (initial_hash_count);
 	      current_char = peek_input ();
 	      length += initial_hash_count + 1;
+	      current_column += initial_hash_count + 1;
 	      break;
 	    }
 	}
+      else if (current_char.is_eof ())
+	{
+	  rust_error_at (string_begin_locus, "unended raw string literal");
+	  return Token::make (END_OF_FILE, get_current_location ());
+	}
 
       length++;
+      current_column++;
+      if (current_char == '\n')
+	{
+	  current_line++;
+	  current_column = 1;
+	  start_line (current_line, max_column_hint);
+	}
 
       str += current_char.as_string ();
       skip_input ();
       current_char = peek_input ();
     }
 
-  current_column += length;
-
   loc += length - 1;
 
   str.shrink_to_fit ();
diff --git a/gcc/testsuite/rust/compile/raw-string-loc.rs b/gcc/testsuite/rust/compile/raw-string-loc.rs
new file mode 100644
index 00000000000..70977510ba3
--- /dev/null
+++ b/gcc/testsuite/rust/compile/raw-string-loc.rs
@@ -0,0 +1,6 @@
+const X: &'static str = r#"12
+12"#;
+
+BREAK
+// { dg-error "unrecognised token" "" { target *-*-* } .-1 }
+// { dg-excess-errors "error 'failed to parse item' does not have location" }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 108/125] gccrs: raw-strings: Remove dg-excess-error directive
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (105 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 107/125] gccrs: Improve parsing of raw string literals Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 109/125] gccrs: unify: Always coerce `!` to the target type Arthur Cohen
                   ` (16 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

The error is actually expected and uses the correct location.

gcc/testsuite/ChangeLog:

	* rust/compile/raw-byte-string-loc.rs: Use dg-error instead of
	dg-excess-error.
	* rust/compile/raw-string-loc.rs: Likewise.
---
 gcc/testsuite/rust/compile/raw-byte-string-loc.rs | 2 +-
 gcc/testsuite/rust/compile/raw-string-loc.rs      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs
index f37d3f9694d..b71b6e5aded 100644
--- a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs
+++ b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs
@@ -3,4 +3,4 @@ const X: &'static u8 = br#"12
 
 BREAK
 // { dg-error "unrecognised token" "" { target *-*-* } .-1 }
-// { dg-excess-errors "error 'failed to parse item' does not have location" }
+// { dg-error "failed to parse item" "" { target *-*-* } .-2 }
diff --git a/gcc/testsuite/rust/compile/raw-string-loc.rs b/gcc/testsuite/rust/compile/raw-string-loc.rs
index 70977510ba3..26331eafa44 100644
--- a/gcc/testsuite/rust/compile/raw-string-loc.rs
+++ b/gcc/testsuite/rust/compile/raw-string-loc.rs
@@ -3,4 +3,4 @@ const X: &'static str = r#"12
 
 BREAK
 // { dg-error "unrecognised token" "" { target *-*-* } .-1 }
-// { dg-excess-errors "error 'failed to parse item' does not have location" }
+// { dg-error "failed to parse item" "" { target *-*-* } .-2 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 109/125] gccrs: unify: Always coerce `!` to the target type.
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (106 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 108/125] gccrs: raw-strings: Remove dg-excess-error directive Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 110/125] gccrs: borrowck: Use rust-system.h Arthur Cohen
                   ` (15 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Arthur Cohen

Never can... never... exist, so it should always be coerced to the type
it is being matched against. This is useful for breaking off of a loop
from inside a match, or an if condition, for example.

gcc/rust/ChangeLog:

	* typecheck/rust-unify.cc (UnifyRules::go): Always unify to `ltype` if
	we are matching against a `Never` in `rtype`.
	(UnifyRules::expect_never): Always unify to the expected type.

gcc/testsuite/ChangeLog:

	* rust/compile/match-never-ltype.rs: New test.
	* rust/compile/match-never-rtype.rs: New test.
---
 gcc/rust/typecheck/rust-unify.cc              | 36 ++++++-------------
 .../rust/compile/match-never-ltype.rs         | 17 +++++++++
 .../rust/compile/match-never-rtype.rs         | 17 +++++++++
 3 files changed, 45 insertions(+), 25 deletions(-)
 create mode 100644 gcc/testsuite/rust/compile/match-never-ltype.rs
 create mode 100644 gcc/testsuite/rust/compile/match-never-rtype.rs

diff --git a/gcc/rust/typecheck/rust-unify.cc b/gcc/rust/typecheck/rust-unify.cc
index 8b43380cc59..7d1042d8e63 100644
--- a/gcc/rust/typecheck/rust-unify.cc
+++ b/gcc/rust/typecheck/rust-unify.cc
@@ -17,6 +17,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include "rust-unify.h"
+#include "rust-tyty.h"
 
 namespace Rust {
 namespace Resolver {
@@ -237,6 +238,15 @@ UnifyRules::go ()
 	}
     }
 
+  // The never type should always get coerced to the type it's being matched
+  // against, so in that case, ltype. This avoids doing the same check in all
+  // the `expect_*` functions.
+  // However, this does not work if we have an annoying ltype - like INFER.
+  // TODO: Is ltype == Infer the only special case here? What about projections?
+  // references?
+  if (rtype->get_kind () == TyTy::NEVER && ltype->get_kind () != TyTy::INFER)
+    return ltype->clone ();
+
   switch (ltype->get_kind ())
     {
     case TyTy::INFER:
@@ -1536,32 +1546,8 @@ UnifyRules::expect_never (TyTy::NeverType *ltype, TyTy::BaseType *rtype)
       }
       break;
 
-    case TyTy::NEVER:
+    default:
       return rtype->clone ();
-
-    case TyTy::PLACEHOLDER:
-    case TyTy::PROJECTION:
-    case TyTy::DYNAMIC:
-    case TyTy::CLOSURE:
-    case TyTy::SLICE:
-    case TyTy::PARAM:
-    case TyTy::POINTER:
-    case TyTy::STR:
-    case TyTy::ADT:
-    case TyTy::REF:
-    case TyTy::ARRAY:
-    case TyTy::FNDEF:
-    case TyTy::FNPTR:
-    case TyTy::TUPLE:
-    case TyTy::BOOL:
-    case TyTy::CHAR:
-    case TyTy::INT:
-    case TyTy::UINT:
-    case TyTy::FLOAT:
-    case TyTy::USIZE:
-    case TyTy::ISIZE:
-    case TyTy::ERROR:
-      return new TyTy::ErrorType (0);
     }
   return new TyTy::ErrorType (0);
 }
diff --git a/gcc/testsuite/rust/compile/match-never-ltype.rs b/gcc/testsuite/rust/compile/match-never-ltype.rs
new file mode 100644
index 00000000000..6516ab3c1ea
--- /dev/null
+++ b/gcc/testsuite/rust/compile/match-never-ltype.rs
@@ -0,0 +1,17 @@
+fn foo() {}
+
+enum Foo {
+    A,
+    B,
+}
+
+fn main() {
+    let a = Foo::A;
+
+    loop {
+        match a {
+            Foo::A => break,
+            Foo::B => foo(),
+        }
+    }
+}
diff --git a/gcc/testsuite/rust/compile/match-never-rtype.rs b/gcc/testsuite/rust/compile/match-never-rtype.rs
new file mode 100644
index 00000000000..6e4e7638f67
--- /dev/null
+++ b/gcc/testsuite/rust/compile/match-never-rtype.rs
@@ -0,0 +1,17 @@
+fn foo() {}
+
+enum Foo {
+    A,
+    B,
+}
+
+fn main() {
+    let a = Foo::A;
+
+    loop {
+        match a {
+            Foo::B => foo(),
+            Foo::A => break,
+        }
+    }
+}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 110/125] gccrs: borrowck: Use rust-system.h
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (107 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 109/125] gccrs: unify: Always coerce `!` to the target type Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 111/125] gccrs: borrowck: Unify BIR terminilogy (node->statement) Arthur Cohen
                   ` (14 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

Replace direct usage of system headers.

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-dump.cc: Use rust-system.h
	* checks/errors/borrowck/rust-bir-dump.h (RUST_BIR_DUMP_H): Use rust-system.h
	* checks/errors/borrowck/rust-bir-place.h (RUST_BIR_PLACE_H): Use rust-system.h
	* checks/errors/borrowck/rust-function-collector.h: Use rust-system.h
	* rust-system.h: Use rust-system.h
	* typecheck/rust-hir-type-check.h: Use rust-system.h
	* typecheck/rust-tyty-subst.cc: Use rust-system.h
	* typecheck/rust-tyty-subst.h: Use rust-system.h
	* typecheck/rust-tyty.h: Use rust-system.h

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/checks/errors/borrowck/rust-bir-dump.cc          | 2 +-
 gcc/rust/checks/errors/borrowck/rust-bir-dump.h           | 3 +--
 gcc/rust/checks/errors/borrowck/rust-bir-place.h          | 1 -
 gcc/rust/checks/errors/borrowck/rust-function-collector.h | 3 +--
 gcc/rust/rust-system.h                                    | 3 +++
 gcc/rust/typecheck/rust-hir-type-check.h                  | 3 +--
 gcc/rust/typecheck/rust-tyty-subst.cc                     | 2 +-
 gcc/rust/typecheck/rust-tyty-subst.h                      | 3 +--
 gcc/rust/typecheck/rust-tyty.h                            | 3 +--
 9 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 23aa7c6b078..3e49bc76933 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -1,4 +1,4 @@
-#include <numeric>
+#include "rust-system.h"
 #include "rust-bir-dump.h"
 #include "rust-diagnostics.h"
 
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
index e8cf1372602..b6407a8528a 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
@@ -19,8 +19,7 @@
 #ifndef RUST_BIR_DUMP_H
 #define RUST_BIR_DUMP_H
 
-#include <ostream>
-#include <utility>
+#include "rust-system.h"
 #include "rust-bir-place.h"
 #include "rust-bir-visitor.h"
 #include "rust-bir.h"
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index 7b04ae40824..ccc820121cc 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -19,7 +19,6 @@
 #ifndef RUST_BIR_PLACE_H
 #define RUST_BIR_PLACE_H
 
-#include <limits>
 #include "rust-mapping-common.h"
 #include "rust-system.h"
 #include "rust-tyty.h"
diff --git a/gcc/rust/checks/errors/borrowck/rust-function-collector.h b/gcc/rust/checks/errors/borrowck/rust-function-collector.h
index 18f2f5e11d1..272f20d5f93 100644
--- a/gcc/rust/checks/errors/borrowck/rust-function-collector.h
+++ b/gcc/rust/checks/errors/borrowck/rust-function-collector.h
@@ -22,8 +22,7 @@
 #include "rust-hir-item.h"
 #include "rust-hir-visitor.h"
 #include "rust-hir.h"
-
-#include <vector>
+#include "rust-system.h"
 
 namespace Rust {
 
diff --git a/gcc/rust/rust-system.h b/gcc/rust/rust-system.h
index d8a42181700..2382e5b1fb4 100644
--- a/gcc/rust/rust-system.h
+++ b/gcc/rust/rust-system.h
@@ -36,6 +36,7 @@
 #include <map>
 #include <set>
 #include <vector>
+#include <stack>
 #include <sstream>
 #include <string>
 #include <deque>
@@ -45,6 +46,8 @@
 #include <fstream>
 #include <array>
 #include <algorithm>
+#include <limits>
+#include <numeric>
 
 // Rust frontend requires C++11 minimum, so will have unordered_map and set
 #include <unordered_map>
diff --git a/gcc/rust/typecheck/rust-hir-type-check.h b/gcc/rust/typecheck/rust-hir-type-check.h
index c32fa4e8487..c85a83955b9 100644
--- a/gcc/rust/typecheck/rust-hir-type-check.h
+++ b/gcc/rust/typecheck/rust-hir-type-check.h
@@ -25,8 +25,7 @@
 #include "rust-autoderef.h"
 #include "rust-tyty-region.h"
 #include "rust-tyty-variance-analysis.h"
-
-#include <stack>
+#include "rust-system.h"
 
 namespace Rust {
 namespace Resolver {
diff --git a/gcc/rust/typecheck/rust-tyty-subst.cc b/gcc/rust/typecheck/rust-tyty-subst.cc
index 71d41d6f796..8c801558c42 100644
--- a/gcc/rust/typecheck/rust-tyty-subst.cc
+++ b/gcc/rust/typecheck/rust-tyty-subst.cc
@@ -18,7 +18,7 @@
 
 #include "rust-tyty-subst.h"
 
-#include <utility>
+#include "rust-system.h"
 #include "rust-tyty.h"
 #include "rust-hir-type-check.h"
 #include "rust-substitution-mapper.h"
diff --git a/gcc/rust/typecheck/rust-tyty-subst.h b/gcc/rust/typecheck/rust-tyty-subst.h
index 562267cd059..4f0fab37b44 100644
--- a/gcc/rust/typecheck/rust-tyty-subst.h
+++ b/gcc/rust/typecheck/rust-tyty-subst.h
@@ -24,8 +24,7 @@
 #include "rust-hir-full-decls.h"
 #include "rust-tyty-bounds.h"
 #include "rust-tyty-region.h"
-
-#include <optional.h>
+#include "optional.h"
 
 namespace Rust {
 namespace TyTy {
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index 5d4eab42a91..27a4aa28d13 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -27,8 +27,7 @@
 #include "rust-tyty-util.h"
 #include "rust-tyty-subst.h"
 #include "rust-tyty-region.h"
-
-#include <limits>
+#include "rust-system.h"
 
 namespace Rust {
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 111/125] gccrs: borrowck: Unify BIR terminilogy (node->statement)
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (108 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 110/125] gccrs: borrowck: Use rust-system.h Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 112/125] gccrs: borrowck: BIR: use callable API Arthur Cohen
                   ` (13 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/bir-design-notes.md (nodes): Rename node to statement.
	(Nodes): Rename node to statement.
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
	Rename node to statement.
	* checks/errors/borrowck/rust-bir-builder-internal.h: Rename node to statement.
	* checks/errors/borrowck/rust-bir-builder.h: Rename node to statement.
	* checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Rename node to statement.
	(Dump::visit): Rename node to statement.
	* checks/errors/borrowck/rust-bir-dump.h (class Dump): Rename node to statement.
	* checks/errors/borrowck/rust-bir-visitor.h (class Node): Rename node to statement.
	(class Statement): Rename node to statement.
	* checks/errors/borrowck/rust-bir.h (class Node): Rename node to statement.
	(class Statement): Rename node to statement.
	(class AbstractExpr): Rename node to statement.
	(struct Function): Rename node to statement.
	(struct BasicBlock): Rename node to statement.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../errors/borrowck/bir-design-notes.md       | 13 ++---
 .../borrowck/rust-bir-builder-expr-stmt.cc    |  2 +-
 .../borrowck/rust-bir-builder-internal.h      |  7 +--
 .../checks/errors/borrowck/rust-bir-builder.h |  4 +-
 .../checks/errors/borrowck/rust-bir-dump.cc   | 51 ++++++++++---------
 .../checks/errors/borrowck/rust-bir-dump.h    |  6 +--
 .../checks/errors/borrowck/rust-bir-visitor.h |  4 +-
 gcc/rust/checks/errors/borrowck/rust-bir.h    | 34 ++++++-------
 8 files changed, 62 insertions(+), 59 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/bir-design-notes.md b/gcc/rust/checks/errors/borrowck/bir-design-notes.md
index ad622cd7228..e2edc20ffa8 100644
--- a/gcc/rust/checks/errors/borrowck/bir-design-notes.md
+++ b/gcc/rust/checks/errors/borrowck/bir-design-notes.md
@@ -108,7 +108,7 @@
 - Declaration of locals: `let _0: i32;`, where `_0` is the return value (even if it is of the unit type). Arguments are not listed here, they are
   listed in the function header.
 - A list of basic blocks: `bb0: { ... }`. The basic block name is the `bb` prefix followed by a number.
-- Each basic block consists of a list of BIR nodes (instructions). Instruction can be either assigned to a local (place) or be a statement.
+- Each basic block consists of a list of BIR statements. Instruction can be either assigned to a local (place) or be a statement.
   Instructions take locals (places) as arguments.
 - Each basic block is terminated with a control flow instruction followed by a list of destinations:
     - `goto -> bb3;` - a goto instruction with a single destination.
@@ -126,16 +126,17 @@
 
 ### Basic Blocks
 
-A basic block is identified by its index in the function's basic block list. It contains a list of BIR nodes (instructions) and a list of successor
+A basic block is identified by its index in the function's basic block list.
+It contains a list of BIR statements and a list of successor
 basic block indices in CFG.
 
-### BIR Nodes (Instructions)
+### BIR Statements
 
-BIR nodes are of three categories:
+BIR statements are of three categories:
 
 - An assignment of an expression to a local (place).
 - A control flow operation (switch, return).
-- A special node (not executable) node, which carries additional information for borrow-checking (`StorageDead`, `StorageLive`).
+- A special statement (not executable), which carries additional information for borrow-checking (`StorageDead`, `StorageLive`).
 
 #### Expressions
 
@@ -147,7 +148,7 @@
 - `Operator<ARITY>` represents any kind of operation, except the following, where special information is needed either for borrow-checking or for
   better debugging.
 - `BorrowExpr` represents a borrow operation.
-- `AssignmentExpr` holds a place for a node of assignment (i.e., no operation is done on the place, it is just assigned).
+- `AssignmentExpr` holds a place for an assignment statement (i.e., no operation is done on the place, it is just assigned).
 - `CallExpr` represents a function call.
     - For functions, the callable is represented by a constant place (see below). (E.i. all calls use the same constant place.)
     - For closures and function pointers, the callable is represented by a (non-constant) place.
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
index ead6e403661..2c916294ca7 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
@@ -419,7 +419,7 @@ ExprStmtBuilder::visit (HIR::ReturnExpr &ret)
     {
       push_assignment (RETURN_VALUE_PLACE, visit_expr (*ret.get_expr ()));
     }
-  ctx.get_current_bb ().statements.emplace_back (Node::Kind::RETURN);
+  ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
 }
 
 void
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
index b4192677261..eef0f916408 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
@@ -177,7 +177,7 @@ protected:
     return ctx.place_db.add_variable (nodeid, ty);
   }
 
-protected: // Helpers to add BIR nodes
+protected: // Helpers to add BIR statements
   void push_assignment (PlaceId lhs, AbstractExpr *rhs)
   {
     ctx.get_current_bb ().statements.emplace_back (lhs, rhs);
@@ -199,14 +199,15 @@ protected: // Helpers to add BIR nodes
 		    std::initializer_list<BasicBlockId> destinations = {})
   {
     auto copy = make_arg (switch_val);
-    ctx.get_current_bb ().statements.emplace_back (Node::Kind::SWITCH, copy);
+    ctx.get_current_bb ().statements.emplace_back (Statement::Kind::SWITCH,
+						   copy);
     ctx.get_current_bb ().successors.insert (
       ctx.get_current_bb ().successors.end (), destinations);
   }
 
   void push_goto (BasicBlockId bb)
   {
-    ctx.get_current_bb ().statements.emplace_back (Node::Kind::GOTO);
+    ctx.get_current_bb ().statements.emplace_back (Statement::Kind::GOTO);
     if (bb != INVALID_BB) // INVALID_BB means the goto will be resolved later.
       ctx.get_current_bb ().successors.push_back (bb);
   }
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder.h
index 509929bc684..9bed96c660f 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder.h
@@ -77,13 +77,13 @@ private:
     if (body.has_expr () && !lookup_type (body)->is_unit ())
       {
 	push_assignment (RETURN_VALUE_PLACE, translated);
-	ctx.get_current_bb ().statements.emplace_back (Node::Kind::RETURN);
+	ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
       }
     else if (!ctx.get_current_bb ().is_terminated ())
       {
 	push_assignment (RETURN_VALUE_PLACE,
 			 ctx.place_db.get_constant (lookup_type (body)));
-	ctx.get_current_bb ().statements.emplace_back (Node::Kind::RETURN);
+	ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
       }
   };
 };
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 3e49bc76933..3684ad7b889 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -135,20 +135,21 @@ Dump::go (bool enable_simplify_cfg)
     }
 
   // Print BBs.
-  for (node_bb = 0; node_bb < func.basic_blocks.size (); ++node_bb)
+  for (statement_bb = 0; statement_bb < func.basic_blocks.size ();
+       ++statement_bb)
     {
-      if (bb_fold_map[node_bb] != node_bb)
+      if (bb_fold_map[statement_bb] != statement_bb)
 	continue; // This BB was folded.
 
-      if (func.basic_blocks[node_bb].statements.empty ()
-	  && func.basic_blocks[node_bb].successors.empty ())
+      if (func.basic_blocks[statement_bb].statements.empty ()
+	  && func.basic_blocks[statement_bb].successors.empty ())
 	continue;
 
       bb_terminated = false;
 
-      BasicBlock &bb = func.basic_blocks[node_bb];
+      BasicBlock &bb = func.basic_blocks[statement_bb];
       stream << "\n";
-      stream << indentation << "bb" << bb_fold_map[node_bb] << ": {\n";
+      stream << indentation << "bb" << bb_fold_map[statement_bb] << ": {\n";
       for (auto &stmt : bb.statements)
 	{
 	  stream << indentation << indentation;
@@ -166,49 +167,49 @@ Dump::go (bool enable_simplify_cfg)
   stream << "}\n";
 }
 void
-Dump::visit (Node &node)
+Dump::visit (Statement &stmt)
 {
-  node_place = node.get_place ();
-  switch (node.get_kind ())
+  statement_place = stmt.get_place ();
+  switch (stmt.get_kind ())
     {
-      case Node::Kind::ASSIGNMENT: {
-	visit_place (node.get_place ());
+      case Statement::Kind::ASSIGNMENT: {
+	visit_place (stmt.get_place ());
 	stream << " = ";
-	node.get_expr ().accept_vis (*this);
+	stmt.get_expr ().accept_vis (*this);
 	break;
       }
-    case Node::Kind::SWITCH:
+    case Statement::Kind::SWITCH:
       stream << "switchInt(";
-      visit_move_place (node.get_place ());
+      visit_move_place (stmt.get_place ());
       stream << ") -> [";
-      print_comma_separated (stream, func.basic_blocks[node_bb].successors,
+      print_comma_separated (stream, func.basic_blocks[statement_bb].successors,
 			     [this] (BasicBlockId succ) {
 			       stream << "bb" << bb_fold_map[succ];
 			     });
       stream << "]";
       bb_terminated = true;
       break;
-    case Node::Kind::RETURN:
+    case Statement::Kind::RETURN:
       stream << "return";
       bb_terminated = true;
       break;
-    case Node::Kind::GOTO:
+    case Statement::Kind::GOTO:
       stream << "goto -> bb"
-	     << bb_fold_map[func.basic_blocks[node_bb].successors.at (0)];
+	     << bb_fold_map[func.basic_blocks[statement_bb].successors.at (0)];
       bb_terminated = true;
       break;
-    case Node::Kind::STORAGE_DEAD:
+    case Statement::Kind::STORAGE_DEAD:
       stream << "StorageDead(";
-      visit_move_place (node.get_place ());
+      visit_move_place (stmt.get_place ());
       stream << ")";
       break;
-    case Node::Kind::STORAGE_LIVE:
+    case Statement::Kind::STORAGE_LIVE:
       stream << "StorageLive(";
-      visit_move_place (node.get_place ());
+      visit_move_place (stmt.get_place ());
       stream << ")";
       break;
     }
-  node_place = INVALID_PLACE;
+  statement_place = INVALID_PLACE;
 }
 
 void
@@ -261,7 +262,7 @@ void
 Dump::visit (BorrowExpr &expr)
 {
   stream << "&";
-  visit_lifetime (node_place);
+  visit_lifetime (statement_place);
   visit_place (expr.get_place ());
 }
 
@@ -307,7 +308,7 @@ Dump::visit (CallExpr &expr)
 			   visit_move_place (place_id);
 			 });
   stream << ") -> [";
-  print_comma_separated (stream, func.basic_blocks[node_bb].successors,
+  print_comma_separated (stream, func.basic_blocks[statement_bb].successors,
 			 [this] (BasicBlockId succ) {
 			   stream << "bb" << bb_fold_map[succ];
 			 });
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
index b6407a8528a..7ee94d749e3 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
@@ -37,8 +37,8 @@ class Dump : public Visitor
   std::vector<BasicBlockId> bb_fold_map;
   std::vector<PlaceId> place_map;
 
-  PlaceId node_place = INVALID_PLACE;
-  BasicBlockId node_bb = INVALID_BB;
+  PlaceId statement_place = INVALID_PLACE;
+  BasicBlockId statement_bb = INVALID_BB;
   bool bb_terminated = false;
 
 public:
@@ -49,7 +49,7 @@ public:
   void go (bool enable_simplify_cfg = false);
 
 protected:
-  void visit (Node &node) override;
+  void visit (Statement &stmt) override;
   void visit_place (PlaceId place_id);
   void visit_move_place (PlaceId place_id);
   void visit (BorrowExpr &expr) override;
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h b/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
index 8c6053d2362..0b3a4bddbec 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
@@ -22,7 +22,7 @@
 namespace Rust {
 namespace BIR {
 
-class Node;
+class Statement;
 class InitializerExpr;
 template <unsigned N> class Operator;
 class Assignment;
@@ -32,7 +32,7 @@ class CallExpr;
 class Visitor
 {
 public:
-  virtual void visit (Node &node) = 0;
+  virtual void visit (Statement &stmt) = 0;
   virtual void visit (InitializerExpr &expr) = 0;
   virtual void visit (Operator<1> &expr) = 0;
   virtual void visit (Operator<2> &expr) = 0;
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir.h b/gcc/rust/checks/errors/borrowck/rust-bir.h
index aa97eac17b4..746b2dc7e38 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir.h
@@ -27,23 +27,23 @@ namespace Rust {
 namespace BIR {
 
 struct BasicBlock;
-class Node;
+class Statement;
 class AbstractExpr;
 
 /**
  * Top-level entity of the Borrow-checker IR (BIR).
- * It represents a single function (method, closure, etc.), which is also the
- * basic unit of Polonius borrow-checking.
+ * It represents a single function (method, closure, etc.), which is the
+ * basic unit of borrow-checking.
  */
 struct Function
 {
   PlaceDB place_db;
-  std::vector<PlaceId> arguments; // Only used for dump.
+  std::vector<PlaceId> arguments;
   std::vector<BasicBlock> basic_blocks;
 };
 
-/** Single "instruction" of BIR. */
-class Node
+/** Single statement of BIR. */
+class Statement
 {
 public:
   enum class Kind
@@ -68,12 +68,12 @@ private:
   std::unique_ptr<AbstractExpr> expr;
 
 public:
-  Node (PlaceId lhs, AbstractExpr *rhs)
+  Statement (PlaceId lhs, AbstractExpr *rhs)
     : kind (Kind::ASSIGNMENT), place (lhs), expr (rhs)
   {}
 
-  explicit Node (Kind kind, PlaceId place = INVALID_PLACE,
-		 AbstractExpr *expr = nullptr)
+  explicit Statement (Kind kind, PlaceId place = INVALID_PLACE,
+		      AbstractExpr *expr = nullptr)
     : kind (kind), place (place), expr (expr)
   {}
 
@@ -92,7 +92,7 @@ static constexpr BasicBlockId INVALID_BB
 struct BasicBlock
 {
   // BIR "instructions".
-  std::vector<Node> statements;
+  std::vector<Statement> statements;
   // A basic block can end with: goto, return or switch
   std::vector<BasicBlockId> successors;
 
@@ -103,9 +103,9 @@ public:
       return false;
     switch (statements.back ().get_kind ())
       {
-      case Node::Kind::GOTO:
-      case Node::Kind::RETURN:
-      case Node::Kind::SWITCH:
+      case Statement::Kind::GOTO:
+      case Statement::Kind::RETURN:
+      case Statement::Kind::SWITCH:
 	return true;
       default:
 	return false;
@@ -115,11 +115,11 @@ public:
   WARN_UNUSED_RESULT bool is_goto_terminated () const
   {
     return is_terminated ()
-	   && statements.back ().get_kind () == Node::Kind::GOTO;
+	   && statements.back ().get_kind () == Statement::Kind::GOTO;
   }
 };
 
-// Rhs expression of BIR assignment node (abstract).
+// Rhs expression of BIR assignment statements (abstract).
 class AbstractExpr : public Visitable
 {
 };
@@ -163,8 +163,8 @@ public:
 };
 
 /**
- * This expression is only to be used inside the assignment node and acts as
- * identity wrapper for a place value. It is separated from `Operator<1>` to
+ * This expression is only to be used inside the assignment statement and acts
+ * as identity wrapper for a place value. It is separated from `Operator<1>` to
  * render it more explicitly in the dump.
  */
 class Assignment : public VisitableImpl<AbstractExpr, Assignment>
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 112/125] gccrs: borrowck: BIR: use callable API
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (109 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 111/125] gccrs: borrowck: Unify BIR terminilogy (node->statement) Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 113/125] gccrs: borrowck: BIR: Place tree traverse API Arthur Cohen
                   ` (12 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
	Use callable API

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../borrowck/rust-bir-builder-expr-stmt.cc    | 23 ++++---------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
index 2c916294ca7..ea8107b1fb7 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
@@ -248,25 +248,12 @@ ExprStmtBuilder::visit (HIR::CallExpr &expr)
   PlaceId fn = visit_expr (*expr.get_fnexpr ());
   std::vector<PlaceId> arguments = visit_list (expr.get_arguments ());
 
-  auto *call_type = ctx.place_db[fn].tyty;
-  if (auto fn_type = call_type->try_as<TyTy::FnType> ())
-    {
-      for (size_t i = 0; i < fn_type->get_params ().size (); ++i)
-	{
-	  coercion_site (arguments[i], fn_type->get_params ()[i].second);
-	}
-    }
-  else if (auto fn_ptr_type = call_type->try_as<TyTy::FnPtr> ())
-    {
-      for (size_t i = 0; i < fn_ptr_type->get_params ().size (); ++i)
-	{
-	  coercion_site (arguments[i],
-			 fn_ptr_type->get_params ()[i].get_tyty ());
-	}
-    }
-  else
+  const auto fn_type
+    = ctx.place_db[fn].tyty->as<const TyTy::CallableTypeInterface> ();
+
+  for (size_t i = 0; i < fn_type->get_num_params (); ++i)
     {
-      rust_unreachable ();
+      coercion_site (arguments[i], fn_type->get_param_type_at (i));
     }
 
   return_expr (new CallExpr (fn, std::move (arguments)), lookup_type (expr),
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 113/125] gccrs: borrowck: BIR: Place tree traverse API
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (110 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 112/125] gccrs: borrowck: BIR: use callable API Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 114/125] gccrs: borrowck: BIR: scope handling Arthur Cohen
                   ` (11 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-place.h:
	Create place tree traverse API.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../checks/errors/borrowck/rust-bir-place.h   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index ccc820121cc..e62ec3557ad 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -229,6 +229,29 @@ public:
 		       places[place].tyty});
   }
 
+  template <typename FN> void for_each_path_from_root (PlaceId var, FN fn) const
+  {
+    PlaceId current = var;
+    current = places[current].path.first_child;
+    while (current != INVALID_PLACE)
+      {
+	fn (current);
+	for_each_path_from_root (current, fn);
+	current = places[current].path.next_sibling;
+      }
+  }
+
+  template <typename FN>
+  void for_each_path_segment (PlaceId place_id, FN fn) const
+  {
+    PlaceId current = place_id;
+    while (current != INVALID_PLACE)
+      {
+	fn (current);
+	current = places[current].path.parent;
+      }
+  }
+
 private:
   static bool is_type_copy (TyTy::BaseType *ty)
   {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 114/125] gccrs: borrowck: BIR: scope handling
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (111 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 113/125] gccrs: borrowck: BIR: Place tree traverse API Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 115/125] gccrs: borrowck: BIR: emit moves Arthur Cohen
                   ` (10 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::setup_loop):
	Loop handling.
	(ExprStmtBuilder::visit): Handle scopes.
	* checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext):
	Handle scopes.
	* checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Dump scopes.
	(Dump::visit): Add scopes dump.
	(Dump::indent): Add indentation logic.
	(Dump::visit_scope): Dump scope.
	* checks/errors/borrowck/rust-bir-dump.h: Dump methods.
	* checks/errors/borrowck/rust-bir-place.h (std::numeric_limits::max): Scope constants.
	(struct Scope): Scope representation.
	(class PlaceDB): Scope tracking.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../borrowck/rust-bir-builder-expr-stmt.cc    | 32 +++++---
 .../borrowck/rust-bir-builder-internal.h      | 82 +++++++++++++++++--
 .../checks/errors/borrowck/rust-bir-dump.cc   | 52 ++++++++----
 .../checks/errors/borrowck/rust-bir-dump.h    |  3 +
 .../checks/errors/borrowck/rust-bir-place.h   | 56 ++++++++++++-
 5 files changed, 188 insertions(+), 37 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
index ea8107b1fb7..89352d84f6b 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
@@ -37,9 +37,17 @@ ExprStmtBuilder::setup_loop (HIR::BaseLoopExpr &expr)
   PlaceId label_var = take_or_create_return_place (lookup_type (expr));
 
   BasicBlockId continue_bb = new_bb ();
+  push_goto (continue_bb);
+  ctx.current_bb = continue_bb;
+  // falseUnwind
+  start_new_consecutive_bb ();
+
   BasicBlockId break_bb = new_bb ();
-  ctx.loop_and_label_stack.push_back (
-    {true, label, label_var, break_bb, continue_bb});
+  // We are still outside the loop block;
+  ScopeId continue_scope = ctx.place_db.get_current_scope_id () + 1;
+  ctx.loop_and_label_stack.emplace_back (true, label, label_var, break_bb,
+					 continue_bb, continue_scope);
+
   return ctx.loop_and_label_stack.back ();
 }
 
@@ -289,13 +297,16 @@ ExprStmtBuilder::visit (HIR::FieldAccessExpr &expr)
 void
 ExprStmtBuilder::visit (HIR::BlockExpr &block)
 {
+  push_new_scope ();
+
   if (block.has_label ())
     {
       NodeId label
 	= block.get_label ().get_lifetime ().get_mappings ().get_nodeid ();
       PlaceId label_var = take_or_create_return_place (lookup_type (block));
-      ctx.loop_and_label_stack.push_back (
-	{false, label, label_var, new_bb (), INVALID_BB});
+      ctx.loop_and_label_stack.emplace_back (
+	false, label, label_var, new_bb (), INVALID_BB,
+	ctx.place_db.get_current_scope_id ());
     }
 
   // Eliminates dead code after break, continue, return.
@@ -333,6 +344,8 @@ ExprStmtBuilder::visit (HIR::BlockExpr &block)
 				take_or_create_return_place (
 				  lookup_type (*block.get_final_expr ()))));
     }
+
+  pop_scope ();
 }
 
 void
@@ -340,6 +353,8 @@ ExprStmtBuilder::visit (HIR::ContinueExpr &cont)
 {
   LoopAndLabelCtx info = cont.has_label () ? get_label_ctx (cont.get_label ())
 					   : get_unnamed_loop_ctx ();
+  start_new_consecutive_bb ();
+  unwind_until (info.continue_bb);
   push_goto (info.continue_bb);
   // No code allowed after continue. Handled in BlockExpr.
 }
@@ -352,6 +367,8 @@ ExprStmtBuilder::visit (HIR::BreakExpr &brk)
   if (brk.has_break_expr ())
     push_assignment (info.label_var, visit_expr (*brk.get_expr ()));
 
+  start_new_consecutive_bb ();
+  unwind_until (ctx.place_db.get_scope (info.continue_scope).parent);
   push_goto (info.break_bb);
   // No code allowed after continue. Handled in BlockExpr.
 }
@@ -406,6 +423,7 @@ ExprStmtBuilder::visit (HIR::ReturnExpr &ret)
     {
       push_assignment (RETURN_VALUE_PLACE, visit_expr (*ret.get_expr ()));
     }
+  unwind_until (ROOT_SCOPE);
   ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
 }
 
@@ -420,9 +438,6 @@ ExprStmtBuilder::visit (HIR::LoopExpr &expr)
 {
   auto loop = setup_loop (expr);
 
-  push_goto (loop.continue_bb);
-
-  ctx.current_bb = loop.continue_bb;
   (void) visit_expr (*expr.get_loop_block ());
   if (!ctx.get_current_bb ().is_terminated ())
     push_goto (loop.continue_bb);
@@ -435,9 +450,6 @@ ExprStmtBuilder::visit (HIR::WhileLoopExpr &expr)
 {
   auto loop = setup_loop (expr);
 
-  push_goto (loop.continue_bb);
-
-  ctx.current_bb = loop.continue_bb;
   auto cond_val = visit_expr (*expr.get_predicate_expr ());
   auto body_bb = new_bb ();
   push_switch (cond_val, {body_bb, loop.break_bb});
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
index eef0f916408..55f00aa50ac 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
@@ -66,13 +66,17 @@ struct BuilderContext
     PlaceId label_var; // For break with value.
     BasicBlockId break_bb;
     BasicBlockId continue_bb; // Only valid for loops
+    ScopeId continue_scope;
+    // Break scope is the parent of the `continue_scope`.
 
     LoopAndLabelCtx (bool is_loop = false, NodeId label = UNKNOWN_NODEID,
 		     PlaceId label_var = INVALID_PLACE,
 		     BasicBlockId break_bb = INVALID_BB,
-		     BasicBlockId continue_bb = INVALID_BB)
+		     BasicBlockId continue_bb = INVALID_BB,
+		     ScopeId continue_scope = INVALID_SCOPE)
       : is_loop (is_loop), label (label), label_var (label_var),
-	break_bb (break_bb), continue_bb (continue_bb)
+	break_bb (break_bb), continue_bb (continue_bb),
+	continue_scope (continue_scope)
     {}
   };
 
@@ -174,7 +178,37 @@ protected:
     // In debug mode, check that the variable is not already declared.
     rust_assert (ctx.place_db.lookup_variable (nodeid) == INVALID_PLACE);
 
-    return ctx.place_db.add_variable (nodeid, ty);
+    auto place = ctx.place_db.add_variable (nodeid, ty);
+
+    if (ctx.place_db.get_current_scope_id () != 0)
+      push_storage_live (place);
+
+    return place;
+  }
+
+  void push_new_scope () { ctx.place_db.push_new_scope (); }
+
+  void pop_scope ()
+  {
+    auto &scope = ctx.place_db.get_current_scope ();
+    if (ctx.place_db.get_current_scope_id () != 0)
+      {
+	std::for_each (scope.locals.rbegin (), scope.locals.rend (),
+		       [&] (PlaceId place) { push_storage_dead (place); });
+      }
+    ctx.place_db.pop_scope ();
+  }
+
+  void unwind_until (ScopeId final_scope)
+  {
+    auto current_scope_id = ctx.place_db.get_current_scope_id ();
+    while (current_scope_id != final_scope)
+      {
+	auto &scope = ctx.place_db.get_scope (current_scope_id);
+	std::for_each (scope.locals.rbegin (), scope.locals.rend (),
+		       [&] (PlaceId place) { push_storage_dead (place); });
+	current_scope_id = scope.parent;
+      }
   }
 
 protected: // Helpers to add BIR statements
@@ -192,6 +226,7 @@ protected: // Helpers to add BIR statements
   void push_tmp_assignment (AbstractExpr *rhs, TyTy::BaseType *tyty)
   {
     PlaceId tmp = ctx.place_db.add_temporary (tyty);
+    push_storage_live (tmp);
     push_assignment (tmp, rhs);
   }
 
@@ -212,6 +247,18 @@ protected: // Helpers to add BIR statements
       ctx.get_current_bb ().successors.push_back (bb);
   }
 
+  void push_storage_live (PlaceId place)
+  {
+    ctx.get_current_bb ().statements.emplace_back (
+      Statement::Kind::STORAGE_LIVE, place);
+  }
+
+  void push_storage_dead (PlaceId place)
+  {
+    ctx.get_current_bb ().statements.emplace_back (
+      Statement::Kind::STORAGE_DEAD, place);
+  }
+
   PlaceId declare_rvalue (PlaceId place)
   {
     ctx.place_db[place].is_rvalue = true;
@@ -228,7 +275,10 @@ protected: // Helpers to add BIR statements
   {
     auto copy = ctx.place_db.into_rvalue (arg);
     if (copy != arg)
-      push_assignment (copy, arg);
+      {
+	push_storage_live (copy);
+	push_assignment (copy, arg);
+      }
     return copy;
   }
 
@@ -248,7 +298,14 @@ protected: // CFG helpers
   BasicBlockId start_new_consecutive_bb ()
   {
     BasicBlockId bb = new_bb ();
-    ctx.get_current_bb ().successors.emplace_back (bb);
+    if (!ctx.get_current_bb ().is_terminated ())
+      {
+	push_goto (bb);
+      }
+    else
+      {
+	add_jump_to (bb);
+      }
     ctx.current_bb = bb;
     return bb;
   }
@@ -456,10 +513,17 @@ protected:
 
   PlaceId take_or_create_return_place (TyTy::BaseType *type)
   {
-    auto result = (expr_return_place != INVALID_PLACE)
-		    ? expr_return_place
-		    : ctx.place_db.add_temporary (type);
-    expr_return_place = INVALID_PLACE;
+    PlaceId result = INVALID_PLACE;
+    if (expr_return_place != INVALID_PLACE)
+      {
+	result = expr_return_place;
+	expr_return_place = INVALID_PLACE;
+      }
+    else
+      {
+	result = ctx.place_db.add_temporary (type);
+	push_storage_live (result);
+      }
     return result;
   }
 };
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 3684ad7b889..4dea27e3038 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -120,19 +120,7 @@ Dump::go (bool enable_simplify_cfg)
 	 << " {\n";
 
   // Print locals declaration.
-  for (PlaceId id = FIRST_VARIABLE_PLACE; id < func.place_db.size (); ++id)
-    {
-      const Place &place = func.place_db[id];
-      if (place.kind == Place::VARIABLE || place.kind == Place::TEMPORARY)
-	{
-	  if (std::find (func.arguments.begin (), func.arguments.end (), id)
-	      != func.arguments.end ())
-	    continue;
-	  stream << indentation << "let _";
-	  stream << place_map[id] << ": "
-		 << get_tyty_name (func.place_db[id].tyty) << ";\n";
-	}
-    }
+  visit_scope (0);
 
   // Print BBs.
   for (statement_bb = 0; statement_bb < func.basic_blocks.size ();
@@ -200,12 +188,12 @@ Dump::visit (Statement &stmt)
       break;
     case Statement::Kind::STORAGE_DEAD:
       stream << "StorageDead(";
-      visit_move_place (stmt.get_place ());
+      visit_place (stmt.get_place ());
       stream << ")";
       break;
     case Statement::Kind::STORAGE_LIVE:
       stream << "StorageLive(";
-      visit_move_place (stmt.get_place ());
+      visit_place (stmt.get_place ());
       stream << ")";
       break;
     }
@@ -333,11 +321,45 @@ Dump::visit (Operator<2> &expr)
   visit_move_place (expr.get_operand<1> ());
   stream << ")";
 }
+
 void
 Dump::visit (Assignment &expr)
 {
   visit_move_place (expr.get_rhs ());
 }
 
+std::ostream &
+Dump::indent (size_t depth)
+{
+  for (size_t i = 0; i < depth; ++i)
+    stream << indentation;
+  return stream;
+}
+
+void
+Dump::visit_scope (ScopeId id, size_t depth)
+{
+  auto scope = func.place_db.get_scope (id);
+  if (scope.locals.empty () && scope.children.empty ())
+    return;
+
+  if (id > 1)
+    {
+      indent (depth) << "scope " << id - 1 << " {\n";
+    }
+  for (auto &local : scope.locals)
+    {
+      indent (depth + 1) << "let _";
+      stream << place_map[local] << ": "
+	     << get_tyty_name (func.place_db[local].tyty) << ";\n";
+    }
+  for (auto &child : scope.children)
+    {
+      visit_scope (child, (id >= 1) ? depth + 1 : depth);
+    }
+  if (id > 1)
+    indent (depth) << "}\n";
+}
+
 } // namespace BIR
 } // namespace Rust
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
index 7ee94d749e3..cc3f9cdc738 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
@@ -59,6 +59,9 @@ protected:
   void visit (Operator<1> &expr) override;
   void visit (Operator<2> &expr) override;
   void visit (Assignment &expr) override;
+  void visit_scope (ScopeId id, size_t depth = 1);
+
+  std::ostream &indent (size_t depth);
 };
 
 } // namespace BIR
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index e62ec3557ad..61e90d58d26 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -105,12 +105,30 @@ struct Place
   {}
 };
 
+using ScopeId = uint32_t;
+
+static constexpr ScopeId INVALID_SCOPE = std::numeric_limits<ScopeId>::max ();
+/** Arguments and return value are in the root scope. */
+static constexpr ScopeId ROOT_SCOPE = 0;
+/** Top-level local variables are in the top-level scope. */
+static constexpr ScopeId TOP_LEVEL_SCOPE = 1;
+
+struct Scope
+{
+  ScopeId parent = INVALID_SCOPE;
+  std::vector<ScopeId> children;
+  std::vector<PlaceId> locals;
+};
+
 /** Allocated places and keeps track of paths. */
 class PlaceDB
 {
+private:
   // Possible optimizations: separate variables to speedup lookup.
   std::vector<Place> places;
   std::unordered_map<TyTy::BaseType *, PlaceId> constants_lookup;
+  std::vector<Scope> scopes;
+  ScopeId current_scope = 0;
 
 public:
   PlaceDB ()
@@ -118,6 +136,8 @@ public:
     // Reserved index for invalid place.
     places.push_back (
       {Place::INVALID, 0, {}, false, false, NO_LIFETIME, nullptr});
+
+    scopes.emplace_back (); // Root scope.
   }
 
   Place &operator[] (PlaceId id) { return places.at (id); }
@@ -125,6 +145,30 @@ public:
 
   size_t size () const { return places.size (); }
 
+  ScopeId get_current_scope_id () const { return current_scope; }
+
+  const std::vector<Scope> &get_scopes () const { return scopes; }
+
+  const Scope &get_current_scope () const { return scopes[current_scope]; }
+
+  const Scope &get_scope (ScopeId id) const { return scopes[id]; }
+
+  ScopeId push_new_scope ()
+  {
+    ScopeId new_scope = scopes.size ();
+    scopes.emplace_back ();
+    scopes[new_scope].parent = current_scope;
+    scopes[current_scope].children.push_back (new_scope);
+    current_scope = new_scope;
+    return new_scope;
+  }
+
+  ScopeId pop_scope ()
+  {
+    current_scope = scopes[current_scope].parent;
+    return current_scope;
+  }
+
   PlaceId add_place (Place place, PlaceId last_sibling = 0)
   {
     places.push_back (place);
@@ -137,6 +181,12 @@ public:
       {
 	places[last_sibling].path.next_sibling = new_place;
       }
+
+    if (place.kind == Place::VARIABLE || place.kind == Place::TEMPORARY)
+      {
+	scopes[current_scope].locals.push_back (new_place);
+      }
+
     return new_place;
   }
 
@@ -166,9 +216,9 @@ public:
 	    current = places[current].path.next_sibling;
 	  }
       }
-    return add_place (
-      {kind, id, {parent, 0, 0}, is_type_copy (tyty), false, NO_LIFETIME, tyty},
-      current);
+    return add_place ({kind, id, Place::Path{parent, 0, 0}, is_type_copy (tyty),
+		       false, NO_LIFETIME, tyty},
+		      current);
   }
 
   PlaceId add_temporary (TyTy::BaseType *tyty)
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 115/125] gccrs: borrowck: BIR: emit moves
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (112 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 114/125] gccrs: borrowck: BIR: scope handling Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 116/125] gccrs: borrowck: BIR: make BIR visitor const Arthur Cohen
                   ` (9 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Emit moves.
	* checks/errors/borrowck/rust-bir-builder-internal.h: Emit moves.
	* checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Emit moves.
	* checks/errors/borrowck/rust-bir-dump.cc (Dump::visit_move_place): Emit moves.
	(Dump::visit): Emit moves.
	* checks/errors/borrowck/rust-bir-place.h (struct Place): Emit moves.
	* checks/errors/borrowck/rust-bir-visitor.h: Emit moves.
	* checks/errors/borrowck/rust-bir.h (enum class): Emit moves.
	(class AbstractExpr): Emit moves.
	(BasicBlock::is_terminated): Emit moves.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../borrowck/rust-bir-builder-expr-stmt.cc    | 15 +++--
 .../borrowck/rust-bir-builder-internal.h      | 35 ++++------
 .../borrowck/rust-bir-builder-lazyboolexpr.h  |  2 +-
 .../checks/errors/borrowck/rust-bir-dump.cc   | 11 +++-
 .../checks/errors/borrowck/rust-bir-place.h   | 50 ++++++--------
 .../checks/errors/borrowck/rust-bir-visitor.h |  4 ++
 gcc/rust/checks/errors/borrowck/rust-bir.h    | 66 +++++++++++++------
 7 files changed, 103 insertions(+), 80 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
index 89352d84f6b..922894cc5d5 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
@@ -84,7 +84,7 @@ ExprStmtBuilder::visit (HIR::ClosureExpr &expr)
     {
       captures.push_back (ctx.place_db.lookup_variable (capture));
     }
-  make_args (captures);
+  move_all (captures);
 
   // Note: Not a coercion site for captures.
   return_expr (new InitializerExpr (std::move (captures)), lookup_type (expr));
@@ -96,7 +96,7 @@ ExprStmtBuilder::visit (HIR::StructExprStructFields &fields)
   auto struct_ty
     = lookup_type (fields)->as<TyTy::ADTType> ()->get_variants ().at (0);
   auto init_values = StructBuilder (ctx, struct_ty).build (fields);
-  make_args (init_values);
+  move_all (init_values);
   return_expr (new InitializerExpr (std::move (init_values)),
 	       lookup_type (fields));
 }
@@ -141,7 +141,7 @@ void
 ExprStmtBuilder::visit (HIR::NegationExpr &expr)
 {
   PlaceId operand = visit_expr (*expr.get_expr ());
-  return_expr (new Operator<1> ({make_arg (operand)}), lookup_type (expr));
+  return_expr (new Operator<1> ({move_place (operand)}), lookup_type (expr));
 }
 
 void
@@ -149,7 +149,7 @@ ExprStmtBuilder::visit (HIR::ArithmeticOrLogicalExpr &expr)
 {
   PlaceId lhs = visit_expr (*expr.get_lhs ());
   PlaceId rhs = visit_expr (*expr.get_rhs ());
-  return_expr (new Operator<2> ({make_arg (lhs), make_arg (rhs)}),
+  return_expr (new Operator<2> ({move_place (lhs), move_place (rhs)}),
 	       lookup_type (expr));
 }
 
@@ -158,7 +158,7 @@ ExprStmtBuilder::visit (HIR::ComparisonExpr &expr)
 {
   PlaceId lhs = visit_expr (*expr.get_lhs ());
   PlaceId rhs = visit_expr (*expr.get_rhs ());
-  return_expr (new Operator<2> ({make_arg (lhs), make_arg (rhs)}),
+  return_expr (new Operator<2> ({move_place (lhs), move_place (rhs)}),
 	       lookup_type (expr));
 }
 
@@ -208,7 +208,7 @@ ExprStmtBuilder::visit (HIR::ArrayExpr &expr)
       case HIR::ArrayElems::VALUES: {
 	auto &elem_vals = (static_cast<HIR::ArrayElemsValues &> (*elems));
 	auto init_values = visit_list (elem_vals.get_values ());
-	make_args (init_values);
+	move_all (init_values);
 	return_expr (new InitializerExpr (std::move (init_values)),
 		     lookup_type (expr));
 	break;
@@ -264,6 +264,7 @@ ExprStmtBuilder::visit (HIR::CallExpr &expr)
       coercion_site (arguments[i], fn_type->get_param_type_at (i));
     }
 
+  move_all (arguments);
   return_expr (new CallExpr (fn, std::move (arguments)), lookup_type (expr),
 	       true);
 }
@@ -502,7 +503,7 @@ ExprStmtBuilder::visit (HIR::IfExpr &expr)
 void
 ExprStmtBuilder::visit (HIR::IfExprConseqElse &expr)
 {
-  push_switch (make_arg (visit_expr (*expr.get_if_condition ())));
+  push_switch (move_place (visit_expr (*expr.get_if_condition ())));
   BasicBlockId if_end_bb = ctx.current_bb;
 
   PlaceId result = take_or_create_return_place (lookup_type (expr));
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
index 55f00aa50ac..b421ba43fba 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
@@ -230,10 +230,15 @@ protected: // Helpers to add BIR statements
     push_assignment (tmp, rhs);
   }
 
+  void push_tmp_assignment (PlaceId rhs)
+  {
+    push_tmp_assignment (new Assignment (rhs), ctx.place_db[rhs].tyty);
+  }
+
   void push_switch (PlaceId switch_val,
 		    std::initializer_list<BasicBlockId> destinations = {})
   {
-    auto copy = make_arg (switch_val);
+    auto copy = move_place (switch_val);
     ctx.get_current_bb ().statements.emplace_back (Statement::Kind::SWITCH,
 						   copy);
     ctx.get_current_bb ().successors.insert (
@@ -259,33 +264,21 @@ protected: // Helpers to add BIR statements
       Statement::Kind::STORAGE_DEAD, place);
   }
 
-  PlaceId declare_rvalue (PlaceId place)
+  PlaceId move_place (PlaceId arg)
   {
-    ctx.place_db[place].is_rvalue = true;
-    return place;
-  }
-
-  void declare_rvalues (std::vector<PlaceId> &places)
-  {
-    for (auto &place : places)
-      declare_rvalue (place);
-  }
-
-  PlaceId make_arg (PlaceId arg)
-  {
-    auto copy = ctx.place_db.into_rvalue (arg);
-    if (copy != arg)
+    if (ctx.place_db[arg].is_lvalue ())
       {
-	push_storage_live (copy);
-	push_assignment (copy, arg);
+	push_tmp_assignment (arg);
+	arg = translated;
       }
-    return copy;
+
+    return arg;
   }
 
-  void make_args (std::vector<PlaceId> &args)
+  template <typename T> void move_all (T &args)
   {
     std::transform (args.begin (), args.end (), args.begin (),
-		    [this] (PlaceId arg) { return make_arg (arg); });
+		    [this] (PlaceId arg) { return move_place (arg); });
   }
 
 protected: // CFG helpers
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h
index fb0c75b4f72..1cc55569c7c 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h
@@ -62,7 +62,7 @@ protected:
   void visit (HIR::LazyBooleanExpr &expr) override
   {
     auto lhs = visit_expr (*expr.get_lhs ());
-    push_switch (make_arg (lhs), {short_circuit_bb});
+    push_switch (move_place (lhs), {short_circuit_bb});
 
     start_new_consecutive_bb ();
     return_place (visit_expr (*expr.get_rhs ()));
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 4dea27e3038..320b653f830 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -241,7 +241,7 @@ void
 Dump::visit_move_place (PlaceId place_id)
 {
   const Place &place = func.place_db[place_id];
-  if (place.is_rvalue || !place.is_copy)
+  if (!place.is_constant ())
     stream << "move ";
   visit_place (place_id);
 }
@@ -325,7 +325,14 @@ Dump::visit (Operator<2> &expr)
 void
 Dump::visit (Assignment &expr)
 {
-  visit_move_place (expr.get_rhs ());
+  if (func.place_db[expr.get_rhs ()].is_rvalue ())
+    {
+      visit_move_place (expr.get_rhs ());
+    }
+  else
+    {
+      visit_place (expr.get_rhs ());
+    }
 }
 
 std::ostream &
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index 61e90d58d26..546890d797c 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -91,18 +91,26 @@ struct Place
   } path;
   /** Copy trait */
   bool is_copy;
-  /** This place can be moved from safety. */
-  bool is_rvalue;
+  bool has_drop = false;
   Lifetime lifetime;
   TyTy::BaseType *tyty;
 
+public:
   Place (Kind kind, uint32_t variable_or_field_index, const Path &path,
-	 bool is_copy, bool is_rvalue, const Lifetime &lifetime,
-	 TyTy::BaseType *tyty)
+	 bool is_copy, const Lifetime &lifetime, TyTy::BaseType *tyty)
     : kind (kind), variable_or_field_index (variable_or_field_index),
-      path (path), is_copy (is_copy), is_rvalue (is_rvalue),
-      lifetime (lifetime), tyty (tyty)
+      path (path), is_copy (is_copy), lifetime (lifetime), tyty (tyty)
   {}
+
+public:
+  [[nodiscard]] bool is_lvalue () const
+  {
+    return kind == VARIABLE || kind == FIELD || kind == INDEX || kind == DEREF;
+  }
+
+  [[nodiscard]] bool is_rvalue () const { return kind == TEMPORARY; }
+
+  bool is_constant () const { return kind == CONSTANT; }
 };
 
 using ScopeId = uint32_t;
@@ -134,8 +142,7 @@ public:
   PlaceDB ()
   {
     // Reserved index for invalid place.
-    places.push_back (
-      {Place::INVALID, 0, {}, false, false, NO_LIFETIME, nullptr});
+    places.push_back ({Place::INVALID, 0, {}, false, NO_LIFETIME, nullptr});
 
     scopes.emplace_back (); // Root scope.
   }
@@ -193,8 +200,7 @@ public:
   PlaceId add_variable (NodeId id, TyTy::BaseType *tyty)
   {
     return add_place (
-      {Place::VARIABLE, id, {}, is_type_copy (tyty), false, NO_LIFETIME, tyty},
-      0);
+      {Place::VARIABLE, id, {}, is_type_copy (tyty), NO_LIFETIME, tyty}, 0);
   }
 
   WARN_UNUSED_RESULT PlaceId lookup_or_add_path (Place::Kind kind,
@@ -217,15 +223,14 @@ public:
 	  }
       }
     return add_place ({kind, id, Place::Path{parent, 0, 0}, is_type_copy (tyty),
-		       false, NO_LIFETIME, tyty},
+		       NO_LIFETIME, tyty},
 		      current);
   }
 
   PlaceId add_temporary (TyTy::BaseType *tyty)
   {
     return add_place (
-      {Place::TEMPORARY, 0, {}, is_type_copy (tyty), false, NO_LIFETIME, tyty},
-      0);
+      {Place::TEMPORARY, 0, {}, is_type_copy (tyty), NO_LIFETIME, tyty}, 0);
   }
 
   PlaceId get_constant (TyTy::BaseType *tyty)
@@ -235,8 +240,7 @@ public:
       return lookup->second;
     Lifetime lifetime
       = tyty->get_kind () == TyTy::REF ? STATIC_LIFETIME : NO_LIFETIME;
-    Place place
-      = {Place::CONSTANT, 0, {}, is_type_copy (tyty), false, lifetime, tyty};
+    Place place = {Place::CONSTANT, 0, {}, is_type_copy (tyty), lifetime, tyty};
     places.push_back (place);
     return places.size () - 1;
   }
@@ -261,24 +265,10 @@ public:
     if (lookup != INVALID_PLACE)
       return lookup;
     add_place (
-      {Place::VARIABLE, id, {}, is_type_copy (tyty), false, NO_LIFETIME, tyty});
+      {Place::VARIABLE, id, {}, is_type_copy (tyty), NO_LIFETIME, tyty});
     return places.size () - 1;
   };
 
-  PlaceId into_rvalue (PlaceId place)
-  {
-    if (places[place].is_rvalue || places[place].kind == Place::CONSTANT
-	|| places[place].tyty->get_kind () == TyTy::REF)
-      return place;
-    return add_place ({Place::TEMPORARY,
-		       0,
-		       {},
-		       places[place].is_copy,
-		       true,
-		       NO_LIFETIME,
-		       places[place].tyty});
-  }
-
   template <typename FN> void for_each_path_from_root (PlaceId var, FN fn) const
   {
     PlaceId current = var;
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h b/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
index 0b3a4bddbec..7ad62f700db 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
@@ -50,6 +50,10 @@ public:
 template <typename BASE, typename T> class VisitableImpl : public BASE
 {
 public:
+  template <typename... Args>
+  explicit VisitableImpl (Args &&... args) : BASE (std::forward<Args> (args)...)
+  {}
+
   void accept_vis (Visitor &visitor) override
   {
     visitor.visit (static_cast<T &> (*this));
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir.h b/gcc/rust/checks/errors/borrowck/rust-bir.h
index 746b2dc7e38..f8a2151aaf8 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir.h
@@ -97,20 +97,7 @@ struct BasicBlock
   std::vector<BasicBlockId> successors;
 
 public:
-  WARN_UNUSED_RESULT bool is_terminated () const
-  {
-    if (statements.empty ())
-      return false;
-    switch (statements.back ().get_kind ())
-      {
-      case Statement::Kind::GOTO:
-      case Statement::Kind::RETURN:
-      case Statement::Kind::SWITCH:
-	return true;
-      default:
-	return false;
-      }
-  }
+  WARN_UNUSED_RESULT bool is_terminated () const;
 
   WARN_UNUSED_RESULT bool is_goto_terminated () const
   {
@@ -119,9 +106,23 @@ public:
   }
 };
 
+enum class ExprKind
+{
+  INITIALIZER,
+  OPERATOR,
+  BORROW,
+  ASSIGNMENT,
+  CALL,
+};
+
 // Rhs expression of BIR assignment statements (abstract).
 class AbstractExpr : public Visitable
 {
+  ExprKind kind;
+
+public:
+  explicit AbstractExpr (ExprKind kind) : kind (kind) {}
+  [[nodiscard]] ExprKind get_kind () const { return kind; }
 };
 
 class InitializerExpr : public VisitableImpl<AbstractExpr, InitializerExpr>
@@ -129,7 +130,10 @@ class InitializerExpr : public VisitableImpl<AbstractExpr, InitializerExpr>
   std::vector<PlaceId> values;
 
 public:
-  explicit InitializerExpr (std::vector<PlaceId> &&values) : values (values) {}
+  explicit InitializerExpr (std::vector<PlaceId> &&values)
+    : VisitableImpl<AbstractExpr, InitializerExpr> (ExprKind::INITIALIZER),
+      values (values)
+  {}
 
 public:
   std::vector<PlaceId> &get_values () { return values; }
@@ -142,7 +146,8 @@ class Operator : public VisitableImpl<AbstractExpr, Operator<ARITY>>
 
 public:
   explicit Operator (std::array<PlaceId, ARITY> &&operands)
-    : operands (operands)
+    : VisitableImpl<AbstractExpr, Operator<ARITY>> (ExprKind::OPERATOR),
+      operands (operands)
   {}
 
 public:
@@ -158,7 +163,9 @@ class BorrowExpr : public VisitableImpl<AbstractExpr, BorrowExpr>
   PlaceId place;
 
 public:
-  explicit BorrowExpr (PlaceId place) : place (place) {}
+  explicit BorrowExpr (PlaceId place)
+    : VisitableImpl<AbstractExpr, BorrowExpr> (ExprKind::BORROW), place (place)
+  {}
   WARN_UNUSED_RESULT PlaceId get_place () const { return place; }
 };
 
@@ -172,7 +179,9 @@ class Assignment : public VisitableImpl<AbstractExpr, Assignment>
   PlaceId rhs;
 
 public:
-  explicit Assignment (PlaceId rhs) : rhs (rhs) {}
+  explicit Assignment (PlaceId rhs)
+    : VisitableImpl<AbstractExpr, Assignment> (ExprKind::ASSIGNMENT), rhs (rhs)
+  {}
 
 public:
   WARN_UNUSED_RESULT PlaceId get_rhs () const { return rhs; }
@@ -185,7 +194,8 @@ class CallExpr : public VisitableImpl<AbstractExpr, CallExpr>
 
 public:
   explicit CallExpr (PlaceId callable, std::vector<PlaceId> &&arguments)
-    : arguments (arguments), callable (callable)
+    : VisitableImpl<AbstractExpr, CallExpr> (ExprKind::CALL),
+      arguments (arguments), callable (callable)
   {}
 
 public:
@@ -193,6 +203,24 @@ public:
   WARN_UNUSED_RESULT PlaceId get_callable () const { return callable; }
 };
 
+inline bool
+BasicBlock::is_terminated () const
+{
+  if (statements.empty ())
+    return false;
+  switch (statements.back ().get_kind ())
+    {
+    case Statement::Kind::GOTO:
+    case Statement::Kind::RETURN:
+    case Statement::Kind::SWITCH:
+      return true;
+    case Statement::Kind::ASSIGNMENT:
+      return statements.back ().get_expr ().get_kind () == ExprKind::CALL;
+    default:
+      return false;
+    }
+}
+
 } // namespace BIR
 
 } // namespace Rust
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 116/125] gccrs: borrowck: BIR: make BIR visitor const
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (113 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 115/125] gccrs: borrowck: BIR: emit moves Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 117/125] gccrs: borrowck: Polonius FFI Arthur Cohen
                   ` (8 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-dump.cc (Dump::visit): const
	visitor
	* checks/errors/borrowck/rust-bir-dump.h: const visitor
	* checks/errors/borrowck/rust-bir-visitor.h: const visitor
	* checks/errors/borrowck/rust-bir.h: const getter

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/checks/errors/borrowck/rust-bir-dump.cc   | 14 +++++++-------
 gcc/rust/checks/errors/borrowck/rust-bir-dump.h    | 14 +++++++-------
 gcc/rust/checks/errors/borrowck/rust-bir-visitor.h | 14 +++++++-------
 gcc/rust/checks/errors/borrowck/rust-bir.h         |  6 +++++-
 4 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 320b653f830..6f1579df1d9 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -155,7 +155,7 @@ Dump::go (bool enable_simplify_cfg)
   stream << "}\n";
 }
 void
-Dump::visit (Statement &stmt)
+Dump::visit (const Statement &stmt)
 {
   statement_place = stmt.get_place ();
   switch (stmt.get_kind ())
@@ -247,7 +247,7 @@ Dump::visit_move_place (PlaceId place_id)
 }
 
 void
-Dump::visit (BorrowExpr &expr)
+Dump::visit (const BorrowExpr &expr)
 {
   stream << "&";
   visit_lifetime (statement_place);
@@ -268,7 +268,7 @@ Dump::visit_lifetime (PlaceId place_id)
 }
 
 void
-Dump::visit (InitializerExpr &expr)
+Dump::visit (const InitializerExpr &expr)
 {
   stream << "{";
   print_comma_separated (stream, expr.get_values (), [this] (PlaceId place_id) {
@@ -278,7 +278,7 @@ Dump::visit (InitializerExpr &expr)
 }
 
 void
-Dump::visit (CallExpr &expr)
+Dump::visit (const CallExpr &expr)
 {
   stream << "Call(";
   if (auto fn_type
@@ -305,7 +305,7 @@ Dump::visit (CallExpr &expr)
 }
 
 void
-Dump::visit (Operator<1> &expr)
+Dump::visit (const Operator<1> &expr)
 {
   stream << "Operator(";
   visit_move_place (expr.get_operand<0> ());
@@ -313,7 +313,7 @@ Dump::visit (Operator<1> &expr)
 }
 
 void
-Dump::visit (Operator<2> &expr)
+Dump::visit (const Operator<2> &expr)
 {
   stream << "Operator(";
   visit_move_place (expr.get_operand<0> ());
@@ -323,7 +323,7 @@ Dump::visit (Operator<2> &expr)
 }
 
 void
-Dump::visit (Assignment &expr)
+Dump::visit (const Assignment &expr)
 {
   if (func.place_db[expr.get_rhs ()].is_rvalue ())
     {
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
index cc3f9cdc738..9d6babd0053 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.h
@@ -49,16 +49,16 @@ public:
   void go (bool enable_simplify_cfg = false);
 
 protected:
-  void visit (Statement &stmt) override;
+  void visit (const Statement &stmt) override;
   void visit_place (PlaceId place_id);
   void visit_move_place (PlaceId place_id);
-  void visit (BorrowExpr &expr) override;
+  void visit (const BorrowExpr &expr) override;
   void visit_lifetime (PlaceId place_id);
-  void visit (InitializerExpr &expr) override;
-  void visit (CallExpr &expr) override;
-  void visit (Operator<1> &expr) override;
-  void visit (Operator<2> &expr) override;
-  void visit (Assignment &expr) override;
+  void visit (const InitializerExpr &expr) override;
+  void visit (const CallExpr &expr) override;
+  void visit (const Operator<1> &expr) override;
+  void visit (const Operator<2> &expr) override;
+  void visit (const Assignment &expr) override;
   void visit_scope (ScopeId id, size_t depth = 1);
 
   std::ostream &indent (size_t depth);
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h b/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
index 7ad62f700db..2371b8bb5ce 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
@@ -32,13 +32,13 @@ class CallExpr;
 class Visitor
 {
 public:
-  virtual void visit (Statement &stmt) = 0;
-  virtual void visit (InitializerExpr &expr) = 0;
-  virtual void visit (Operator<1> &expr) = 0;
-  virtual void visit (Operator<2> &expr) = 0;
-  virtual void visit (BorrowExpr &expr) = 0;
-  virtual void visit (Assignment &expr) = 0;
-  virtual void visit (CallExpr &expr) = 0;
+  virtual void visit (const Statement &stmt) = 0;
+  virtual void visit (const InitializerExpr &expr) = 0;
+  virtual void visit (const Operator<1> &expr) = 0;
+  virtual void visit (const Operator<2> &expr) = 0;
+  virtual void visit (const BorrowExpr &expr) = 0;
+  virtual void visit (const Assignment &expr) = 0;
+  virtual void visit (const CallExpr &expr) = 0;
 };
 
 class Visitable
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir.h b/gcc/rust/checks/errors/borrowck/rust-bir.h
index f8a2151aaf8..d21cb90abf5 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir.h
@@ -137,6 +137,10 @@ public:
 
 public:
   std::vector<PlaceId> &get_values () { return values; }
+  WARN_UNUSED_RESULT const std::vector<PlaceId> &get_values () const
+  {
+    return values;
+  }
 };
 
 template <unsigned ARITY>
@@ -199,7 +203,7 @@ public:
   {}
 
 public:
-  const std::vector<PlaceId> &get_arguments () { return arguments; }
+  const std::vector<PlaceId> &get_arguments () const { return arguments; }
   WARN_UNUSED_RESULT PlaceId get_callable () const { return callable; }
 };
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 117/125] gccrs: borrowck: Polonius FFI
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (114 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 116/125] gccrs: borrowck: BIR: make BIR visitor const Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 118/125] gccrs: borrowck: Free region representation Arthur Cohen
                   ` (7 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

Rust part is not build and not invoked at this point.

gcc/rust/ChangeLog:

	* checks/errors/borrowck/ffi-polonius/Cargo.toml: New file.
	* checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: New file.
	* checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs: New file.
	* checks/errors/borrowck/ffi-polonius/src/lib.rs: New file.
	* checks/errors/borrowck/polonius/rust-polonius-ffi.h: New file.
	* checks/errors/borrowck/polonius/rust-polonius.h: New file.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../errors/borrowck/ffi-polonius/Cargo.toml   |  11 +
 .../borrowck/ffi-polonius/src/gccrs_ffi.rs    |  61 +++++
 .../ffi-polonius/src/gccrs_ffi_generated.rs   |  50 ++++
 .../errors/borrowck/ffi-polonius/src/lib.rs   | 133 ++++++++++
 .../borrowck/polonius/rust-polonius-ffi.h     | 109 ++++++++
 .../errors/borrowck/polonius/rust-polonius.h  | 232 ++++++++++++++++++
 6 files changed, 596 insertions(+)
 create mode 100644 gcc/rust/checks/errors/borrowck/ffi-polonius/Cargo.toml
 create mode 100644 gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
 create mode 100644 gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs
 create mode 100644 gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
 create mode 100644 gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
 create mode 100644 gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h

diff --git a/gcc/rust/checks/errors/borrowck/ffi-polonius/Cargo.toml b/gcc/rust/checks/errors/borrowck/ffi-polonius/Cargo.toml
new file mode 100644
index 00000000000..71315c3b635
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/ffi-polonius/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "ffi-polonius"
+version = "0.1.0"
+edition = "2021"
+license = "GPL-3"
+
+[lib]
+crate-type = ["staticlib"]
+
+[dependencies]
+polonius-engine = "0.13.0"
\ No newline at end of file
diff --git a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
new file mode 100644
index 00000000000..3a849444bbc
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
@@ -0,0 +1,61 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// This is an FFI interface to gccrs (c++).
+// It is a counterpart to `rust-polonius-ffi.h`.
+
+// Generated by rust-bindgen, remove unsafe phantoms and add Into impls.
+// ```shell
+// bindgen \
+//  --generate types \
+//  --allowlist-file rust-polonius-facts-ffi.h
+//  --no-layout-tests
+//  rust-polonius-ffi.h
+//  -- -x c++
+// ```
+include!("gccrs_ffi_generated.rs");
+
+use crate::GccrsAtom;
+
+impl<T1, T2> Into<(GccrsAtom, GccrsAtom)> for Pair<T1, T2>
+where
+    GccrsAtom: From<T1> + From<T2>,
+{
+    fn into(self) -> (GccrsAtom, GccrsAtom) {
+        (self.first.into(), self.second.into())
+    }
+}
+
+impl<T1, T2, T3> Into<(GccrsAtom, GccrsAtom, GccrsAtom)> for Triple<T1, T2, T3>
+where
+    GccrsAtom: From<T1> + From<T2> + From<T3>,
+{
+    fn into(self) -> (GccrsAtom, GccrsAtom, GccrsAtom) {
+        (self.first.into(), self.second.into(), self.third.into())
+    }
+}
+
+impl<OUT, IN> Into<Vec<OUT>> for Slice<IN>
+where
+    IN: Into<OUT> + Copy,
+{
+    fn into(self) -> Vec<OUT> {
+        let slice = unsafe { std::slice::from_raw_parts(self.data, self.len as usize) };
+        slice.iter().map(|&e| e.into()).collect()
+    }
+}
diff --git a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs
new file mode 100644
index 00000000000..20908179528
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs
@@ -0,0 +1,50 @@
+pub type Origin = usize;
+pub type Loan = usize;
+pub type Point = usize;
+pub type Variable = usize;
+pub type Path = usize;
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Pair<T1, T2> {
+    pub first: T1,
+    pub second: T2,
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Triple<T1, T2, T3> {
+    pub first: T1,
+    pub second: T2,
+    pub third: T3,
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Slice<T> {
+    pub len: usize,
+    pub data: *const T,
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct FactsView {
+    pub loan_issued_at: Slice<Triple<Origin, Loan, Point>>,
+    pub universal_region: Slice<Origin>,
+    pub cfg_edge: Slice<Pair<Point, Point>>,
+    pub loan_killed_at: Slice<Pair<Loan, Point>>,
+    pub subset_base: Slice<Triple<Origin, Origin, Point>>,
+    pub loan_invalidated_at: Slice<Pair<Point, Loan>>,
+    pub var_used_at: Slice<Pair<Variable, Point>>,
+    pub var_defined_at: Slice<Pair<Variable, Point>>,
+    pub var_dropped_at: Slice<Pair<Variable, Point>>,
+    pub use_of_var_derefs_origin: Slice<Pair<Variable, Origin>>,
+    pub drop_of_var_derefs_origin: Slice<Pair<Variable, Origin>>,
+    pub child_path: Slice<Pair<Path, Path>>,
+    pub path_is_var: Slice<Pair<Path, Variable>>,
+    pub path_assigned_at_base: Slice<Pair<Path, Point>>,
+    pub path_moved_at_base: Slice<Pair<Path, Point>>,
+    pub path_accessed_at_base: Slice<Pair<Path, Point>>,
+    pub known_placeholder_subset: Slice<Pair<Origin, Origin>>,
+    pub placeholder: Slice<Pair<Origin, Loan>>,
+}
diff --git a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
new file mode 100644
index 00000000000..a9aa8106b69
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
@@ -0,0 +1,133 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+mod gccrs_ffi;
+mod gccrs_ffi_generated;
+
+use polonius_engine::{AllFacts, Atom, FactTypes, Output};
+use std::fmt::Debug;
+use std::hash::Hash;
+
+/// A single fact value.
+/// For simplicity we use one type for all facts.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
+struct GccrsAtom(usize);
+
+impl Atom for GccrsAtom {
+    fn index(self) -> usize {
+        self.0
+    }
+}
+
+impl From<usize> for GccrsAtom {
+    fn from(inner: usize) -> GccrsAtom {
+        GccrsAtom(inner)
+    }
+}
+
+impl From<GccrsAtom> for usize {
+    fn from(atom: GccrsAtom) -> Self {
+        atom.index()
+    }
+}
+
+#[derive(Debug, Clone, Copy, Default)]
+struct GccrsFacts;
+
+impl FactTypes for GccrsFacts {
+    type Origin = GccrsAtom;
+    type Loan = GccrsAtom;
+    type Point = GccrsAtom;
+    type Variable = GccrsAtom;
+    type Path = GccrsAtom;
+}
+
+impl From<gccrs_ffi::FactsView> for AllFacts<GccrsFacts> {
+    fn from(input: gccrs_ffi::FactsView) -> Self {
+        AllFacts::<GccrsFacts> {
+            loan_issued_at: input.loan_issued_at.into(),
+            universal_region: input.universal_region.into(),
+            cfg_edge: input.cfg_edge.into(),
+            loan_killed_at: input.loan_killed_at.into(),
+            subset_base: input.subset_base.into(),
+            loan_invalidated_at: input.loan_invalidated_at.into(),
+            var_used_at: input.var_used_at.into(),
+            var_defined_at: input.var_defined_at.into(),
+            var_dropped_at: input.var_dropped_at.into(),
+            use_of_var_derefs_origin: input.use_of_var_derefs_origin.into(),
+            drop_of_var_derefs_origin: input.drop_of_var_derefs_origin.into(),
+            child_path: input.child_path.into(),
+            path_is_var: input.path_is_var.into(),
+            path_assigned_at_base: input.path_assigned_at_base.into(),
+            path_moved_at_base: input.path_moved_at_base.into(),
+            path_accessed_at_base: input.path_accessed_at_base.into(),
+            known_placeholder_subset: input.known_placeholder_subset.into(),
+            placeholder: input.placeholder.into(),
+        }
+    }
+}
+
+fn print_point(point: GccrsAtom) {
+    let val: usize = point.into();
+    let mid = val % 2 == 1;
+    let bb = val >> 16;
+    let stmt = (val >> 1) & 0xFFFF;
+    print!("{}(bb{}[{}])", if mid { "Mid" } else { "Start" }, bb, stmt);
+}
+
+/// Run the polonius analysis on the given facts (for a single function).
+/// Right now, results are only printed and not propagated back to the gccrs.
+#[no_mangle]
+pub unsafe extern "C" fn polonius_run(input: gccrs_ffi::FactsView, dump_enabled: bool) {
+    let facts = AllFacts::<GccrsFacts>::from(input);
+    let output = Output::compute(&facts, polonius_engine::Algorithm::Naive, dump_enabled);
+
+    // FIXME: Temporary output
+    println!("Polonius analysis completed. Results:");
+    println!("Errors: {:#?}", output.errors);
+    println!("Subset error: {:#?}", output.subset_errors);
+    println!("Move error: {:#?}", output.move_errors);
+
+    println!("Subsets:");
+    let mut subset_vec: Vec<_> = output.subset.iter().collect();
+    subset_vec.sort_by_key(|&(point, _)| point);
+    for (point, subsets) in subset_vec {
+        print_point(*point);
+        println!(": {{");
+        for (&lhs, rhss) in subsets {
+            for &rhs in rhss {
+                println!("    {} <= {}", usize::from(lhs), usize::from(rhs));
+            }
+        }
+        println!("}}");
+    }
+    println!("Subset anywhere: {:#?}", output.subset_anywhere);
+
+    // Print origin live on entry
+    println!("Origin live on entry:");
+    let mut origin_vec: Vec<_> = output.origin_live_on_entry.iter().collect();
+    origin_vec.sort_by_key(|&(point, _)| point);
+    for (point, origins) in origin_vec {
+        print_point(*point);
+        println!(": {{");
+        for &origin in origins {
+            println!("    {}", usize::from(origin));
+        }
+        println!("}}");
+    }
+}
diff --git a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
new file mode 100644
index 00000000000..500d25a3222
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
@@ -0,0 +1,109 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_POLONIUS_FACTS_FFI_H
+#define RUST_POLONIUS_FACTS_FFI_H
+
+#include "rust-system.h"
+
+// This file defines the C++ side of the FFI interface to Polonius.
+// The corresponding Rust side is in `gccrs-ffi.rs`.
+
+// IMPORTANT:
+// This file intentionally does not include any C++ headers
+// to allow seamless binding generation on the Rust side.
+
+namespace Rust {
+namespace Polonius {
+
+using Origin = size_t;
+using Loan = size_t;
+/**
+ * Compressed CFG point
+ * Encoding:
+ *  - (bit size - 16) bits: basic block index
+ *  - 15 bits: stmt index inside basic block
+ *  - 1bit: start or mid
+ *
+ * Note: Polonius requires the holding type to be `size_t`/`usize`.
+ */
+using Point = size_t;
+using Variable = size_t;
+using Path = size_t;
+
+namespace FFI {
+
+// NOTE: std::pair and std::tuple are complicating the bindings' generation.
+template <typename T1, typename T2> struct Pair
+{
+  T1 first;
+  T2 second;
+
+  Pair (T1 first, T2 second) : first (first), second (second) {}
+};
+
+template <typename T1, typename T2, typename T3> struct Triple
+{
+  T1 first;
+  T2 second;
+  T3 third;
+
+  Triple (T1 first, T2 second, T3 third)
+    : first (first), second (second), third (third)
+  {}
+};
+
+/** Frozen variant to vector for FFI */
+template <typename T> struct Slice
+{
+  size_t len;
+  const T *const data;
+
+  template <typename vector>
+  Slice (const vector &v) : len (v.size ()), data (v.data ())
+  {}
+};
+
+/** Frozen variant of the facts with C ABI and no methods. */
+struct FactsView
+{
+  Slice<Triple<Origin, Loan, Point>> loan_issued_at;
+  Slice<Origin> universal_region;
+  Slice<Pair<Point, Point>> cfg_edge;
+  Slice<Pair<Loan, Point>> loan_killed_at;
+  Slice<Triple<Origin, Origin, Point>> subset_base;
+  Slice<Pair<Point, Loan>> loan_invalidated_at;
+  Slice<Pair<Variable, Point>> var_used_at;
+  Slice<Pair<Variable, Point>> var_defined_at;
+  Slice<Pair<Variable, Point>> var_dropped_at;
+  Slice<Pair<Variable, Origin>> use_of_var_derefs_origin;
+  Slice<Pair<Variable, Origin>> drop_of_var_derefs_origin;
+  Slice<Pair<Path, Path>> child_path;
+  Slice<Pair<Path, Variable>> path_is_var;
+  Slice<Pair<Path, Point>> path_assigned_at_base;
+  Slice<Pair<Path, Point>> path_moved_at_base;
+  Slice<Pair<Path, Point>> path_accessed_at_base;
+  Slice<Pair<Origin, Origin>> known_placeholder_subset;
+  Slice<Pair<Origin, Loan>> placeholder;
+};
+
+} // namespace FFI
+} // namespace Polonius
+} // namespace Rust
+
+#endif // RUST_POLONIUS_FACTS_FFI_H
diff --git a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
new file mode 100644
index 00000000000..df746dd0c76
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
@@ -0,0 +1,232 @@
+// Copyright (C) 2020-2022 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_POLONIUS_H
+#define RUST_POLONIUS_H
+
+// Interface to the Polonius borrow checker engine.
+// See (https://github.com/rust-lang/polonius/blob/master/polonius-engine/)
+
+#include <ostream>
+#include "rust-polonius-ffi.h"
+
+namespace Rust {
+namespace Polonius {
+
+/** A point in the control flow graph. */
+struct FullPoint
+{
+  uint32_t bb;
+  uint32_t stmt;
+  bool mid;
+
+  /** Expands a compressed `Point` into its components.
+   * See `Point` docs for encoding details.
+   */
+  explicit FullPoint (Point point)
+    : bb (extract_bb (point)), stmt (extract_stmt (point)),
+      mid (extract_mid (point))
+  {}
+
+  static uint32_t extract_bb (Point point) { return point >> 16; }
+  static uint32_t extract_stmt (Point point)
+  {
+    return (point & ~(1 << 16)) >> 1;
+  }
+  static bool extract_mid (Point point) { return point & 1; }
+
+  friend std::ostream &operator<< (std::ostream &os, const FullPoint &point)
+  {
+    return os << ((point.mid) ? "Mid" : "Start") << "(bb" << point.bb << "["
+	      << point.stmt << "])";
+  }
+};
+
+struct Facts
+{
+  // See (https://rust-lang.github.io/polonius/rules/relations.html)
+  std::vector<FFI::Triple<Origin, Loan, Point>> loan_issued_at;
+  std::vector<Origin> universal_region;
+  std::vector<FFI::Pair<Point, Point>> cfg_edge;
+  std::vector<FFI::Pair<Loan, Point>> loan_killed_at;
+  std::vector<FFI::Triple<Origin, Origin, Point>> subset_base;
+  std::vector<FFI::Pair<Point, Loan>> loan_invalidated_at;
+  std::vector<FFI::Pair<Variable, Point>> var_used_at;
+  std::vector<FFI::Pair<Variable, Point>> var_defined_at;
+  std::vector<FFI::Pair<Variable, Point>> var_dropped_at;
+  std::vector<FFI::Pair<Variable, Origin>> use_of_var_derefs_origin;
+  std::vector<FFI::Pair<Variable, Origin>> drop_of_var_derefs_origin;
+  std::vector<FFI::Pair<Path, Path>> child_path;
+  std::vector<FFI::Pair<Path, Variable>> path_is_var;
+  std::vector<FFI::Pair<Path, Point>> path_assigned_at_base;
+  std::vector<FFI::Pair<Path, Point>> path_moved_at_base;
+  std::vector<FFI::Pair<Path, Point>> path_accessed_at_base;
+  std::vector<FFI::Pair<Origin, Origin>> known_placeholder_subset;
+  std::vector<FFI::Pair<Origin, Loan>> placeholder;
+
+  /**
+   * Create a const view for the struct for FFI.
+   *
+   * This view uses the original vector storage.
+   * Therefore any resizing operation of Facts member may invalidate the view.
+   */
+  FFI::FactsView freeze ()
+  {
+    return FFI::FactsView{loan_issued_at,
+			  universal_region,
+			  cfg_edge,
+			  loan_killed_at,
+			  subset_base,
+			  loan_invalidated_at,
+			  var_used_at,
+			  var_defined_at,
+			  var_dropped_at,
+			  use_of_var_derefs_origin,
+			  drop_of_var_derefs_origin,
+			  child_path,
+			  path_is_var,
+			  path_assigned_at_base,
+			  path_moved_at_base,
+			  path_accessed_at_base,
+			  known_placeholder_subset,
+			  placeholder};
+  }
+
+  void dump_loan_issued_at (std::ostream &os) const
+  {
+    for (auto &e : loan_issued_at)
+      os << "\"'?" << e.first << "\"\t\"bw" << e.second << "\"\t\""
+	 << FullPoint (e.third) << "\"\n";
+  }
+
+  void dump_universal_region (std::ostream &os) const
+  {
+    for (auto &e : universal_region)
+      os << e << "\n";
+  }
+
+  void dump_cfg_edge (std::ostream &os) const
+  {
+    for (auto &e : cfg_edge)
+      os << FullPoint (e.first) << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_loan_killed_at (std::ostream &os) const
+  {
+    for (auto &e : loan_killed_at)
+      os << e.first << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_subset_base (std::ostream &os) const
+  {
+    for (auto &e : subset_base)
+      os << "\"'?" << e.first << "\"\t\"'?" << e.second << "\"\t\""
+	 << FullPoint (e.third) << "\"\n";
+  }
+
+  void dump_loan_invalidated_at (std::ostream &os) const
+  {
+    for (auto &e : loan_invalidated_at)
+      os << FullPoint (e.first) << " " << e.second << "\n";
+  }
+
+  void dump_var_used_at (std::ostream &os) const
+  {
+    for (auto &e : var_used_at)
+      os << e.first - 1 << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_var_defined_at (std::ostream &os) const
+  {
+    for (auto &e : var_defined_at)
+      os << e.first << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_var_dropped_at (std::ostream &os) const
+  {
+    for (auto &e : var_dropped_at)
+      os << e.first << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_use_of_var_derefs_origin (std::ostream &os) const
+  {
+    for (auto &e : use_of_var_derefs_origin)
+      os << e.first << " " << e.second << "\n";
+  }
+
+  void dump_drop_of_var_derefs_origin (std::ostream &os) const
+  {
+    for (auto &e : drop_of_var_derefs_origin)
+      os << e.first << " " << e.second << "\n";
+  }
+
+  void dump_child_path (std::ostream &os) const
+  {
+    for (auto &e : child_path)
+      os << e.first << " " << e.second << "\n";
+  }
+
+  void dump_path_is_var (std::ostream &os) const
+  {
+    for (auto &e : path_is_var)
+      os << e.first << " " << e.second << "\n";
+  }
+
+  void dump_path_assigned_at_base (std::ostream &os) const
+  {
+    for (auto &e : path_assigned_at_base)
+      os << e.first << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_path_moved_at_base (std::ostream &os) const
+  {
+    for (auto &e : path_moved_at_base)
+      os << e.first << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_path_accessed_at_base (std::ostream &os) const
+  {
+    for (auto &e : path_accessed_at_base)
+      os << e.first << " " << FullPoint (e.second) << "\n";
+  }
+
+  void dump_known_placeholder_subset (std::ostream &os) const
+  {
+    for (auto &e : known_placeholder_subset)
+      os << e.first << " " << e.second << "\n";
+  }
+
+  void dump_placeholder (std::ostream &os) const
+  {
+    for (auto &e : placeholder)
+      os << e.first << " " << e.second << "\n";
+  }
+};
+
+/**
+ * Check a single function for borrow errors.
+ *
+ * Output is not yet implemented and is only dumped to stdout.
+ */
+extern "C" void
+polonius_run (FFI::FactsView input, bool dump_enabled);
+
+} // namespace Polonius
+} // namespace Rust
+
+#endif /* !RUST_POLONIUS_H */
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 118/125] gccrs: borrowck: Free region representation
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (115 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 117/125] gccrs: borrowck: Polonius FFI Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 119/125] gccrs: borrowck: extract regions from types using VA Arthur Cohen
                   ` (6 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-free-region.h: New file.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../errors/borrowck/rust-bir-free-region.h    | 107 ++++++++++++++++++
 1 file changed, 107 insertions(+)
 create mode 100644 gcc/rust/checks/errors/borrowck/rust-bir-free-region.h

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h b/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
new file mode 100644
index 00000000000..0560a894ab0
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
@@ -0,0 +1,107 @@
+#ifndef RUST_BIR_FREE_REGION_H
+#define RUST_BIR_FREE_REGION_H
+
+#include "rust-diagnostics.h"
+#include "polonius/rust-polonius-ffi.h"
+
+namespace Rust {
+
+using FreeRegion = size_t;
+
+class FreeRegions
+{
+  std::vector<FreeRegion> regions;
+
+public:
+  WARN_UNUSED_RESULT bool has_regions () const { return !regions.empty (); }
+  decltype (regions)::const_iterator begin () const { return regions.begin (); }
+  decltype (regions)::const_iterator end () const { return regions.end (); }
+  size_t size () const { return regions.size (); }
+  FreeRegion &operator[] (size_t i) { return regions.at (i); }
+  const FreeRegion &operator[] (size_t i) const { return regions.at (i); }
+  const std::vector<FreeRegion> &get_regions () const { return regions; }
+  void set_from (std::vector<Rust::Polonius::Origin> &&regions)
+  {
+    this->regions.clear ();
+    for (auto &region : regions)
+      {
+	this->regions.push_back ({region});
+      }
+  }
+
+  WARN_UNUSED_RESULT FreeRegions prepend (FreeRegion region) const
+  {
+    std::vector<FreeRegion> new_regions = {region};
+    new_regions.insert (new_regions.end (), regions.begin (), regions.end ());
+    return FreeRegions (std::move (new_regions));
+  }
+
+  FreeRegions (std::vector<FreeRegion> &&regions) : regions (regions) {}
+
+  WARN_UNUSED_RESULT std::string to_string () const
+  {
+    std::stringstream result;
+    for (auto &region : regions)
+      {
+	result << region;
+	result << ", ";
+      }
+    // Remove the last ", " from the string.
+    if (result.tellg () > 2)
+      result.seekp (-2, std::ios_base::cur);
+
+    return result.str ();
+  }
+};
+
+class RegionBinder
+{
+  FreeRegion &next_free_region;
+
+public:
+  explicit RegionBinder (FreeRegion &next_free_region)
+    : next_free_region (next_free_region)
+  {}
+
+  WARN_UNUSED_RESULT FreeRegion get_next_free_region () const
+  {
+    return next_free_region++;
+  }
+
+  FreeRegions bind_regions (std::vector<TyTy::Region> regions,
+			    FreeRegions parent_free_regions)
+  {
+    std::vector<FreeRegion> free_regions;
+    for (auto &region : regions)
+      {
+	if (region.is_early_bound ())
+	  {
+	    free_regions.push_back (parent_free_regions[region.get_index ()]);
+	  }
+	else if (region.is_static ())
+	  {
+	    free_regions.push_back (0);
+	  }
+	else if (region.is_anonymous ())
+	  {
+	    free_regions.push_back (get_next_free_region ());
+	  }
+	else if (region.is_named ())
+	  {
+	    rust_unreachable (); // FIXME
+	  }
+	else
+	  {
+	    rust_sorry_at (UNKNOWN_LOCATION, "Unimplemented");
+	    rust_unreachable ();
+	  }
+      }
+    // This is necesarry because of clash of current gcc and gcc4.8.
+    FreeRegions free_regions_final{std::move (free_regions)};
+    return free_regions_final;
+  }
+};
+
+} // namespace Rust
+
+#endif // RUST_BIR_FREE_REGION_H
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 119/125] gccrs: borrowck: extract regions from types using VA
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (116 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 118/125] gccrs: borrowck: Free region representation Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 120/125] gccrs: borrowck: Regions in BIR Arthur Cohen
                   ` (5 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

Biggybag on variance analysis to extract regions of fields from ADT
regions.

gcc/rust/ChangeLog:

	* typecheck/rust-tyty-variance-analysis-private.h (class FieldVisitorCtx):
	Region extraction.
	* typecheck/rust-tyty-variance-analysis.cc (query_field_regions): Region extraction.
	(FieldVisitorCtx::collect_regions): Region extraction.
	(FieldVisitorCtx::add_constraints_from_ty): Region extraction.
	(FieldVisitorCtx::add_constraints_from_region): Region
	extraction.
	(FieldVisitorCtx::add_constrints_from_param): Region extraction.
	* typecheck/rust-tyty-variance-analysis.h (query_field_regions):
	Region extraction.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../rust-tyty-variance-analysis-private.h     | 41 +++++++++
 .../typecheck/rust-tyty-variance-analysis.cc  | 87 ++++++++++++++++++-
 .../typecheck/rust-tyty-variance-analysis.h   | 31 +++----
 3 files changed, 140 insertions(+), 19 deletions(-)

diff --git a/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h b/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h
index ab8c039238e..41a0d6f582f 100644
--- a/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h
+++ b/gcc/rust/typecheck/rust-tyty-variance-analysis-private.h
@@ -201,6 +201,13 @@ public: // Module internal API
 
   std::vector<Variance> query_generic_variance (const ADTType &type);
 
+  std::vector<size_t> query_field_regions (const ADTType *parent,
+					   size_t variant_index,
+					   size_t field_index,
+					   const FreeRegions &parent_regions);
+
+  std::vector<Region> query_type_regions (BaseType *base);
+
 public: // Data used by visitors.
   // This whole class is private, therfore members can be public.
 
@@ -296,6 +303,40 @@ private:
   std::vector<Region> regions;
 };
 
+/** Extracts regions of a field from regions of parent ADT. */
+class FieldVisitorCtx : public VarianceVisitorCtx<Variance>
+{
+public:
+  using Visitor = VisitorBase<Variance>;
+
+  std::vector<size_t> collect_regions (BaseType &ty);
+
+  FieldVisitorCtx (GenericTyPerCrateCtx &ctx, const SubstitutionRef &subst,
+		   const FreeRegions &parent_regions)
+    : ctx (ctx), subst (subst), parent_regions (parent_regions)
+  {}
+
+  void add_constraints_from_ty (BaseType *ty, Variance variance) override;
+  void add_constraints_from_region (const Region &region,
+				    Variance variance) override;
+  void add_constraints_from_generic_args (HirId ref, SubstitutionRef &subst,
+					  Variance variance,
+					  bool invariant_args) override{};
+  void add_constrints_from_param (ParamType &param, Variance variance) override;
+
+  Variance contra (Variance variance) override
+  {
+    return Variance::transform (variance, Variance::contravariant ());
+  }
+
+private:
+  GenericTyPerCrateCtx &ctx;
+  const SubstitutionRef &subst;
+  std::vector<size_t> regions;
+  FreeRegions parent_regions;
+  std::vector<size_t> type_param_ranges;
+};
+
 } // namespace VarianceAnalysis
 
 } // namespace TyTy
diff --git a/gcc/rust/typecheck/rust-tyty-variance-analysis.cc b/gcc/rust/typecheck/rust-tyty-variance-analysis.cc
index 5a21d69651b..d7116f5eb80 100644
--- a/gcc/rust/typecheck/rust-tyty-variance-analysis.cc
+++ b/gcc/rust/typecheck/rust-tyty-variance-analysis.cc
@@ -49,8 +49,16 @@ CrateCtx::query_type_variances (BaseType *type)
 std::vector<Region>
 CrateCtx::query_type_regions (BaseType *type)
 {
-  TyVisitorCtx ctx (*private_ctx);
-  return ctx.collect_regions (*type);
+  return private_ctx->query_type_regions (type);
+}
+
+std::vector<size_t>
+CrateCtx::query_field_regions (const ADTType *parent, size_t variant_index,
+			       size_t field_index,
+			       const FreeRegions &parent_regions)
+{
+  return private_ctx->query_field_regions (parent, variant_index, field_index,
+					   parent_regions);
 }
 
 Variance
@@ -324,6 +332,29 @@ GenericTyPerCrateCtx::query_generic_variance (const ADTType &type)
   return result;
 }
 
+std::vector<size_t>
+GenericTyPerCrateCtx::query_field_regions (const ADTType *parent,
+					   size_t variant_index,
+					   size_t field_index,
+					   const FreeRegions &parent_regions)
+{
+  auto orig = lookup_type (parent->get_orig_ref ());
+  FieldVisitorCtx ctx (*this, *parent->as<const SubstitutionRef> (),
+		       parent_regions);
+  return ctx.collect_regions (*orig->as<const ADTType> ()
+				 ->get_variants ()
+				 .at (variant_index)
+				 ->get_fields ()
+				 .at (field_index)
+				 ->get_field_type ());
+}
+std::vector<Region>
+GenericTyPerCrateCtx::query_type_regions (BaseType *type)
+{
+  TyVisitorCtx ctx (*this);
+  return ctx.collect_regions (*type);
+}
+
 SolutionIndex
 GenericTyVisitorCtx::lookup_or_add_type (HirId hir_id)
 {
@@ -506,6 +537,58 @@ TyVisitorCtx::add_constraints_from_generic_args (HirId ref,
     }
 }
 
+std::vector<size_t>
+FieldVisitorCtx::collect_regions (BaseType &ty)
+{
+  // Segment the regions into ranges for each type parameter. Type parameter
+  // at index i contains regions from type_param_ranges[i] to
+  // type_param_ranges[i+1] (exclusive).;
+  type_param_ranges.push_back (subst.get_num_lifetime_params ());
+
+  for (size_t i = 0; i < subst.get_num_type_params (); i++)
+    {
+      auto arg = subst.get_arg_at (i);
+      rust_assert (arg.has_value ());
+      type_param_ranges.push_back (
+	ctx.query_type_regions (arg.value ().get_tyty ()).size ());
+    }
+
+  add_constraints_from_ty (&ty, Variance::covariant ());
+  return regions;
+}
+
+void
+FieldVisitorCtx::add_constraints_from_ty (BaseType *ty, Variance variance)
+{
+  Visitor visitor (*this, variance);
+  ty->accept_vis (visitor);
+}
+
+void
+FieldVisitorCtx::add_constraints_from_region (const Region &region,
+					      Variance variance)
+{
+  if (region.is_early_bound ())
+    {
+      regions.push_back (parent_regions[region.get_index ()]);
+    }
+  else if (region.is_late_bound ())
+    {
+      rust_debug ("Ignoring late bound region");
+    }
+}
+
+void
+FieldVisitorCtx::add_constrints_from_param (ParamType &param, Variance variance)
+{
+  size_t param_i = subst.get_used_arguments ().find_symbol (param).value ();
+  for (size_t i = type_param_ranges[param_i];
+       i < type_param_ranges[param_i + 1]; i++)
+    {
+      regions.push_back (parent_regions[i]);
+    }
+}
+
 Variance
 TyVisitorCtx::contra (Variance variance)
 {
diff --git a/gcc/rust/typecheck/rust-tyty-variance-analysis.h b/gcc/rust/typecheck/rust-tyty-variance-analysis.h
index a1defd62e54..27e8d8b3ea0 100644
--- a/gcc/rust/typecheck/rust-tyty-variance-analysis.h
+++ b/gcc/rust/typecheck/rust-tyty-variance-analysis.h
@@ -3,6 +3,8 @@
 
 #include "rust-tyty.h"
 
+#include <rust-bir-free-region.h>
+
 namespace Rust {
 namespace TyTy {
 namespace VarianceAnalysis {
@@ -31,11 +33,19 @@ public:
 
   /** Get regions mentioned in a type. */
   std::vector<Region> query_type_regions (BaseType *type);
+  std::vector<size_t> query_field_regions (const ADTType *parent,
+					   size_t variant_index,
+					   size_t field_index,
+					   const FreeRegions &parent_regions);
 
 private:
   std::unique_ptr<GenericTyPerCrateCtx> private_ctx;
 };
 
+std::vector<size_t>
+query_field_regions (const ADTType *parent, size_t variant_index,
+		     size_t field_index, const FreeRegions &parent_regions);
+
 /** Variance semilattice */
 class Variance
 {
@@ -55,22 +65,10 @@ class Variance
 public:
   constexpr Variance () : kind (TOP) {}
 
-  WARN_UNUSED_RESULT constexpr bool is_bivariant () const
-  {
-    return kind == BIVARIANT;
-  }
-  WARN_UNUSED_RESULT constexpr bool is_covariant () const
-  {
-    return kind == COVARIANT;
-  }
-  WARN_UNUSED_RESULT constexpr bool is_contravariant () const
-  {
-    return kind == CONTRAVARIANT;
-  }
-  WARN_UNUSED_RESULT constexpr bool is_invariant () const
-  {
-    return kind == INVARIANT;
-  }
+  constexpr bool is_bivariant () const { return kind == BIVARIANT; }
+  constexpr bool is_covariant () const { return kind == COVARIANT; }
+  constexpr bool is_contravariant () const { return kind == CONTRAVARIANT; }
+  constexpr bool is_invariant () const { return kind == INVARIANT; }
 
   static constexpr Variance bivariant () { return {BIVARIANT}; }
   static constexpr Variance covariant () { return {COVARIANT}; }
@@ -97,7 +95,6 @@ public:
   {
     return lhs.kind == rhs.kind;
   }
-
   constexpr friend bool operator!= (const Variance &lhs, const Variance &rhs)
   {
     return !(lhs == rhs);
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 120/125] gccrs: borrowck: Regions in BIR
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (117 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 119/125] gccrs: borrowck: extract regions from types using VA Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 121/125] gccrs: borrowck: Fact collector Arthur Cohen
                   ` (4 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-place.h (struct Lifetime):
	Extended regions and loans.
	(struct Loan): Representation of loan (result of borrowing)
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit):
	Fix let stmt handling.
	* checks/errors/borrowck/rust-bir-builder-pattern.h: improved
	pattern translation
	* checks/errors/borrowck/rust-bir-builder-internal.h: region binding
	* checks/errors/borrowck/rust-bir-builder-expr-stmt.h (class ExprStmtBuilder):
	Region support.
	(class RenumberCtx): Region support.
	* checks/errors/borrowck/rust-bir-builder.h (class Builder): Region support.
	* checks/errors/borrowck/rust-bir-dump.cc (get_lifetime_name): Region support.
	(renumber_places): Region support.
	(Dump::go): Region support.
	(Dump::visit): Region support.
	(Dump::visit_lifetime): Region support.
	(Dump::visit_scope): Region support.
	* checks/errors/borrowck/rust-bir.h (class AbstractExpr): Region support.
	(struct Function): Region support.
	(class BorrowExpr): Region support.
	(class CallExpr): Region support.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../borrowck/rust-bir-builder-expr-stmt.cc    |  73 +++---
 .../borrowck/rust-bir-builder-expr-stmt.h     |   7 +-
 .../borrowck/rust-bir-builder-internal.h      | 234 ++++++++++++------
 .../borrowck/rust-bir-builder-pattern.h       | 154 +++++++-----
 .../checks/errors/borrowck/rust-bir-builder.h | 120 +++++++--
 .../checks/errors/borrowck/rust-bir-dump.cc   |  46 ++--
 .../checks/errors/borrowck/rust-bir-place.h   | 202 +++++++++++----
 gcc/rust/checks/errors/borrowck/rust-bir.h    |  49 +++-
 8 files changed, 610 insertions(+), 275 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
index 922894cc5d5..d64641177d0 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
@@ -93,8 +93,8 @@ ExprStmtBuilder::visit (HIR::ClosureExpr &expr)
 void
 ExprStmtBuilder::visit (HIR::StructExprStructFields &fields)
 {
-  auto struct_ty
-    = lookup_type (fields)->as<TyTy::ADTType> ()->get_variants ().at (0);
+  auto *p_adt_type = lookup_type (fields)->as<TyTy::ADTType> ();
+  auto struct_ty = p_adt_type->get_variants ().at (0);
   auto init_values = StructBuilder (ctx, struct_ty).build (fields);
   move_all (init_values);
   return_expr (new InitializerExpr (std::move (init_values)),
@@ -119,7 +119,15 @@ void
 ExprStmtBuilder::visit (HIR::BorrowExpr &expr)
 {
   auto operand = visit_expr (*expr.get_expr ());
-  return_expr (new BorrowExpr (operand), lookup_type (expr));
+  if (ctx.place_db[operand].is_constant ())
+    {
+      // Cannot borrow a constant, must create a temporary copy.
+      push_tmp_assignment (operand);
+      operand = translated;
+    }
+
+  // BorrowExpr cannot be annotated with lifetime.
+  return_borrowed (operand, lookup_type (expr));
 }
 
 void
@@ -183,6 +191,7 @@ ExprStmtBuilder::visit (HIR::AssignmentExpr &expr)
   auto lhs = visit_expr (*expr.get_lhs ());
   auto rhs = visit_expr (*expr.get_rhs ());
   push_assignment (lhs, rhs);
+  translated = INVALID_PLACE;
 }
 
 void
@@ -265,6 +274,7 @@ ExprStmtBuilder::visit (HIR::CallExpr &expr)
     }
 
   move_all (arguments);
+
   return_expr (new CallExpr (fn, std::move (arguments)), lookup_type (expr),
 	       true);
 }
@@ -346,7 +356,10 @@ ExprStmtBuilder::visit (HIR::BlockExpr &block)
 				  lookup_type (*block.get_final_expr ()))));
     }
 
-  pop_scope ();
+  if (!unreachable)
+    pop_scope ();
+  else
+    ctx.place_db.pop_scope ();
 }
 
 void
@@ -422,10 +435,12 @@ ExprStmtBuilder::visit (HIR::ReturnExpr &ret)
 {
   if (ret.has_return_expr ())
     {
-      push_assignment (RETURN_VALUE_PLACE, visit_expr (*ret.get_expr ()));
+      push_assignment (RETURN_VALUE_PLACE,
+		       move_place (visit_expr (*ret.get_expr ())));
     }
   unwind_until (ROOT_SCOPE);
   ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
+  translated = INVALID_PLACE;
 }
 
 void
@@ -538,16 +553,19 @@ ExprStmtBuilder::visit (HIR::IfExprConseqElse &expr)
   if (else_bb.is_goto_terminated () && else_bb.successors.empty ())
     add_jump (else_end_bb, final_start_bb);
 }
+
 void
 ExprStmtBuilder::visit (HIR::IfLetExpr &expr)
 {
   rust_sorry_at (expr.get_locus (), "if let expressions are not supported");
 }
+
 void
 ExprStmtBuilder::visit (HIR::IfLetExprConseqElse &expr)
 {
   rust_sorry_at (expr.get_locus (), "if let expressions are not supported");
 }
+
 void
 ExprStmtBuilder::visit (HIR::MatchExpr &expr)
 {
@@ -608,8 +626,7 @@ void
 ExprStmtBuilder::visit (HIR::QualifiedPathInExpression &expr)
 {
   // Note: Type is only stored for the expr, not the segment.
-  PlaceId result
-    = resolve_variable_or_fn (expr.get_final_segment (), lookup_type (expr));
+  PlaceId result = resolve_variable_or_fn (expr, lookup_type (expr));
   return_place (result);
 }
 
@@ -617,14 +634,19 @@ void
 ExprStmtBuilder::visit (HIR::PathInExpression &expr)
 {
   // Note: Type is only stored for the expr, not the segment.
-  PlaceId result
-    = resolve_variable_or_fn (expr.get_final_segment (), lookup_type (expr));
+  PlaceId result = resolve_variable_or_fn (expr, lookup_type (expr));
   return_place (result);
 }
 
 void
 ExprStmtBuilder::visit (HIR::LetStmt &stmt)
 {
+  tl::optional<PlaceId> init;
+  tl::optional<TyTy::BaseType *> type_annotation;
+
+  if (stmt.has_type ())
+    type_annotation = lookup_type (*stmt.get_type ());
+
   if (stmt.get_pattern ()->get_pattern_type () == HIR::Pattern::IDENTIFIER)
     {
       // Only if a pattern is just an identifier, no destructuring is needed.
@@ -632,35 +654,30 @@ ExprStmtBuilder::visit (HIR::LetStmt &stmt)
       // (init expr is evaluated before pattern binding) into a
       // variable, so it would emit extra assignment.
       auto var = declare_variable (stmt.get_pattern ()->get_mappings ());
-      auto &var_place = ctx.place_db[var];
-      if (var_place.tyty->get_kind () == TyTy::REF)
-	{
-	  var_place.lifetime = ctx.lookup_lifetime (
-	    optional_from_ptr (
-	      static_cast<HIR::ReferenceType *> (stmt.get_type ().get ()))
-	      .map (&HIR::ReferenceType::get_lifetime));
-	}
+      if (stmt.has_type ())
+	push_user_type_ascription (var, lookup_type (*stmt.get_type ()));
+
       if (stmt.has_init_expr ())
 	(void) visit_expr (*stmt.get_init_expr (), var);
     }
-  else if (stmt.has_init_expr ())
-    {
-      auto init = visit_expr (*stmt.get_init_expr ());
-      PatternBindingBuilder (ctx, init, stmt.get_type ().get ())
-	.go (*stmt.get_pattern ());
-    }
   else
     {
-      rust_sorry_at (stmt.get_locus (), "pattern matching in let statements "
-					"without initializer is not supported");
+      if (stmt.has_init_expr ())
+	init = visit_expr (*stmt.get_init_expr ());
+
+      PatternBindingBuilder (ctx, init, type_annotation)
+	.go (*stmt.get_pattern ());
     }
 }
 
 void
 ExprStmtBuilder::visit (HIR::ExprStmt &stmt)
 {
-  (void) visit_expr (*stmt.get_expr ());
+  PlaceId result = visit_expr (*stmt.get_expr ());
+  // We must read the value for current liveness and we must not store it into
+  // the same place.
+  if (result != INVALID_PLACE)
+    push_tmp_assignment (result);
 }
-
 } // namespace BIR
-} // namespace Rust
\ No newline at end of file
+} // namespace Rust
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h
index 0654bcc27b0..1597ff291b0 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h
@@ -30,15 +30,16 @@ namespace BIR {
  * See AbstractExprBuilder for API usage docs (mainly `return_place` and
  * `return_expr`).
  */
-class ExprStmtBuilder : public AbstractExprBuilder, public HIR::HIRStmtVisitor
+class ExprStmtBuilder final : public AbstractExprBuilder,
+			      public HIR::HIRStmtVisitor
 {
 public:
   explicit ExprStmtBuilder (BuilderContext &ctx) : AbstractExprBuilder (ctx) {}
 
   /** Entry point. */
-  PlaceId build (HIR::Expr &expr, PlaceId place = INVALID_PLACE)
+  PlaceId build (HIR::Expr &expr, PlaceId destination = INVALID_PLACE)
   {
-    return visit_expr (expr, place);
+    return visit_expr (expr, destination);
   }
 
 private:
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
index b421ba43fba..2e2a7e2970a 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
@@ -26,39 +26,30 @@
 #include "rust-hir-visitor.h"
 #include "rust-name-resolver.h"
 #include "rust-bir.h"
+#include "rust-bir-free-region.h"
 
 namespace Rust {
 
-namespace BIR {
+namespace TyTy {
 
-/** Holds the context of BIR building so that it can be shared/passed between
- * different builders. */
-struct BuilderContext
+using Variance = VarianceAnalysis::Variance;
+
+class RenumberCtx
 {
-  class LifetimeResolver
-  {
-    using Index = uint32_t;
-    using Value = std::string;
+  Polonius::Origin next_region = 0;
 
-    Index next_index = FIRST_NORMAL_LIFETIME_ID;
-    std::unordered_map<Value, Index> value_to_index;
+public:
+  Polonius::Origin get_next_region () { return next_region++; }
+};
 
-  public:
-    Index resolve (const Value &value)
-    {
-      auto found = value_to_index.find (value);
-      if (found != value_to_index.end ())
-	{
-	  return found->second;
-	}
-      value_to_index.emplace (value, next_index);
-      return next_index++;
-    }
+} // namespace TyTy
 
-    /** Returns a new anonymous lifetime. */
-    Index get_anonymous () { return next_index++; }
-  };
+namespace BIR {
 
+/** Holds the context of BIR building so that it can be shared/passed between
+ * different builders. */
+struct BuilderContext
+{
   struct LoopAndLabelCtx
   {
     bool is_loop;      // Loop or labelled block
@@ -93,7 +84,8 @@ struct BuilderContext
    * constants)
    */
   PlaceDB place_db;
-  LifetimeResolver lifetime_interner;
+  RegionBinder region_binder{place_db.expose_next_free_region ()};
+
   // Used for cleaner dump.
   std::vector<PlaceId> arguments;
   /**
@@ -105,6 +97,8 @@ struct BuilderContext
   /** Context for current situation (loop, label, etc.) */
   std::vector<LoopAndLabelCtx> loop_and_label_stack;
 
+  FreeRegions fn_free_regions{{}};
+
 public:
   BuilderContext ()
     : tyctx (*Resolver::TypeCheckContext::get ()),
@@ -115,27 +109,6 @@ public:
 
   BasicBlock &get_current_bb () { return basic_blocks[current_bb]; }
 
-  Lifetime lookup_lifetime (const tl::optional<HIR::Lifetime> &lifetime)
-  {
-    if (!lifetime.has_value ())
-      return {lifetime_interner.get_anonymous ()};
-    switch (lifetime->get_lifetime_type ())
-      {
-	case AST::Lifetime::NAMED: {
-	  return {lifetime_interner.resolve (lifetime->get_name ())};
-	}
-	case AST::Lifetime::STATIC: {
-	  return STATIC_LIFETIME;
-	}
-	case AST::Lifetime::WILDCARD: {
-	  rust_sorry_at (lifetime->get_locus (),
-			 "lifetime elision is not yet implemented");
-	  return NO_LIFETIME;
-	}
-      }
-    rust_unreachable ();
-  };
-
   const LoopAndLabelCtx &lookup_label (NodeId label)
   {
     auto label_match = [label] (const LoopAndLabelCtx &info) {
@@ -165,25 +138,31 @@ protected:
 protected:
   explicit AbstractBuilder (BuilderContext &ctx) : ctx (ctx) {}
 
-  PlaceId declare_variable (const Analysis::NodeMapping &node)
+  PlaceId declare_variable (const Analysis::NodeMapping &node,
+			    bool user_type_annotation = false)
   {
-    return declare_variable (node, lookup_type (node.get_hirid ()));
+    return declare_variable (node, lookup_type (node.get_hirid ()),
+			     user_type_annotation);
   }
 
   PlaceId declare_variable (const Analysis::NodeMapping &node,
-			    TyTy::BaseType *ty)
+			    TyTy::BaseType *ty,
+			    bool user_type_annotation = false)
   {
     const NodeId nodeid = node.get_nodeid ();
 
     // In debug mode, check that the variable is not already declared.
     rust_assert (ctx.place_db.lookup_variable (nodeid) == INVALID_PLACE);
 
-    auto place = ctx.place_db.add_variable (nodeid, ty);
+    auto place_id = ctx.place_db.add_variable (nodeid, ty);
 
     if (ctx.place_db.get_current_scope_id () != 0)
-      push_storage_live (place);
+      push_storage_live (place_id);
+
+    if (user_type_annotation)
+      push_user_type_ascription (place_id, ty);
 
-    return place;
+    return place_id;
   }
 
   void push_new_scope () { ctx.place_db.push_new_scope (); }
@@ -199,18 +178,64 @@ protected:
     ctx.place_db.pop_scope ();
   }
 
+  bool intersection_empty (std::vector<PlaceId> &a, std::vector<PlaceId> &b)
+  {
+    for (auto &place : a)
+      {
+	if (std::find (b.begin (), b.end (), place) != b.end ())
+	  return false;
+      }
+    return true;
+  }
+
   void unwind_until (ScopeId final_scope)
   {
     auto current_scope_id = ctx.place_db.get_current_scope_id ();
     while (current_scope_id != final_scope)
       {
 	auto &scope = ctx.place_db.get_scope (current_scope_id);
+
+	// TODO: Perform stable toposort based on `borrowed_by`.
+
 	std::for_each (scope.locals.rbegin (), scope.locals.rend (),
 		       [&] (PlaceId place) { push_storage_dead (place); });
 	current_scope_id = scope.parent;
       }
   }
 
+  FreeRegions bind_regions (std::vector<TyTy::Region> regions,
+			    FreeRegions parent_free_regions)
+  {
+    std::vector<FreeRegion> free_regions;
+    for (auto &region : regions)
+      {
+	if (region.is_early_bound ())
+	  {
+	    free_regions.push_back (parent_free_regions[region.get_index ()]);
+	  }
+	else if (region.is_static ())
+	  {
+	    free_regions.push_back (0);
+	  }
+	else if (region.is_anonymous ())
+	  {
+	    free_regions.push_back (ctx.place_db.get_next_free_region ());
+	  }
+	else if (region.is_named ())
+	  {
+	    rust_unreachable (); // FIXME
+	  }
+	else
+	  {
+	    rust_sorry_at (UNKNOWN_LOCATION, "Unimplemented");
+	    rust_unreachable ();
+	  }
+      }
+    // This is necesarry because of clash of current gcc and gcc4.8.
+    FreeRegions free_regions_final{std::move (free_regions)};
+    return free_regions_final;
+  }
+
 protected: // Helpers to add BIR statements
   void push_assignment (PlaceId lhs, AbstractExpr *rhs)
   {
@@ -264,15 +289,51 @@ protected: // Helpers to add BIR statements
       Statement::Kind::STORAGE_DEAD, place);
   }
 
+  void push_user_type_ascription (PlaceId place, TyTy::BaseType *ty)
+  {
+    ctx.get_current_bb ().statements.emplace_back (
+      Statement::Kind::USER_TYPE_ASCRIPTION, place, ty);
+  }
+
+  void push_fake_read (PlaceId place)
+  {
+    ctx.get_current_bb ().statements.emplace_back (Statement::Kind::FAKE_READ,
+						   place);
+  }
+
+  PlaceId borrow_place (PlaceId place_id, TyTy::BaseType *ty)
+  {
+    auto mutability = ty->as<const TyTy::ReferenceType> ()->mutability ();
+    auto loan = ctx.place_db.add_loan ({mutability, place_id});
+    push_tmp_assignment (new BorrowExpr (place_id, loan,
+					 ctx.place_db.get_next_free_region ()),
+			 ty);
+    return translated;
+  }
+
   PlaceId move_place (PlaceId arg)
   {
-    if (ctx.place_db[arg].is_lvalue ())
-      {
-	push_tmp_assignment (arg);
-	arg = translated;
-      }
+    auto &place = ctx.place_db[arg];
+
+    if (place.is_constant ())
+      return arg;
+
+    if (place.tyty->is<TyTy::ReferenceType> ())
+      return reborrow_place (arg);
+
+    if (place.is_rvalue ())
+      return arg;
 
-    return arg;
+    push_tmp_assignment (arg);
+    return translated;
+  }
+
+  PlaceId reborrow_place (PlaceId arg)
+  {
+    auto ty = ctx.place_db[arg].tyty->as<TyTy::ReferenceType> ();
+    return borrow_place (ctx.place_db.lookup_or_add_path (Place::DEREF,
+							  ty->get_base (), arg),
+			 ty);
   }
 
   template <typename T> void move_all (T &args)
@@ -348,15 +409,17 @@ protected: // HIR resolution helpers
   template <typename T>
   PlaceId resolve_variable_or_fn (T &variable, TyTy::BaseType *ty)
   {
+    ty = (ty) ? ty : lookup_type (variable);
     // Unlike variables,
     // functions do not have to be declared in PlaceDB before use.
     NodeId variable_id;
     bool ok = ctx.resolver.lookup_resolved_name (
       variable.get_mappings ().get_nodeid (), &variable_id);
     rust_assert (ok);
-    return ctx.place_db.lookup_or_add_variable (variable_id,
-						(ty) ? ty
-						     : lookup_type (variable));
+    if (ty->is<TyTy::FnType> ())
+      return ctx.place_db.get_constant (ty);
+    else
+      return ctx.place_db.lookup_or_add_variable (variable_id, ty);
   }
 
 protected: // Implicit conversions.
@@ -415,10 +478,11 @@ protected: // Implicit conversions.
     if (ctx.place_db[translated].tyty->get_kind () != TyTy::REF)
       {
 	auto ty = ctx.place_db[translated].tyty;
-	push_tmp_assignment (
-	  new BorrowExpr (translated),
-	  new TyTy::ReferenceType (ty->get_ref (), TyTy::TyVar (ty->get_ref ()),
-				   Mutability::Imm));
+	translated
+	  = borrow_place (translated,
+			  new TyTy::ReferenceType (ty->get_ref (),
+						   TyTy::TyVar (ty->get_ref ()),
+						   Mutability::Imm));
       }
   }
 };
@@ -441,8 +505,8 @@ protected:
   {}
 
   /**
-   * Wrapper that provides return value based API inside a visitor which has to
-   * use global state to pass the data around.
+   * Wrapper that provides return value based API inside a visitor which has
+   * to use global state to pass the data around.
    * @param dst_place Place to assign the produced value to, optionally
    * allocated by the caller.
    * */
@@ -461,10 +525,11 @@ protected:
 
   /**
    * Create a return value of a subexpression, which produces an expression.
-   * Use `return_place` for subexpression that only produce a place (look it up)
-   * to avoid needless assignments.
+   * Use `return_place` for subexpression that only produce a place (look it
+   * up) to avoid needless assignments.
    *
-   * @param can_panic mark that expression can panic to insert jump to cleanup.
+   * @param can_panic mark that expression can panic to insert jump to
+   * cleanup.
    */
   void return_expr (AbstractExpr *expr, TyTy::BaseType *ty,
 		    bool can_panic = false)
@@ -482,10 +547,16 @@ protected:
       {
 	start_new_consecutive_bb ();
       }
+
+    if (ty->is<TyTy::ReferenceType> ()
+	|| ctx.place_db[translated].is_constant ())
+      {
+	push_fake_read (translated);
+      }
   }
 
   /** Mark place to be a result of processed subexpression. */
-  void return_place (PlaceId place)
+  void return_place (PlaceId place, bool can_panic = false)
   {
     if (expr_return_place != INVALID_PLACE)
       {
@@ -496,6 +567,16 @@ protected:
       {
 	translated = place;
       }
+
+    if (can_panic)
+      {
+	start_new_consecutive_bb ();
+      }
+
+    if (ctx.place_db[place].is_constant ())
+      {
+	push_fake_read (translated);
+      }
   }
 
   /** Explicitly return a unit value. Expression produces no value. */
@@ -504,6 +585,17 @@ protected:
     translated = ctx.place_db.get_constant (lookup_type (expr));
   }
 
+  PlaceId return_borrowed (PlaceId place_id, TyTy::BaseType *ty)
+  {
+    // TODO: deduplicate with borrow_place
+    auto loan = ctx.place_db.add_loan (
+      {ty->as<const TyTy::ReferenceType> ()->mutability (), place_id});
+    return_expr (new BorrowExpr (place_id, loan,
+				 ctx.place_db.get_next_free_region ()),
+		 ty);
+    return translated;
+  }
+
   PlaceId take_or_create_return_place (TyTy::BaseType *type)
   {
     PlaceId result = INVALID_PLACE;
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-pattern.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-pattern.h
index 76943ff1b04..8b5adabcb6e 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-pattern.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-pattern.h
@@ -20,6 +20,8 @@
 #define RUST_BIR_BUILDER_PATTERN_H
 
 #include "rust-bir-builder-internal.h"
+#include "rust-bir-free-region.h"
+#include "rust-tyty-variance-analysis.h"
 
 namespace Rust {
 namespace BIR {
@@ -32,9 +34,9 @@ class PatternBindingBuilder : protected AbstractBuilder,
 			      public HIR::HIRPatternVisitor
 {
   /** Value of initialization expression. */
-  PlaceId init;
-  /** This is where lifetime annotations are stored. */
-  tl::optional<HIR::Type *> type;
+  tl::optional<PlaceId> init;
+  tl::optional<TyTy::BaseType *> type_annotation;
+  tl::optional<FreeRegions> regions;
 
   /** Emulates recursive stack saving and restoring inside a visitor. */
   class SavedState
@@ -42,24 +44,22 @@ class PatternBindingBuilder : protected AbstractBuilder,
     PatternBindingBuilder *builder;
 
   public:
-    const PlaceId init;
-    const tl::optional<HIR::Type *> type;
+    const tl::optional<PlaceId> init;
+    const tl::optional<FreeRegions> regions;
 
   public:
     explicit SavedState (PatternBindingBuilder *builder)
-      : builder (builder), init (builder->init), type (builder->type)
+      : builder (builder), init (builder->init), regions (builder->regions)
     {}
 
-    ~SavedState ()
-    {
-      builder->init = init;
-      builder->type = type;
-    }
+    ~SavedState () { builder->init = init; }
   };
 
 public:
-  PatternBindingBuilder (BuilderContext &ctx, PlaceId init, HIR::Type *type)
-    : AbstractBuilder (ctx), init (init), type (optional_from_ptr (type))
+  PatternBindingBuilder (BuilderContext &ctx, tl::optional<PlaceId> init,
+			 tl::optional<TyTy::BaseType *> type_annotation)
+    : AbstractBuilder (ctx), init (init), type_annotation (type_annotation),
+      regions (tl::nullopt)
   {}
 
   void go (HIR::Pattern &pattern) { pattern.accept_vis (*this); }
@@ -74,21 +74,15 @@ public:
 					 TyTy::TyVar (node.get_hirid ()),
 					 (is_mut) ? Mutability::Mut
 						  : Mutability::Imm));
-	push_assignment (translated, new BorrowExpr (init));
       }
     else
       {
 	translated = declare_variable (node);
-	push_assignment (translated, init);
       }
-    auto &init_place = ctx.place_db[init];
-    auto &translated_place = ctx.place_db[translated];
-    if (init_place.tyty->get_kind () == TyTy::REF)
+
+    if (init.has_value ())
       {
-	init_place.lifetime = ctx.lookup_lifetime (type.map ([] (HIR::Type *t) {
-	  return static_cast<HIR::ReferenceType *> (t)->get_lifetime ();
-	}));
-	translated_place.lifetime = init_place.lifetime;
+	push_assignment (translated, init.value ());
       }
   }
 
@@ -104,15 +98,15 @@ public:
   {
     SavedState saved (this);
 
-    auto ref_type = type.map (
-      [] (HIR::Type *t) { return static_cast<HIR::ReferenceType *> (t); });
+    init = init.map ([&] (PlaceId id) {
+      return ctx.place_db.lookup_or_add_path (Place::DEREF,
+					      lookup_type (pattern), id);
+    });
+
+    type_annotation = type_annotation.map ([&] (TyTy::BaseType *ty) {
+      return ty->as<TyTy::ReferenceType> ()->get_base ();
+    });
 
-    type = ref_type.map (
-      [] (HIR::ReferenceType *r) { return r->get_base_type ().get (); });
-    init = ctx.place_db.lookup_or_add_path (Place::DEREF, lookup_type (pattern),
-					    saved.init);
-    ctx.place_db[init].lifetime
-      = ctx.lookup_lifetime (ref_type.map (&HIR::ReferenceType::get_lifetime));
     pattern.get_referenced_pattern ()->accept_vis (*this);
   }
 
@@ -120,12 +114,20 @@ public:
   {
     SavedState saved (this);
 
-    type = type.map ([] (HIR::Type *t) {
-      return static_cast<HIR::SliceType *> (t)->get_element_type ().get ();
-    });
     // All indexes are supposed to point to the same place for borrow-checking.
-    init = ctx.place_db.lookup_or_add_path (Place::INDEX, lookup_type (pattern),
-					    saved.init);
+    // init = ctx.place_db.lookup_or_add_path (Place::INDEX, lookup_type
+    // (pattern), saved.init);
+    init = init.map ([&] (PlaceId id) {
+      return ctx.place_db.lookup_or_add_path (Place::INDEX,
+					      lookup_type (pattern), id);
+    });
+
+    type_annotation = type_annotation.map ([&] (TyTy::BaseType *ty) {
+      return ty->as<TyTy::SliceType> ()->get_element_type ();
+    });
+
+    // Regions are unchnaged.
+
     for (auto &item : pattern.get_items ())
       {
 	item->accept_vis (*this);
@@ -142,15 +144,12 @@ public:
   {
     SavedState saved (this);
 
-    auto tyty = ctx.place_db[init].tyty;
+    auto tyty = ctx.place_db[init.value ()].tyty;
     rust_assert (tyty->get_kind () == TyTy::ADT);
     auto adt_ty = static_cast<TyTy::ADTType *> (tyty);
     rust_assert (adt_ty->is_struct_struct ());
     auto struct_ty = adt_ty->get_variants ().at (0);
 
-    auto struct_type = type.map ([] (HIR::Type *t) {
-      return static_cast<HIR::TypePath *> (t)->get_final_segment ().get ();
-    });
     for (auto &field :
 	 pattern.get_struct_pattern_elems ().get_struct_pattern_fields ())
       {
@@ -159,9 +158,22 @@ public:
 	    case HIR::StructPatternField::TUPLE_PAT: {
 	      auto tuple
 		= static_cast<HIR::StructPatternFieldTuplePat *> (field.get ());
-	      init = ctx.place_db.lookup_or_add_path (
-		Place::FIELD, lookup_type (*tuple->get_tuple_pattern ()),
-		saved.init, tuple->get_index ());
+
+	      init = init.map ([&] (PlaceId id) {
+		return ctx.place_db.lookup_or_add_path (
+		  Place::FIELD, lookup_type (*tuple->get_tuple_pattern ()), id,
+		  tuple->get_index ());
+	      });
+
+	      type_annotation = type_annotation.map ([&] (TyTy::BaseType *ty) {
+		return ty->as<TyTy::ADTType> ()
+		  ->get_variants ()
+		  .at (0)
+		  ->get_fields ()
+		  .at (tuple->get_index ())
+		  ->get_field_type ();
+	      });
+
 	      tuple->get_tuple_pattern ()->accept_vis (*this);
 	      break;
 	    }
@@ -177,7 +189,8 @@ public:
 	      init
 		= ctx.place_db.lookup_or_add_path (Place::FIELD,
 						   field_ty->get_field_type (),
-						   saved.init, field_index);
+						   saved.init.value (),
+						   field_index);
 	      ident_field->get_pattern ()->accept_vis (*this);
 	      break;
 	    }
@@ -193,7 +206,8 @@ public:
 	      init
 		= ctx.place_db.lookup_or_add_path (Place::FIELD,
 						   field_ty->get_field_type (),
-						   saved.init, field_index);
+						   saved.init.value (),
+						   field_index);
 	      visit_identifier (ident_field->get_mappings (),
 				ident_field->get_has_ref (),
 				ident_field->is_mut ());
@@ -208,19 +222,32 @@ public:
   {
     for (auto &item : fields)
       {
-	type = saved.type.map ([&] (HIR::Type *t) {
-	  return static_cast<HIR::TupleType *> (t)
-	    ->get_elems ()
+	auto type = lookup_type (*item);
+
+	init = init.map ([&] (PlaceId id) {
+	  return ctx.place_db.lookup_or_add_path (Place::FIELD, type, id,
+						  index);
+	});
+
+	type_annotation = type_annotation.map ([&] (TyTy::BaseType *ty) {
+	  return ty->as<TyTy::TupleType> ()
+	    ->get_fields ()
 	    .at (index)
-	    .get ();
+	    .get_tyty ();
+	});
+
+	regions = regions.map ([&] (FreeRegions regs) {
+	  return bind_regions (Resolver::TypeCheckContext::get ()
+				 ->get_variance_analysis_ctx ()
+				 .query_type_regions (type),
+			       regs);
 	});
-	init
-	  = ctx.place_db.lookup_or_add_path (Place::FIELD, lookup_type (*item),
-					     saved.init, index);
+
 	item->accept_vis (*this);
 	index++;
       }
   }
+
   void visit (HIR::TuplePattern &pattern) override
   {
     SavedState saved (this);
@@ -238,7 +265,7 @@ public:
 	  auto &items = static_cast<HIR::TuplePatternItemsRanged &> (
 	    *pattern.get_items ());
 
-	  auto tyty = ctx.place_db[init].tyty;
+	  auto tyty = ctx.place_db[init.value ()].tyty;
 	  rust_assert (tyty->get_kind () == TyTy::TUPLE);
 
 	  auto skipped = (static_cast<TyTy::TupleType *> (tyty))->num_fields ()
@@ -253,10 +280,22 @@ public:
       }
     init = saved.init;
   }
+
   void visit (HIR::TupleStructPattern &pattern) override
   {
     SavedState saved (this);
 
+    type_annotation = tl::nullopt;
+
+    auto type = lookup_type (pattern);
+
+    regions = regions.map ([&] (FreeRegions regs) {
+      return bind_regions (Resolver::TypeCheckContext::get ()
+			     ->get_variance_analysis_ctx ()
+			     .query_type_regions (type),
+			   regs);
+    });
+
     size_t index = 0;
     switch (pattern.get_items ()->get_item_type ())
       {
@@ -264,9 +303,8 @@ public:
 	  auto &items
 	    = static_cast<HIR::TupleStructItemsRange &> (*pattern.get_items ());
 
-	  auto tyty = ctx.place_db[init].tyty;
-	  rust_assert (tyty->get_kind () == TyTy::ADT);
-	  auto adt_ty = static_cast<TyTy::ADTType *> (tyty);
+	  rust_assert (type->get_kind () == TyTy::ADT);
+	  auto adt_ty = static_cast<TyTy::ADTType *> (type);
 	  rust_assert (adt_ty->is_tuple_struct ());
 
 	  auto skipped = adt_ty->get_variants ().at (0)->get_fields ().size ()
@@ -293,12 +331,6 @@ public:
   void visit (HIR::PathInExpression &expression) override {}
   void visit (HIR::QualifiedPathInExpression &expression) override {}
   void visit (HIR::RangePattern &pattern) override {}
-
-private:
-  template <typename T> tl::optional<T> *get_type ()
-  {
-    return static_cast<T *> (type);
-  }
 };
 } // namespace BIR
 } // namespace Rust
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder.h
index 9bed96c660f..e9108703be1 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder.h
@@ -20,72 +20,142 @@
 #define RUST_BIR_BUILDER_H
 
 #include "rust-bir-builder-internal.h"
-#include "rust-hir-visitor.h"
 #include "rust-bir-builder-pattern.h"
-#include "rust-bir-builder-struct.h"
 #include "rust-bir-builder-expr-stmt.h"
 
 namespace Rust {
 namespace BIR {
 
 /** Top-level builder, which compiles a HIR function into a BIR function. */
-class Builder : public AbstractBuilder
+class Builder final : public AbstractBuilder
 {
+  std::vector<std::pair<FreeRegion, FreeRegion>> universal_region_bounds;
+
 public:
   explicit Builder (BuilderContext &ctx) : AbstractBuilder (ctx) {}
 
   Function build (HIR::Function &function)
   {
-    PlaceId return_place
-      = ctx.place_db.add_temporary (lookup_type (*function.get_definition ()));
-    rust_assert (return_place == RETURN_VALUE_PLACE);
+    rust_debug ("BIR::Builder::build function={%s}",
+		function.get_function_name ().as_string ().c_str ());
+
+    auto fn_ty = lookup_type (function)->as<TyTy::FnType> ();
+
+    handle_lifetime_params (fn_ty->get_num_lifetime_params ());
+    handle_lifetime_param_constraints (fn_ty->get_region_constraints ());
+
+    handle_return (fn_ty);
 
     for (auto &param : function.get_function_params ())
-      {
-	handle_param (param);
-      }
+      handle_param (param);
 
     handle_body (*function.get_definition ());
 
-    return Function{std::move (ctx.place_db), std::move (ctx.arguments),
-		    std::move (ctx.basic_blocks)};
-  };
+    return Function{
+      std::move (ctx.place_db),
+      std::move (ctx.arguments),
+      std::move (ctx.basic_blocks),
+      std::move (ctx.fn_free_regions),
+      std::move (universal_region_bounds),
+      function.get_locus (),
+    };
+  }
 
 private:
+  /** Instantiate `num_lifetime_params` free regions. */
+  void handle_lifetime_params (size_t num_lifetime_params)
+  {
+    std::vector<FreeRegion> function_free_regions;
+    for (size_t i = 0; i < num_lifetime_params; i++)
+      {
+	function_free_regions.push_back (ctx.place_db.get_next_free_region ());
+      }
+
+    rust_debug ("\tctx.fn_free_region={%s}",
+		ctx.fn_free_regions.to_string ().c_str ());
+    ctx.fn_free_regions.set_from (std::move (function_free_regions));
+  }
+
+  void handle_lifetime_param_constraints (
+    const TyTy::RegionConstraints &region_constraints)
+  {
+    rust_debug ("\thandle_lifetime_param_constraints");
+
+    for (auto bound : region_constraints.region_region)
+      {
+	rust_assert (bound.first.is_early_bound ());
+	rust_assert (bound.second.is_early_bound ());
+
+	universal_region_bounds.emplace_back (
+	  ctx.fn_free_regions[bound.first.get_index ()],
+	  ctx.fn_free_regions[bound.second.get_index ()]);
+
+	auto last_bound = universal_region_bounds.back ();
+	rust_debug ("\t\t %ld: %ld", last_bound.first, last_bound.second);
+      }
+
+    // TODO: handle type_region constraints
+  }
+
+  void handle_return (TyTy::FnType *fn_ty)
+  {
+    TyTy::BaseType *return_ty = fn_ty->get_return_type ();
+
+    PlaceId return_place = ctx.place_db.add_temporary (return_ty);
+    rust_assert (return_place == RETURN_VALUE_PLACE);
+
+    // Set return place to use functions regions, not the fresh ones.
+    ctx.place_db[return_place].regions
+      = bind_regions (Resolver::TypeCheckContext::get ()
+			->get_variance_analysis_ctx ()
+			.query_type_regions (fn_ty->get_return_type ()),
+		      ctx.fn_free_regions);
+  }
+
   void handle_param (HIR::FunctionParam &param)
   {
+    auto param_type = lookup_type (*param.get_param_name ());
+
     auto &pattern = param.get_param_name ();
     if (pattern->get_pattern_type () == HIR::Pattern::IDENTIFIER
 	&& !static_cast<HIR::IdentifierPattern &> (*pattern).get_is_ref ())
       {
-	// Avoid useless temporary variable for parameter.
+	// Avoid useless temporary variable for parameter to look like MIR.
 	translated = declare_variable (pattern->get_mappings ());
 	ctx.arguments.push_back (translated);
       }
     else
       {
-	translated = ctx.place_db.add_temporary (lookup_type (*pattern));
+	translated = ctx.place_db.add_temporary (param_type);
 	ctx.arguments.push_back (translated);
-	PatternBindingBuilder (ctx, translated, param.get_type ().get ())
+	PatternBindingBuilder (ctx, translated, tl::nullopt)
 	  .go (*param.get_param_name ());
       }
+
+    rust_assert (param.get_type () != nullptr);
+
+    // Set parameter place to use functions regions, not the fresh ones.
+    ctx.place_db[translated].regions
+      = bind_regions (Resolver::TypeCheckContext::get ()
+			->get_variance_analysis_ctx ()
+			.query_type_regions (param_type),
+		      ctx.fn_free_regions);
   }
 
   void handle_body (HIR::BlockExpr &body)
   {
-    translated = ExprStmtBuilder (ctx).build (body);
-    if (body.has_expr () && !lookup_type (body)->is_unit ())
+    translated = ExprStmtBuilder (ctx).build (body, RETURN_VALUE_PLACE);
+    if (!ctx.get_current_bb ().is_terminated ())
       {
-	push_assignment (RETURN_VALUE_PLACE, translated);
+	if (ctx.place_db[RETURN_VALUE_PLACE].tyty->is_unit ())
+	  {
+	    push_assignment (RETURN_VALUE_PLACE,
+			     ctx.place_db.get_constant (
+			       ctx.place_db[RETURN_VALUE_PLACE].tyty));
+	  }
 	ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
       }
-    else if (!ctx.get_current_bb ().is_terminated ())
-      {
-	push_assignment (RETURN_VALUE_PLACE,
-			 ctx.place_db.get_constant (lookup_type (body)));
-	ctx.get_current_bb ().statements.emplace_back (Statement::Kind::RETURN);
-      }
-  };
+  }
 };
 
 } // namespace BIR
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 6f1579df1d9..51dd1436350 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -7,14 +7,6 @@ namespace BIR {
 
 constexpr auto indentation = "    ";
 
-uint32_t
-get_lifetime_name (Lifetime lifetime_id)
-{
-  rust_assert (lifetime_id.id >= FIRST_NORMAL_LIFETIME_ID);
-  // Start from 1 as rustc does.
-  return lifetime_id.id - FIRST_NORMAL_LIFETIME_ID + 1;
-}
-
 std::string
 get_tyty_name (TyTy::BaseType *tyty)
 {
@@ -42,7 +34,7 @@ void
 renumber_places (const Function &func, std::vector<PlaceId> &place_map)
 {
   // Renumbering places to avoid gaps in the place id space.
-  // This is needed to match MIR shape.
+  // This is needed to match MIR's shape.
   size_t next_out_id = 0;
 
   for (size_t in_id = FIRST_VARIABLE_PLACE; in_id < func.place_db.size ();
@@ -116,8 +108,8 @@ Dump::go (bool enable_simplify_cfg)
     stream << "_" << place_map[place_id] << ": "
 	   << get_tyty_name (func.place_db[place_id].tyty);
   });
-  stream << ") -> " << get_tyty_name (func.place_db[RETURN_VALUE_PLACE].tyty)
-	 << " {\n";
+  stream << ") -> " << get_tyty_name (func.place_db[RETURN_VALUE_PLACE].tyty);
+  stream << " {\n";
 
   // Print locals declaration.
   visit_scope (0);
@@ -138,16 +130,17 @@ Dump::go (bool enable_simplify_cfg)
       BasicBlock &bb = func.basic_blocks[statement_bb];
       stream << "\n";
       stream << indentation << "bb" << bb_fold_map[statement_bb] << ": {\n";
+      size_t i = 0;
       for (auto &stmt : bb.statements)
 	{
-	  stream << indentation << indentation;
+	  stream << indentation << i++ << indentation;
 	  visit (stmt);
 	  stream << ";\n";
 	}
       if (!bb_terminated)
 	{
 	  stream << indentation << indentation << "goto -> bb"
-		 << bb_fold_map[bb.successors.at (0)] << ";\n";
+		 << bb_fold_map[bb.successors.at (0)] << ";\t\t" << i++ << "\n";
 	}
       stream << indentation << "}\n";
     }
@@ -196,6 +189,18 @@ Dump::visit (const Statement &stmt)
       visit_place (stmt.get_place ());
       stream << ")";
       break;
+    case Statement::Kind::USER_TYPE_ASCRIPTION:
+      visit_place (stmt.get_place ());
+      stream << " = ";
+      stream << "UserTypeAscription(";
+      stream << get_tyty_name (func.place_db[stmt.get_place ()].tyty);
+      stream << ")";
+      break;
+    case Statement::Kind::FAKE_READ:
+      stream << "FakeRead(";
+      visit_place (stmt.get_place ());
+      stream << ")";
+      break;
     }
   statement_place = INVALID_PLACE;
 }
@@ -250,22 +255,12 @@ void
 Dump::visit (const BorrowExpr &expr)
 {
   stream << "&";
-  visit_lifetime (statement_place);
   visit_place (expr.get_place ());
 }
 
 void
 Dump::visit_lifetime (PlaceId place_id)
-{
-  const Place &place = func.place_db[place_id];
-  if (place.lifetime.has_lifetime ())
-    {
-      if (place.lifetime.id == STATIC_LIFETIME_ID)
-	stream << "'static ";
-      else
-	stream << "'#" << get_lifetime_name (place.lifetime) << " ";
-    }
-}
+{}
 
 void
 Dump::visit (const InitializerExpr &expr)
@@ -358,7 +353,8 @@ Dump::visit_scope (ScopeId id, size_t depth)
     {
       indent (depth + 1) << "let _";
       stream << place_map[local] << ": "
-	     << get_tyty_name (func.place_db[local].tyty) << ";\n";
+	     << get_tyty_name (func.place_db[local].tyty);
+      stream << ";\n";
     }
   for (auto &child : scope.children)
     {
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index 546890d797c..f22ab112b3e 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -22,6 +22,11 @@
 #include "rust-mapping-common.h"
 #include "rust-system.h"
 #include "rust-tyty.h"
+#include "rust-bir-free-region.h"
+
+#include "rust-tyty-variance-analysis.h"
+#include "polonius/rust-polonius-ffi.h"
+#include "rust-hir-type-check.h"
 
 namespace Rust {
 namespace BIR {
@@ -33,30 +38,8 @@ static constexpr PlaceId INVALID_PLACE = 0;
 static constexpr PlaceId RETURN_VALUE_PLACE = 1;
 static constexpr PlaceId FIRST_VARIABLE_PLACE = RETURN_VALUE_PLACE;
 
-/**
- * A unique identifier for a lifetime in the BIR. Only to be used INTERNALLY.
- */
-using LifetimeID = uint32_t;
-
-constexpr LifetimeID INVALID_LIFETIME_ID = 0;
-constexpr LifetimeID STATIC_LIFETIME_ID = 1;
-constexpr LifetimeID FIRST_NORMAL_LIFETIME_ID = 2;
-
-/** Representation of lifetimes in BIR. */
-struct Lifetime
-{
-  LifetimeID id = INVALID_LIFETIME_ID;
-
-  constexpr Lifetime (LifetimeID id) : id (id) {}
-  constexpr Lifetime (const Lifetime &) = default;
-  WARN_UNUSED_RESULT bool has_lifetime () const
-  {
-    return id != INVALID_LIFETIME_ID;
-  }
-  LifetimeID operator() () const { return id; }
-};
-constexpr Lifetime NO_LIFETIME = {INVALID_LIFETIME_ID};
-constexpr Lifetime STATIC_LIFETIME = {STATIC_LIFETIME_ID};
+using Variance = TyTy::VarianceAnalysis::Variance;
+using LoanId = uint32_t;
 
 /**
  * Representation of lvalues and constants in BIR.
@@ -92,25 +75,72 @@ struct Place
   /** Copy trait */
   bool is_copy;
   bool has_drop = false;
-  Lifetime lifetime;
   TyTy::BaseType *tyty;
+  FreeRegions regions{{}};
+  std::vector<LoanId> borrowed_by{};
 
 public:
   Place (Kind kind, uint32_t variable_or_field_index, const Path &path,
-	 bool is_copy, const Lifetime &lifetime, TyTy::BaseType *tyty)
+	 bool is_copy, TyTy::BaseType *tyty)
     : kind (kind), variable_or_field_index (variable_or_field_index),
-      path (path), is_copy (is_copy), lifetime (lifetime), tyty (tyty)
+      path (path), is_copy (is_copy), tyty (tyty)
   {}
 
+  // Place can only be stored in PlaceDB and used via reference. Turn all
+  // accidental copies into errors.
+  Place (const Place &) = delete;
+  Place (Place &&) = default;
+
 public:
-  [[nodiscard]] bool is_lvalue () const
+  WARN_UNUSED_RESULT bool is_lvalue () const
   {
-    return kind == VARIABLE || kind == FIELD || kind == INDEX || kind == DEREF;
+    return kind == VARIABLE || is_path ();
   }
 
-  [[nodiscard]] bool is_rvalue () const { return kind == TEMPORARY; }
+  WARN_UNUSED_RESULT bool is_rvalue () const { return kind == TEMPORARY; }
 
   bool is_constant () const { return kind == CONSTANT; }
+
+  WARN_UNUSED_RESULT bool is_var () const
+  {
+    return kind == VARIABLE || kind == TEMPORARY;
+  }
+
+  WARN_UNUSED_RESULT bool is_path () const
+  {
+    return kind == FIELD || kind == INDEX || kind == DEREF;
+  }
+
+  WARN_UNUSED_RESULT TyTy::BaseType *get_fn_return_ty () const
+  {
+    switch (tyty->get_kind ())
+      {
+      case TyTy::FNPTR:
+	return tyty->as<TyTy::FnPtr> ()->get_return_type ();
+      case TyTy::FNDEF:
+	return tyty->as<TyTy::FnType> ()->get_return_type ();
+      default:
+	rust_assert (false);
+      }
+  }
+
+  WARN_UNUSED_RESULT bool is_indirect () const
+  {
+    // TODO: probably incomplete, check other projections
+    switch (tyty->get_kind ())
+      {
+      case TyTy::REF:
+      case TyTy::POINTER:
+	return true;
+      default:
+	return false;
+      }
+  }
+
+  WARN_UNUSED_RESULT bool should_be_moved () const
+  {
+    return kind == TEMPORARY || (!is_copy && kind != CONSTANT);
+  }
 };
 
 using ScopeId = uint32_t;
@@ -128,6 +158,12 @@ struct Scope
   std::vector<PlaceId> locals;
 };
 
+struct Loan
+{
+  Mutability mutability;
+  PlaceId place;
+};
+
 /** Allocated places and keeps track of paths. */
 class PlaceDB
 {
@@ -138,11 +174,15 @@ private:
   std::vector<Scope> scopes;
   ScopeId current_scope = 0;
 
+  std::vector<Loan> loans;
+
+  Polonius::Origin next_free_region = 1;
+
 public:
   PlaceDB ()
   {
     // Reserved index for invalid place.
-    places.push_back ({Place::INVALID, 0, {}, false, NO_LIFETIME, nullptr});
+    places.push_back ({Place::INVALID, 0, {}, false, nullptr});
 
     scopes.emplace_back (); // Root scope.
   }
@@ -150,8 +190,13 @@ public:
   Place &operator[] (PlaceId id) { return places.at (id); }
   const Place &operator[] (PlaceId id) const { return places.at (id); }
 
+  decltype (places)::const_iterator begin () const { return places.begin (); }
+  decltype (places)::const_iterator end () const { return places.end (); }
+
   size_t size () const { return places.size (); }
 
+  const std::vector<Loan> &get_loans () const { return loans; }
+
   ScopeId get_current_scope_id () const { return current_scope; }
 
   const std::vector<Scope> &get_scopes () const { return scopes; }
@@ -160,6 +205,12 @@ public:
 
   const Scope &get_scope (ScopeId id) const { return scopes[id]; }
 
+  FreeRegion get_next_free_region () { return next_free_region++; }
+
+  FreeRegion peek_next_free_region () const { return next_free_region; }
+
+  FreeRegion &expose_next_free_region () { return next_free_region; }
+
   ScopeId push_new_scope ()
   {
     ScopeId new_scope = scopes.size ();
@@ -176,31 +227,42 @@ public:
     return current_scope;
   }
 
-  PlaceId add_place (Place place, PlaceId last_sibling = 0)
+  PlaceId add_place (Place &&place, PlaceId last_sibling = 0)
   {
-    places.push_back (place);
+    places.emplace_back (std::forward<Place &&> (place));
     PlaceId new_place = places.size () - 1;
+    Place &new_place_ref = places[new_place]; // Intentional shadowing.
     if (last_sibling == 0)
       {
-	places[place.path.parent].path.first_child = new_place;
+	places[new_place_ref.path.parent].path.first_child = new_place;
       }
     else
       {
 	places[last_sibling].path.next_sibling = new_place;
       }
 
-    if (place.kind == Place::VARIABLE || place.kind == Place::TEMPORARY)
+    if (new_place_ref.kind == Place::VARIABLE
+	|| new_place_ref.kind == Place::TEMPORARY)
       {
 	scopes[current_scope].locals.push_back (new_place);
       }
 
+    auto variances = Resolver::TypeCheckContext::get ()
+		       ->get_variance_analysis_ctx ()
+		       .query_type_variances (new_place_ref.tyty);
+    std::vector<Polonius::Origin> regions;
+    for (size_t i = 0; i < variances.size (); i++)
+      {
+	regions.push_back (next_free_region++);
+      }
+    new_place_ref.regions.set_from (std::move (regions));
+
     return new_place;
   }
 
   PlaceId add_variable (NodeId id, TyTy::BaseType *tyty)
   {
-    return add_place (
-      {Place::VARIABLE, id, {}, is_type_copy (tyty), NO_LIFETIME, tyty}, 0);
+    return add_place ({Place::VARIABLE, id, {}, is_type_copy (tyty), tyty}, 0);
   }
 
   WARN_UNUSED_RESULT PlaceId lookup_or_add_path (Place::Kind kind,
@@ -222,15 +284,14 @@ public:
 	    current = places[current].path.next_sibling;
 	  }
       }
-    return add_place ({kind, id, Place::Path{parent, 0, 0}, is_type_copy (tyty),
-		       NO_LIFETIME, tyty},
+    return add_place ({kind, (uint32_t) id, Place::Path{parent, 0, 0},
+		       is_type_copy (tyty), tyty},
 		      current);
   }
 
   PlaceId add_temporary (TyTy::BaseType *tyty)
   {
-    return add_place (
-      {Place::TEMPORARY, 0, {}, is_type_copy (tyty), NO_LIFETIME, tyty}, 0);
+    return add_place ({Place::TEMPORARY, 0, {}, is_type_copy (tyty), tyty}, 0);
   }
 
   PlaceId get_constant (TyTy::BaseType *tyty)
@@ -238,11 +299,7 @@ public:
     auto lookup = constants_lookup.find (tyty);
     if (lookup != constants_lookup.end ())
       return lookup->second;
-    Lifetime lifetime
-      = tyty->get_kind () == TyTy::REF ? STATIC_LIFETIME : NO_LIFETIME;
-    Place place = {Place::CONSTANT, 0, {}, is_type_copy (tyty), lifetime, tyty};
-    places.push_back (place);
-    return places.size () - 1;
+    return add_place ({Place::CONSTANT, 0, {}, is_type_copy (tyty), tyty});
   }
 
   PlaceId lookup_variable (NodeId id)
@@ -257,15 +314,46 @@ public:
 	current++;
       }
     return INVALID_PLACE;
-  };
+  }
+
+  LoanId add_loan (Loan &&loan)
+  {
+    LoanId id = loans.size ();
+    loans.push_back (std::forward<Loan &&> (loan));
+    PlaceId borrowed_place = loans.rbegin ()->place;
+    places[loans.rbegin ()->place].borrowed_by.push_back (id);
+    if (places[borrowed_place].kind == Place::DEREF)
+      {
+	places[places[borrowed_place].path.parent].borrowed_by.push_back (id);
+      }
+    return id;
+  }
+
+  PlaceId get_var (PlaceId id) const
+  {
+    if (places[id].is_var ())
+      return id;
+    rust_assert (places[id].is_path ());
+    PlaceId current = id;
+    while (!places[current].is_var ())
+      {
+	current = places[current].path.parent;
+      }
+    return current;
+  }
+
+  void set_next_free_region (Polonius::Origin next_free_region)
+  {
+    this->next_free_region = next_free_region;
+  }
 
   PlaceId lookup_or_add_variable (NodeId id, TyTy::BaseType *tyty)
   {
     auto lookup = lookup_variable (id);
     if (lookup != INVALID_PLACE)
       return lookup;
-    add_place (
-      {Place::VARIABLE, id, {}, is_type_copy (tyty), NO_LIFETIME, tyty});
+
+    add_place ({Place::VARIABLE, id, {}, is_type_copy (tyty), tyty});
     return places.size () - 1;
   };
 
@@ -298,6 +386,7 @@ private:
     switch (ty->get_kind ())
       {
       case TyTy::REF:
+	return ty->as<TyTy::ReferenceType> ()->mutability () == Mutability::Imm;
       case TyTy::POINTER:
       case TyTy::SLICE:
       case TyTy::BOOL:
@@ -335,6 +424,21 @@ private:
       }
     rust_unreachable ();
   }
+
+  /** Check whether given place is not out-of-scope. */
+  WARN_UNUSED_RESULT bool is_in_scope (PlaceId place) const
+  {
+    for (ScopeId scope = current_scope; scope != INVALID_SCOPE;
+	 scope = scopes[scope].parent)
+      {
+	auto &scope_ref = scopes[scope];
+	if (std::find (scope_ref.locals.begin (), scope_ref.locals.end (),
+		       place)
+	    != scope_ref.locals.end ())
+	  return true;
+      }
+    return false;
+  }
 };
 
 } // namespace BIR
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir.h b/gcc/rust/checks/errors/borrowck/rust-bir.h
index d21cb90abf5..4c298f14773 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir.h
@@ -22,6 +22,9 @@
 #include "rust-bir-place.h"
 #include "rust-bir-visitor.h"
 
+#include "polonius/rust-polonius-ffi.h"
+#include "rust-tyty-variance-analysis.h"
+
 namespace Rust {
 
 namespace BIR {
@@ -30,6 +33,8 @@ struct BasicBlock;
 class Statement;
 class AbstractExpr;
 
+using LoanId = uint32_t;
+
 /**
  * Top-level entity of the Borrow-checker IR (BIR).
  * It represents a single function (method, closure, etc.), which is the
@@ -40,6 +45,9 @@ struct Function
   PlaceDB place_db;
   std::vector<PlaceId> arguments;
   std::vector<BasicBlock> basic_blocks;
+  FreeRegions universal_regions;
+  std::vector<std::pair<FreeRegion, FreeRegion>> universal_region_bounds;
+  location_t location;
 };
 
 /** Single statement of BIR. */
@@ -48,12 +56,14 @@ class Statement
 public:
   enum class Kind
   {
-    ASSIGNMENT,	  // <place> = <expr>
-    SWITCH,	  // switch <place>
-    RETURN,	  // return
-    GOTO,	  // goto
-    STORAGE_DEAD, // StorageDead(<place>)
-    STORAGE_LIVE, // StorageLive(<place>)
+    ASSIGNMENT,		  // <place> = <expr>
+    SWITCH,		  // switch <place>
+    RETURN,		  // return
+    GOTO,		  // goto
+    STORAGE_DEAD,	  // StorageDead(<place>)
+    STORAGE_LIVE,	  // StorageLive(<place>)
+    USER_TYPE_ASCRIPTION, // UserTypeAscription(<place>, <tyty>)
+    FAKE_READ,
   };
 
 private:
@@ -66,6 +76,7 @@ private:
   // ASSIGNMENT: rhs
   // otherwise: <unused>
   std::unique_ptr<AbstractExpr> expr;
+  TyTy::BaseType *type;
 
 public:
   Statement (PlaceId lhs, AbstractExpr *rhs)
@@ -77,10 +88,15 @@ public:
     : kind (kind), place (place), expr (expr)
   {}
 
+  explicit Statement (Kind kind, PlaceId place, TyTy::BaseType *type)
+    : kind (kind), place (place), type (type)
+  {}
+
 public:
   WARN_UNUSED_RESULT Kind get_kind () const { return kind; }
   WARN_UNUSED_RESULT PlaceId get_place () const { return place; }
   WARN_UNUSED_RESULT AbstractExpr &get_expr () const { return *expr; }
+  WARN_UNUSED_RESULT TyTy::BaseType *get_type () const { return type; }
 };
 
 /** Unique identifier for a basic block in the BIR. */
@@ -122,7 +138,7 @@ class AbstractExpr : public Visitable
 
 public:
   explicit AbstractExpr (ExprKind kind) : kind (kind) {}
-  [[nodiscard]] ExprKind get_kind () const { return kind; }
+  WARN_UNUSED_RESULT ExprKind get_kind () const { return kind; }
 };
 
 class InitializerExpr : public VisitableImpl<AbstractExpr, InitializerExpr>
@@ -165,12 +181,17 @@ public:
 class BorrowExpr : public VisitableImpl<AbstractExpr, BorrowExpr>
 {
   PlaceId place;
+  LoanId loan;
+  Polonius::Origin origin;
 
 public:
-  explicit BorrowExpr (PlaceId place)
-    : VisitableImpl<AbstractExpr, BorrowExpr> (ExprKind::BORROW), place (place)
+  explicit BorrowExpr (PlaceId place, LoanId loan_id, Polonius::Origin lifetime)
+    : VisitableImpl<AbstractExpr, BorrowExpr> (ExprKind::BORROW), place (place),
+      loan (loan_id), origin (lifetime)
   {}
   WARN_UNUSED_RESULT PlaceId get_place () const { return place; }
+  WARN_UNUSED_RESULT LoanId get_loan () const { return loan; }
+  WARN_UNUSED_RESULT Polonius::Origin get_origin () const { return origin; }
 };
 
 /**
@@ -191,19 +212,21 @@ public:
   WARN_UNUSED_RESULT PlaceId get_rhs () const { return rhs; }
 };
 
-class CallExpr : public VisitableImpl<AbstractExpr, CallExpr>
+class CallExpr final : public VisitableImpl<AbstractExpr, CallExpr>
 {
   std::vector<PlaceId> arguments;
   PlaceId callable;
 
 public:
   explicit CallExpr (PlaceId callable, std::vector<PlaceId> &&arguments)
-    : VisitableImpl<AbstractExpr, CallExpr> (ExprKind::CALL),
-      arguments (arguments), callable (callable)
+    : VisitableImpl (ExprKind::CALL), arguments (arguments), callable (callable)
   {}
 
 public:
-  const std::vector<PlaceId> &get_arguments () const { return arguments; }
+  WARN_UNUSED_RESULT const std::vector<PlaceId> &get_arguments () const
+  {
+    return arguments;
+  }
   WARN_UNUSED_RESULT PlaceId get_callable () const { return callable; }
 };
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 121/125] gccrs: borrowck: Fact collector
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (118 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 120/125] gccrs: borrowck: Regions in BIR Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 122/125] gccrs: borrowck: Remove block braces to satisfy GNU style Arthur Cohen
                   ` (3 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

This is the main Polonius based logic which creates the information
Polonius needs from BIR. It is largly guessed and rever engineered, so
some aspects are probably wrong.

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-fact-collector.h: New file.
	* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
	Enable fact collection.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../errors/borrowck/rust-bir-fact-collector.h | 895 ++++++++++++++++++
 .../errors/borrowck/rust-borrow-checker.cc    |   3 +
 2 files changed, 898 insertions(+)
 create mode 100644 gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h b/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
new file mode 100644
index 00000000000..17c198e0fa7
--- /dev/null
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
@@ -0,0 +1,895 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_BIR_FACT_COLLECTOR_H
+#define RUST_BIR_FACT_COLLECTOR_H
+
+#include "rust-bir-visitor.h"
+#include "rust-bir.h"
+#include "rust-bir-place.h"
+#include "polonius/rust-polonius.h"
+
+namespace Rust {
+namespace BIR {
+
+enum class PointPosition : uint8_t
+{
+  START,
+  MID
+};
+
+class FactCollector : public Visitor
+{
+  // Output.
+  Polonius::Facts facts;
+
+  // Read-only context.
+  const PlaceDB &place_db;
+  const std::vector<BasicBlock> &basic_blocks;
+  const PlaceId first_local;
+  const location_t location;
+
+  Resolver::TypeCheckContext &tyctx;
+
+  // Collector state.
+  BasicBlockId current_bb = 0;
+  uint32_t current_stmt = 0;
+  PlaceId lhs = INVALID_PLACE;
+
+  // PlaceDB is const in this phase, so this is used to generate fresh regions.
+  FreeRegion next_fresh_region;
+  RegionBinder region_binder{next_fresh_region};
+
+  std::vector<Polonius::Point> cfg_points_all;
+
+  FreeRegions bind_regions (std::vector<TyTy::Region> regions,
+			    FreeRegions parent_free_regions)
+  {
+    return region_binder.bind_regions (regions, parent_free_regions);
+  }
+
+  FreeRegions make_fresh_regions (size_t size)
+  {
+    std::vector<FreeRegion> free_regions;
+    for (size_t i = 0; i < size; i++)
+      {
+	free_regions.push_back (region_binder.get_next_free_region ());
+      }
+    return FreeRegions (std::move (free_regions));
+  }
+
+public:
+  static Polonius::Facts collect (Function &func)
+  {
+    FactCollector collector (func);
+    collector.init_universal_regions (func.universal_regions,
+				      func.universal_region_bounds);
+
+    collector.visit_statemensts ();
+    collector.visit_places (func.arguments);
+
+    return std::move (collector.facts);
+  }
+
+protected: // Constructor and destructor.
+  explicit FactCollector (Function &func)
+    : place_db (func.place_db), basic_blocks (func.basic_blocks),
+      first_local (func.arguments.empty () ? FIRST_VARIABLE_PLACE
+					   : *func.arguments.rbegin () + 1),
+      location (func.location), tyctx (*Resolver::TypeCheckContext::get ()),
+      next_fresh_region (place_db.peek_next_free_region ())
+  {}
+  ~FactCollector () = default;
+
+protected: // Main collection entry points (for different categories).
+  void init_universal_regions (
+    const FreeRegions &universal_regions,
+    const decltype (Function::universal_region_bounds) &universal_region_bounds)
+  {
+    size_t next_loan = place_db.get_loans ().size ();
+    facts.universal_region.emplace_back (0);
+    facts.placeholder.emplace_back (0, next_loan++);
+
+    for (auto &region : universal_regions)
+      {
+	facts.universal_region.emplace_back (region);
+	facts.placeholder.emplace_back (region, next_loan++);
+	facts.known_placeholder_subset.emplace_back (0, region);
+      }
+
+    // Copy already collected subset facts, that are universally valid.
+    for (auto &bound : universal_region_bounds)
+      facts.known_placeholder_subset.emplace_back (bound.first, bound.second);
+  }
+
+  void visit_places (const std::vector<PlaceId> &args)
+  {
+    for (PlaceId place_id = 0; place_id < place_db.size (); ++place_id)
+      {
+	auto &place = place_db[place_id];
+
+	switch (place.kind)
+	  {
+	  case Place::VARIABLE:
+	  case Place::TEMPORARY:
+	    facts.path_is_var.emplace_back (place_id, place_id);
+	    for (auto &region : place.regions)
+	      {
+		facts.use_of_var_derefs_origin.emplace_back (place_id, region);
+	      }
+	    // TODO: drop_of_var_derefs_origin
+	    break;
+	  case Place::FIELD:
+	    sanizite_field (place_id);
+	    facts.child_path.emplace_back (place_id, place.path.parent);
+	    break;
+	  case Place::INDEX:
+	    push_subset_all (place.tyty, place.regions,
+			     place_db[place.path.parent].regions);
+	    facts.child_path.emplace_back (place_id, place.path.parent);
+	    break;
+	  case Place::DEREF:
+	    sanitize_deref (place_id);
+	    facts.child_path.emplace_back (place_id, place.path.parent);
+	    break;
+	  case Place::CONSTANT:
+	  case Place::INVALID:
+	    break;
+	  }
+      }
+
+    for (PlaceId arg = FIRST_VARIABLE_PLACE + 1; arg < first_local; ++arg)
+      {
+	facts.path_assigned_at_base.emplace_back (
+	  arg, get_point (0, 0, PointPosition::START));
+      }
+    for (PlaceId place = first_local; place < place_db.size (); ++place)
+      {
+	if (place_db[place].is_var ())
+	  facts.path_moved_at_base.emplace_back (
+	    place, get_point (0, 0, PointPosition::START));
+      }
+  }
+
+  void sanitize_deref (PlaceId place_id)
+  {
+    auto &place = place_db[place_id];
+    auto &base = place_db[place.path.parent];
+
+    rust_debug ("\tSanitize deref of %s", base.tyty->as_string ().c_str ());
+
+    std::vector<Polonius::Origin> regions;
+    regions.insert (regions.end (), base.regions.begin () + 1,
+		    base.regions.end ());
+    FreeRegions r (std::move (regions));
+    push_subset_all (place.tyty, r, place.regions);
+  }
+  void sanizite_field (PlaceId place_id)
+  {
+    auto &place = place_db[place_id];
+    auto &base = place_db[place.path.parent];
+
+    rust_debug ("\tSanitize field .%d of %s", place.variable_or_field_index,
+		base.tyty->as_string ().c_str ());
+
+    if (base.tyty->is<TyTy::TupleType> ())
+      return;
+    auto r = Resolver::TypeCheckContext::get ()
+	       ->get_variance_analysis_ctx ()
+	       .query_field_regions (base.tyty->as<TyTy::ADTType> (), 0,
+				     place.variable_or_field_index,
+				     base.regions); // FIXME
+    FreeRegions f (std::move (r));
+    push_subset_all (place.tyty, f, place.regions);
+  }
+
+  void visit_statemensts ()
+  {
+    rust_debug ("visit_statemensts");
+
+    for (current_bb = 0; current_bb < basic_blocks.size (); ++current_bb)
+      {
+	auto &bb = basic_blocks[current_bb];
+	for (current_stmt = 0; current_stmt < bb.statements.size ();
+	     ++current_stmt)
+	  {
+	    cfg_points_all.push_back (get_current_point_start ());
+	    cfg_points_all.push_back (get_current_point_mid ());
+
+	    add_stmt_to_cfg (current_bb, current_stmt);
+
+	    visit (bb.statements[current_stmt]);
+	  }
+      }
+    current_bb = 0;
+    current_stmt = 0;
+  }
+
+  void visit (const Statement &stmt) override
+  {
+    switch (stmt.get_kind ())
+      {
+	case Statement::Kind::ASSIGNMENT: {
+	  // TODO: for unwind, must had hadning for non-panic-only assignements
+	  issue_write_deep (stmt.get_place ());
+	  visit_assignment_expr (stmt.get_place (), stmt.get_expr ());
+	  break;
+	}
+	case Statement::Kind::SWITCH: {
+	  issue_read_move (stmt.get_place ());
+	  issue_jumps ();
+	}
+	break;
+	case Statement::Kind::GOTO: {
+	  issue_jumps ();
+	}
+	break;
+	case Statement::Kind::RETURN: {
+	  issue_place_access (RETURN_VALUE_PLACE);
+	  issue_locals_dealloc ();
+	  break;
+	}
+	case Statement::Kind::STORAGE_DEAD: {
+	  facts.path_moved_at_base.emplace_back (stmt.get_place (),
+						 get_current_point_mid ());
+	  facts.var_defined_at.emplace_back (stmt.get_place (),
+					     get_current_point_mid ());
+	  break;
+	}
+	case Statement::Kind::STORAGE_LIVE: {
+	  issue_write_deep (stmt.get_place (), true);
+	  break;
+	}
+	case Statement::Kind::USER_TYPE_ASCRIPTION: {
+	  issue_user_type_constraints (stmt.get_place (), stmt.get_type ());
+	  break;
+	}
+	case Statement::Kind::FAKE_READ: {
+	  issue_place_access (stmt.get_place ());
+	  break;
+	}
+      }
+  }
+
+  void visit_assignment_expr (PlaceId lhs, AbstractExpr &expr)
+  {
+    this->lhs = lhs;
+    expr.accept_vis (*this);
+    this->lhs = INVALID_PLACE;
+  }
+
+  void visit (const InitializerExpr &expr) override
+  {
+    sanitize_constrains_at_init (lhs);
+
+    for (auto init_value : expr.get_values ())
+      issue_read_move (init_value);
+  }
+
+  void visit (const Operator<1> &expr) override
+  {
+    sanitize_constrains_at_init (lhs);
+    issue_read_move (expr.get_operand<0> ());
+  }
+
+  void visit (const Operator<2> &expr) override
+  {
+    sanitize_constrains_at_init (lhs);
+    issue_read_move (expr.get_operand<0> ());
+    issue_read_move (expr.get_operand<1> ());
+  }
+
+  void visit (const BorrowExpr &expr) override
+  {
+    rust_debug ("\t_%u = BorrowExpr(_%u)", lhs - 1, expr.get_place () - 1);
+
+    auto loan = place_db.get_loans ()[expr.get_loan ()];
+
+    auto &base_place = place_db[expr.get_place ()];
+    auto &ref_place = place_db[lhs];
+
+    issue_place_access (expr.get_place ());
+
+    // See compiler/rustc_borrowck/src/type_check/mod.rs:add_reborrow_constraint
+    if (base_place.kind == Place::DEREF)
+      {
+	// Reborrow
+
+	auto &main_loan_place = place_db[base_place.path.parent];
+	if (loan.mutability == Mutability::Mut)
+	  {
+	    if (!main_loan_place.tyty->as<TyTy::ReferenceType> ()
+		   ->is_mutable ())
+	      rust_error_at (location,
+			     "Cannot reborrow immutable borrow as mutable");
+	    issue_loan (expr.get_origin (), expr.get_loan ());
+	  }
+
+	push_subset (main_loan_place.regions[0], expr.get_origin ());
+      }
+    else
+      {
+	issue_loan (expr.get_origin (), expr.get_loan ());
+      }
+
+    auto loan_regions = base_place.regions.prepend (expr.get_origin ());
+    push_subset (ref_place.tyty, loan_regions, ref_place.regions);
+  }
+
+  void visit (const Assignment &expr) override
+  {
+    rust_debug ("\t_%u = Assignment(_%u) at %u:%u", lhs - 1,
+		expr.get_rhs () - 1, current_bb, current_stmt);
+
+    issue_read_move (expr.get_rhs ());
+    push_subset (lhs, expr.get_rhs ());
+  }
+
+  void visit (const CallExpr &expr) override
+  {
+    rust_debug ("\t_%u = CallExpr(_%u)", lhs - 1, expr.get_callable () - 1);
+
+    auto &return_place = place_db[lhs];
+    auto &callable_place = place_db[expr.get_callable ()];
+    auto callable_ty = callable_place.tyty->as<TyTy::CallableTypeInterface> ();
+
+    issue_read_move (expr.get_callable ());
+
+    // Each call needs unique regions.
+    auto call_regions = make_fresh_regions (callable_place.regions.size ());
+
+    for (size_t i = 0; i < expr.get_arguments ().size (); ++i)
+      {
+	auto arg = expr.get_arguments ().at (i);
+	auto arg_regions
+	  = bind_regions (Resolver::TypeCheckContext::get ()
+			    ->get_variance_analysis_ctx ()
+			    .query_type_regions (
+			      callable_ty->get_param_type_at (i)),
+			  call_regions);
+	issue_read_move (arg);
+	push_subset (place_db[arg].tyty, place_db[arg].regions, arg_regions);
+      }
+
+    // sanitize return regions
+    sanitize_constrains_at_init (lhs);
+
+    auto return_regions
+      = bind_regions (Resolver::TypeCheckContext::get ()
+			->get_variance_analysis_ctx ()
+			.query_type_regions (
+			  callable_ty->as<TyTy::FnType> ()->get_return_type ()),
+		      call_regions);
+    push_subset (return_place.tyty, return_regions, return_place.regions);
+
+    issue_jumps ();
+  }
+
+protected: // Statement visitor helpers
+  WARN_UNUSED_RESULT const BasicBlock &get_current_bb () const
+  {
+    return basic_blocks[current_bb];
+  }
+
+  WARN_UNUSED_RESULT static Polonius::Point
+  get_point (BasicBlockId bb, uint32_t stmt, PointPosition pos)
+  {
+    Polonius::Point point = 0;
+    point |= (bb << 16);
+    point |= (stmt << 1);
+    point |= (static_cast<uint8_t> (pos) & 1);
+    return point;
+  }
+
+  WARN_UNUSED_RESULT Polonius::Point get_current_point_start () const
+  {
+    return get_point (current_bb, current_stmt, PointPosition::START);
+  }
+
+  WARN_UNUSED_RESULT Polonius::Point get_current_point_mid () const
+  {
+    return get_point (current_bb, current_stmt, PointPosition::MID);
+  }
+
+  void add_stmt_to_cfg (BasicBlockId bb, uint32_t stmt)
+  {
+    if (stmt != 0)
+      {
+	facts.cfg_edge.emplace_back (get_point (bb, stmt - 1,
+						PointPosition::MID),
+				     get_point (bb, stmt,
+						PointPosition::START));
+      }
+
+    facts.cfg_edge.emplace_back (get_point (bb, stmt, PointPosition::START),
+				 get_point (bb, stmt, PointPosition::MID));
+  }
+
+protected: // Generic BIR operations.
+  void issue_jumps ()
+  {
+    for (auto succ : get_current_bb ().successors)
+      facts.cfg_edge.emplace_back (get_current_point_mid (),
+				   get_point (succ, 0, PointPosition::START));
+  }
+
+  /* Shallow r/w access */
+  void issue_place_access (PlaceId place_id)
+  {
+    auto &place = place_db[place_id];
+
+    if (place.is_constant ())
+      return;
+
+    if (place_id != RETURN_VALUE_PLACE)
+      facts.path_accessed_at_base.emplace_back (place_id,
+						get_current_point_mid ());
+
+    if (place.is_var ())
+      facts.var_used_at.emplace_back (place_id, get_current_point_mid ());
+    else if (place.is_path ())
+      {
+	facts.var_used_at.emplace_back (place_db.get_var (place_id),
+					get_current_point_mid ());
+      }
+  }
+
+  /** Deep read access, which consumes the place. */
+  void issue_read_move (PlaceId place_id)
+  {
+    auto &place = place_db[place_id];
+
+    issue_place_access (place_id);
+    if (place.should_be_moved ())
+      {
+	issue_move (place_id);
+      }
+    else
+      {
+	check_read_for_conflicts (place_id);
+      }
+  }
+
+  void issue_write_deep (PlaceId place_id, bool is_init = false)
+  {
+    auto &place = place_db[place_id];
+    rust_assert (place.is_lvalue () || place.is_rvalue ());
+
+    if (place.is_var ())
+      facts.var_defined_at.emplace_back (place_id, get_current_point_mid ());
+
+    if (!is_init)
+      {
+	facts.path_assigned_at_base.emplace_back (place_id,
+						  get_current_point_mid ());
+	check_write_for_conflict (place_id);
+	kill_borrows_for_place (place_id);
+      }
+  }
+
+  void issue_move (PlaceId place_id, bool initial = false)
+  {
+    if (!place_db[place_id].should_be_moved ())
+      return;
+
+    facts.path_moved_at_base.emplace_back (
+      place_id, initial ? get_point (0, 0, PointPosition::START)
+			: get_current_point_mid ());
+
+    check_move_behind_reference (place_id);
+
+    if (!initial)
+      {
+	check_write_for_conflict (place_id);
+	kill_borrows_for_place (place_id);
+      }
+  }
+
+  void issue_loan (Polonius::Origin origin, LoanId loan_id)
+  {
+    facts.loan_issued_at.emplace_back (origin, loan_id,
+				       get_current_point_mid ());
+
+    check_for_borrow_conficts (place_db.get_loans ()[loan_id].place, loan_id,
+			       place_db.get_loans ()[loan_id].mutability);
+  }
+
+  void issue_locals_dealloc ()
+  {
+    for (LoanId loan_id = 0; loan_id < place_db.get_loans ().size (); ++loan_id)
+      {
+	auto &loan = place_db.get_loans ()[loan_id];
+	auto loaned_var_id = place_db.get_var (loan.place);
+	if (place_db[loaned_var_id].tyty->is<TyTy::ReferenceType> ())
+	  continue;
+	if (loaned_var_id >= first_local)
+	  facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						  loan_id);
+      }
+  }
+
+  void issue_user_type_constraints (PlaceId place_id, TyTy::BaseType *type)
+  {
+    auto user_regions = Resolver::TypeCheckContext::get ()
+			  ->get_variance_analysis_ctx ()
+			  .query_type_regions (type);
+    push_subset_user (place_db[place_id].tyty, place_db[place_id].regions,
+		      user_regions);
+  }
+
+  void check_read_for_conflicts (PlaceId place_id)
+  {
+    place_db.for_each_path_segment (place_id, [&] (PlaceId id) {
+      for (auto loan : place_db[id].borrowed_by)
+	{
+	  if (place_db.get_loans ()[loan].mutability == Mutability::Mut)
+	    {
+	      facts.loan_invalidated_at.emplace_back (
+		get_current_point_start (), loan);
+	    }
+	}
+    });
+    place_db.for_each_path_from_root (place_id, [&] (PlaceId id) {
+      for (auto loan : place_db[id].borrowed_by)
+	{
+	  if (place_db.get_loans ()[loan].mutability == Mutability::Mut)
+	    {
+	      facts.loan_invalidated_at.emplace_back (
+		get_current_point_start (), loan);
+	    }
+	}
+    });
+  }
+
+  void check_write_for_conflict (PlaceId place_id)
+  {
+    place_db.for_each_path_segment (place_id, [&] (PlaceId id) {
+      for (auto loan : place_db[id].borrowed_by)
+	{
+	  facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						  loan);
+	}
+    });
+    place_db.for_each_path_from_root (place_id, [&] (PlaceId id) {
+      for (auto loan : place_db[id].borrowed_by)
+	{
+	  facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						  loan);
+	}
+    });
+  }
+
+  void check_for_borrow_conficts (PlaceId place_id, LoanId loan,
+				  Mutability mutability)
+  {
+    place_db.for_each_path_segment (place_id, [&] (PlaceId id) {
+      for (auto other_loan : place_db[id].borrowed_by)
+	{
+	  if (mutability == Mutability::Imm
+	      && place_db.get_loans ()[other_loan].mutability
+		   == Mutability::Imm)
+	    {
+	      continue;
+	    }
+	  else
+	    {
+	      facts.loan_invalidated_at.emplace_back (
+		get_current_point_start (), other_loan);
+	    }
+	}
+    });
+
+    place_db.for_each_path_from_root (place_id, [&] (PlaceId id) {
+      for (auto other_loan : place_db[id].borrowed_by)
+	{
+	  if (mutability == Mutability::Imm
+	      && place_db.get_loans ()[other_loan].mutability
+		   == Mutability::Imm)
+	    {
+	      continue;
+	    }
+	  else
+	    {
+	      facts.loan_invalidated_at.emplace_back (
+		get_current_point_start (), other_loan);
+	    }
+	}
+    });
+  }
+
+  void check_move_behind_reference (PlaceId place_id)
+  {
+    place_db.for_each_path_segment (place_id, [&] (PlaceId id) {
+      if (id == place_id)
+	return;
+      if (place_db[id].kind == Place::DEREF)
+	{
+	  rust_error_at (location, "Cannot move from behind a reference.");
+	}
+    });
+  }
+
+  void kill_borrows_for_place (PlaceId place_id)
+  {
+    auto &place = place_db[place_id];
+    for (auto loan : place.borrowed_by)
+      {
+	// TODO: this is more complicated, see
+	// compiler/rustc_borrowck/src/constraint_generation.rs:176
+	facts.loan_killed_at.emplace_back (loan, get_current_point_mid ());
+      }
+  }
+
+protected: // Subset helpers.
+  void push_subset (FreeRegion lhs, FreeRegion rhs)
+  {
+    rust_debug ("\t\tpush_subset: '?%lu: '?%lu", lhs, rhs);
+
+    facts.subset_base.emplace_back (lhs, rhs, get_current_point_mid ());
+  }
+
+  void push_subset_all (FreeRegion lhs, FreeRegion rhs)
+  {
+    rust_debug ("\t\tpush_subset_all: '?%lu: '?%lu", lhs, rhs);
+
+    for (auto point : cfg_points_all)
+      facts.subset_base.emplace_back (lhs, rhs, point);
+  }
+
+  void push_subset (Variance variance, FreeRegion lhs, FreeRegion rhs)
+  {
+    if (variance.is_covariant ())
+      {
+	push_subset (lhs, rhs);
+      }
+    else if (variance.is_contravariant ())
+      {
+	push_subset (rhs, lhs);
+      }
+    else if (variance.is_invariant ())
+      {
+	push_subset (lhs, rhs);
+	push_subset (rhs, lhs);
+      }
+  }
+
+  void push_subset_all (Variance variance, FreeRegion lhs, FreeRegion rhs)
+  {
+    if (variance.is_covariant ())
+      {
+	push_subset_all (lhs, rhs);
+      }
+    else if (variance.is_contravariant ())
+      {
+	push_subset_all (rhs, lhs);
+      }
+    else if (variance.is_invariant ())
+      {
+	push_subset_all (lhs, rhs);
+	push_subset_all (rhs, lhs);
+      }
+  }
+
+  void push_subset (PlaceId lhs, PlaceId rhs)
+  {
+    auto &lhs_place = place_db[lhs];
+    auto &rhs_place = place_db[rhs];
+
+    push_subset (lhs_place.tyty, rhs_place.regions, lhs_place.regions);
+  }
+
+  void push_subset (TyTy::BaseType *type, FreeRegions lhs, FreeRegions rhs)
+  {
+    auto variances = Resolver::TypeCheckContext::get ()
+		       ->get_variance_analysis_ctx ()
+		       .query_type_variances (type);
+    rust_assert (lhs.size () == rhs.size ());
+    rust_assert (lhs.size () == variances.size ());
+    for (size_t i = 0; i < lhs.size (); ++i)
+      {
+	push_subset (variances[i], lhs[i], rhs[i]);
+      }
+  }
+
+  void push_subset_all (TyTy::BaseType *type, FreeRegions lhs, FreeRegions rhs)
+  {
+    auto variances = Resolver::TypeCheckContext::get ()
+		       ->get_variance_analysis_ctx ()
+		       .query_type_variances (type);
+    rust_assert (lhs.size () == rhs.size ());
+    rust_assert (lhs.size () == variances.size ());
+    for (size_t i = 0; i < lhs.size (); ++i)
+      {
+	push_subset_all (variances[i], lhs[i], rhs[i]);
+      }
+  }
+
+  void push_subset_user (TyTy::BaseType *type, FreeRegions free_regions,
+			 std::vector<TyTy::Region> user_regions)
+  {
+    auto variances = Resolver::TypeCheckContext::get ()
+		       ->get_variance_analysis_ctx ()
+		       .query_type_variances (type);
+    rust_assert (free_regions.size () == user_regions.size ());
+    rust_assert (free_regions.size () == variances.size ());
+
+    for (size_t i = 0; i < free_regions.size (); ++i)
+      {
+	if (user_regions[i].is_named ())
+	  {
+	    push_subset (variances[i], free_regions[i],
+			 {Polonius::Origin (user_regions[i].get_index ())});
+	  }
+	else if (user_regions[i].is_anonymous ())
+	  {
+	    // IGNORE
+	  }
+	else
+	  {
+	    rust_internal_error_at (UNKNOWN_LOCATION, "Unexpected region type");
+	  }
+      }
+  }
+
+  /**
+   * Apply type and lifetime bounds
+   *
+   * For a place we have a list of fresh regions. We need to apply constraints
+   * from type definition to it. First `n` regions belong to the lifetime
+   * parameters of the type. The rest are flatten lifetime parameters of the
+   * type arguments. We walk the type arguments with a offset
+   */
+  void sanitize_constrains_at_init (PlaceId place_id)
+  {
+    auto &place = place_db[place_id];
+
+    rust_debug ("\tSanitize constraints of %s",
+		place.tyty->as_string ().c_str ());
+
+    if (auto generic = place.tyty->try_as<TyTy::SubstitutionRef> ())
+      {
+	auto &regions = place.regions;
+	auto region_end = sanitize_constraints (*generic, 0, regions);
+	rust_assert (region_end == regions.size ());
+      }
+    else if (place.tyty->is<TyTy::ReferenceType> ())
+      {
+	for (auto &region : place.regions)
+	  {
+	    if (region != place.regions[0])
+	      push_subset (region, place.regions[0]);
+	  }
+      }
+  }
+
+  size_t sanitize_constraints (const TyTy::BaseType *type, size_t region_start,
+			       const FreeRegions &regions)
+  {
+    switch (type->get_kind ())
+      {
+      case TyTy::ADT:
+	return sanitize_constraints (type->as<const TyTy::ADTType> (),
+				     region_start, regions);
+      case TyTy::STR:
+	return region_start;
+      case TyTy::REF:
+	return 1
+	       + sanitize_constraints (
+		 type->as<const TyTy::ReferenceType> ()->get_base (),
+		 region_start, regions);
+      case TyTy::POINTER:
+	return sanitize_constraints (
+	  type->as<const TyTy::PointerType> ()->get_base (), region_start,
+	  regions);
+      case TyTy::ARRAY:
+	return sanitize_constraints (
+	  type->as<const TyTy::ArrayType> ()->get_element_type (), region_start,
+	  regions);
+      case TyTy::SLICE:
+	return sanitize_constraints (
+	  type->as<const TyTy::SliceType> ()->get_element_type (), region_start,
+	  regions);
+      case TyTy::FNDEF:
+	case TyTy::TUPLE: {
+	  for (auto &field : type->as<const TyTy::TupleType> ()->get_fields ())
+	    sanitize_constraints (field.get_tyty (), region_start, regions);
+	}
+	break;
+      case TyTy::FNPTR:
+      case TyTy::PROJECTION:
+	return sanitize_constraints (*type->as<const TyTy::SubstitutionRef> (),
+				     region_start, regions);
+      case TyTy::BOOL:
+      case TyTy::CHAR:
+      case TyTy::INT:
+      case TyTy::UINT:
+      case TyTy::FLOAT:
+      case TyTy::USIZE:
+      case TyTy::ISIZE:
+      case TyTy::NEVER:
+      case TyTy::DYNAMIC:
+      case TyTy::CLOSURE:
+      case TyTy::ERROR:
+	return region_start;
+      case TyTy::PLACEHOLDER:
+      case TyTy::INFER:
+      case TyTy::PARAM:
+	rust_unreachable ();
+      }
+    rust_unreachable ();
+  }
+
+  size_t sanitize_constraints (const TyTy::SubstitutionRef &type,
+			       size_t region_start, const FreeRegions &regions)
+  {
+    for (auto constr : type.get_region_constraints ().region_region)
+      {
+	rust_assert (constr.first.is_early_bound ());
+	rust_assert (constr.second.is_early_bound ());
+	auto lhs = constr.first.get_index () + region_start;
+	auto rhs = constr.second.get_index () + region_start;
+	push_subset (regions[lhs], regions[rhs]);
+      }
+
+    size_t region_end = region_start + type.get_num_lifetime_params ();
+
+    /*
+     * For type `Foo<'a, T1, T2>`, where `T1 = &'b Vec<&'c i32>` and `T2 = &'d
+     * i32 the regions are `['a, 'b, 'c, 'd]`. The ranges
+     */
+    std::vector<size_t> type_param_region_ranges;
+    type_param_region_ranges.push_back (region_end);
+
+    for (auto type_param : type.get_substs ())
+      {
+	TyTy::SubstitutionArg arg = TyTy::SubstitutionArg::error ();
+	bool ok = type.get_used_arguments ().get_argument_for_symbol (
+	  type_param.get_param_ty (), &arg);
+	rust_assert (ok);
+	region_end
+	  = sanitize_constraints (arg.get_tyty (), region_end, regions);
+	type_param_region_ranges.push_back (region_end);
+      }
+
+    /*
+     * For constrain of form: `T: 'a` push outlives with all in range
+     * `indexof(T)..(indexof(T) + 1)`
+     */
+    for (auto constr : type.get_region_constraints ().type_region)
+      {
+	auto type_param_index_opt
+	  = type.get_used_arguments ().find_symbol (*constr.first);
+	rust_assert (type_param_index_opt.has_value ());
+	size_t type_param_index = type_param_index_opt.value ();
+
+	for (size_t i = type_param_region_ranges[type_param_index];
+	     i < type_param_region_ranges[type_param_index + 1]; ++i)
+	  {
+	    push_subset (regions[i],
+			 regions[constr.second.get_index () + region_start]);
+	  }
+      }
+
+    return region_end;
+  }
+}; // namespace BIR
+
+} // namespace BIR
+} // namespace Rust
+
+#endif // RUST_BIR_FACT_COLLECTOR_H
diff --git a/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc b/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
index 5daa7eb8ded..77726eb1c26 100644
--- a/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
@@ -20,6 +20,7 @@
 #include "rust-function-collector.h"
 #include "rust-bir-builder.h"
 #include "rust-bir-dump.h"
+#include "rust-bir-fact-collector.h"
 
 namespace Rust {
 namespace HIR {
@@ -86,6 +87,8 @@ BorrowChecker::go (HIR::Crate &crate)
 	  dump_function_bir (filename, bir,
 			     func->get_function_name ().as_string ());
 	}
+
+      auto facts = BIR::FactCollector::collect (bir);
     }
 
   for (auto closure ATTRIBUTE_UNUSED : collector.get_closures ())
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 122/125] gccrs: borrowck: Remove block braces to satisfy GNU style
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (119 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 121/125] gccrs: borrowck: Fact collector Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:57 ` [PATCH 123/125] gccrs: borrowck: Bump copyright notice Arthur Cohen
                   ` (2 subsequent siblings)
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-dump.cc (renumber_places):
	Remove unecessary braces.
	(Dump::go): Remove unecessary braces.
	(Dump::visit): Remove unecessary braces.
	(Dump::visit_scope): Remove unecessary braces.
	* checks/errors/borrowck/rust-bir-fact-collector.h (class FactCollector):
	Remove unecessary braces.
	(points): Remove unecessary braces.
	* checks/errors/borrowck/rust-bir-free-region.h: Remove unecessary braces.
	* checks/errors/borrowck/rust-bir-place.h: Remove unecessary braces.
	* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
	Remove unecessary braces.
	* checks/errors/borrowck/rust-function-collector.h: Remove unecessary braces.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../checks/errors/borrowck/rust-bir-dump.cc   | 47 ++++------
 .../errors/borrowck/rust-bir-fact-collector.h | 87 ++++++-------------
 .../errors/borrowck/rust-bir-free-region.h    | 16 +---
 .../checks/errors/borrowck/rust-bir-place.h   | 17 ++--
 .../errors/borrowck/rust-borrow-checker.cc    |  6 +-
 .../errors/borrowck/rust-function-collector.h |  4 +-
 6 files changed, 56 insertions(+), 121 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index 51dd1436350..a39f145f8f9 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -42,13 +42,9 @@ renumber_places (const Function &func, std::vector<PlaceId> &place_map)
     {
       const Place &place = func.place_db[in_id];
       if (place.kind == Place::VARIABLE || place.kind == Place::TEMPORARY)
-	{
-	  place_map[in_id] = next_out_id++;
-	}
+	place_map[in_id] = next_out_id++;
       else
-	{
-	  place_map[in_id] = INVALID_PLACE;
-	}
+	place_map[in_id] = INVALID_PLACE;
     }
 }
 
@@ -138,10 +134,9 @@ Dump::go (bool enable_simplify_cfg)
 	  stream << ";\n";
 	}
       if (!bb_terminated)
-	{
-	  stream << indentation << indentation << "goto -> bb"
-		 << bb_fold_map[bb.successors.at (0)] << ";\t\t" << i++ << "\n";
-	}
+	stream << indentation << indentation << "goto -> bb"
+	       << bb_fold_map[bb.successors.at (0)] << ";\t\t" << i++ << "\n";
+
       stream << indentation << "}\n";
     }
 
@@ -276,15 +271,13 @@ void
 Dump::visit (const CallExpr &expr)
 {
   stream << "Call(";
-  if (auto fn_type
-      = func.place_db[expr.get_callable ()].tyty->try_as<TyTy::FnType> ())
-    {
-      stream << fn_type->get_identifier ();
-    }
+  auto maybe_fn_type
+    = func.place_db[expr.get_callable ()].tyty->try_as<TyTy::FnType> ();
+  if (maybe_fn_type)
+    stream << maybe_fn_type->get_identifier ();
   else
-    {
-      visit_move_place (expr.get_callable ());
-    }
+    visit_move_place (expr.get_callable ());
+
   stream << ")(";
   print_comma_separated (stream, expr.get_arguments (),
 			 [this] (PlaceId place_id) {
@@ -321,13 +314,9 @@ void
 Dump::visit (const Assignment &expr)
 {
   if (func.place_db[expr.get_rhs ()].is_rvalue ())
-    {
-      visit_move_place (expr.get_rhs ());
-    }
+    visit_move_place (expr.get_rhs ());
   else
-    {
-      visit_place (expr.get_rhs ());
-    }
+    visit_place (expr.get_rhs ());
 }
 
 std::ostream &
@@ -346,9 +335,8 @@ Dump::visit_scope (ScopeId id, size_t depth)
     return;
 
   if (id > 1)
-    {
-      indent (depth) << "scope " << id - 1 << " {\n";
-    }
+    indent (depth) << "scope " << id - 1 << " {\n";
+
   for (auto &local : scope.locals)
     {
       indent (depth + 1) << "let _";
@@ -357,9 +345,8 @@ Dump::visit_scope (ScopeId id, size_t depth)
       stream << ";\n";
     }
   for (auto &child : scope.children)
-    {
-      visit_scope (child, (id >= 1) ? depth + 1 : depth);
-    }
+    visit_scope (child, (id >= 1) ? depth + 1 : depth);
+
   if (id > 1)
     indent (depth) << "}\n";
 }
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h b/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
index 17c198e0fa7..527ae65606c 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
@@ -67,9 +67,8 @@ class FactCollector : public Visitor
   {
     std::vector<FreeRegion> free_regions;
     for (size_t i = 0; i < size; i++)
-      {
-	free_regions.push_back (region_binder.get_next_free_region ());
-      }
+      free_regions.push_back (region_binder.get_next_free_region ());
+
     return FreeRegions (std::move (free_regions));
   }
 
@@ -129,9 +128,8 @@ protected: // Main collection entry points (for different categories).
 	  case Place::TEMPORARY:
 	    facts.path_is_var.emplace_back (place_id, place_id);
 	    for (auto &region : place.regions)
-	      {
-		facts.use_of_var_derefs_origin.emplace_back (place_id, region);
-	      }
+	      facts.use_of_var_derefs_origin.emplace_back (place_id, region);
+
 	    // TODO: drop_of_var_derefs_origin
 	    break;
 	  case Place::FIELD:
@@ -154,10 +152,9 @@ protected: // Main collection entry points (for different categories).
       }
 
     for (PlaceId arg = FIRST_VARIABLE_PLACE + 1; arg < first_local; ++arg)
-      {
-	facts.path_assigned_at_base.emplace_back (
-	  arg, get_point (0, 0, PointPosition::START));
-      }
+      facts.path_assigned_at_base.emplace_back (
+	arg, get_point (0, 0, PointPosition::START));
+
     for (PlaceId place = first_local; place < place_db.size (); ++place)
       {
 	if (place_db[place].is_var ())
@@ -560,17 +557,13 @@ protected: // Generic BIR operations.
   {
     place_db.for_each_path_segment (place_id, [&] (PlaceId id) {
       for (auto loan : place_db[id].borrowed_by)
-	{
-	  facts.loan_invalidated_at.emplace_back (get_current_point_start (),
-						  loan);
-	}
+	facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						loan);
     });
     place_db.for_each_path_from_root (place_id, [&] (PlaceId id) {
       for (auto loan : place_db[id].borrowed_by)
-	{
-	  facts.loan_invalidated_at.emplace_back (get_current_point_start (),
-						  loan);
-	}
+	facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						loan);
     });
   }
 
@@ -583,14 +576,10 @@ protected: // Generic BIR operations.
 	  if (mutability == Mutability::Imm
 	      && place_db.get_loans ()[other_loan].mutability
 		   == Mutability::Imm)
-	    {
-	      continue;
-	    }
+	    continue;
 	  else
-	    {
-	      facts.loan_invalidated_at.emplace_back (
-		get_current_point_start (), other_loan);
-	    }
+	    facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						    other_loan);
 	}
     });
 
@@ -600,14 +589,10 @@ protected: // Generic BIR operations.
 	  if (mutability == Mutability::Imm
 	      && place_db.get_loans ()[other_loan].mutability
 		   == Mutability::Imm)
-	    {
-	      continue;
-	    }
+	    continue;
 	  else
-	    {
-	      facts.loan_invalidated_at.emplace_back (
-		get_current_point_start (), other_loan);
-	    }
+	    facts.loan_invalidated_at.emplace_back (get_current_point_start (),
+						    other_loan);
 	}
     });
   }
@@ -618,9 +603,7 @@ protected: // Generic BIR operations.
       if (id == place_id)
 	return;
       if (place_db[id].kind == Place::DEREF)
-	{
-	  rust_error_at (location, "Cannot move from behind a reference.");
-	}
+	rust_error_at (location, "Cannot move from behind a reference.");
     });
   }
 
@@ -654,13 +637,9 @@ protected: // Subset helpers.
   void push_subset (Variance variance, FreeRegion lhs, FreeRegion rhs)
   {
     if (variance.is_covariant ())
-      {
-	push_subset (lhs, rhs);
-      }
+      push_subset (lhs, rhs);
     else if (variance.is_contravariant ())
-      {
-	push_subset (rhs, lhs);
-      }
+      push_subset (rhs, lhs);
     else if (variance.is_invariant ())
       {
 	push_subset (lhs, rhs);
@@ -671,13 +650,9 @@ protected: // Subset helpers.
   void push_subset_all (Variance variance, FreeRegion lhs, FreeRegion rhs)
   {
     if (variance.is_covariant ())
-      {
-	push_subset_all (lhs, rhs);
-      }
+      push_subset_all (lhs, rhs);
     else if (variance.is_contravariant ())
-      {
-	push_subset_all (rhs, lhs);
-      }
+      push_subset_all (rhs, lhs);
     else if (variance.is_invariant ())
       {
 	push_subset_all (lhs, rhs);
@@ -701,9 +676,7 @@ protected: // Subset helpers.
     rust_assert (lhs.size () == rhs.size ());
     rust_assert (lhs.size () == variances.size ());
     for (size_t i = 0; i < lhs.size (); ++i)
-      {
-	push_subset (variances[i], lhs[i], rhs[i]);
-      }
+      push_subset (variances[i], lhs[i], rhs[i]);
   }
 
   void push_subset_all (TyTy::BaseType *type, FreeRegions lhs, FreeRegions rhs)
@@ -714,9 +687,7 @@ protected: // Subset helpers.
     rust_assert (lhs.size () == rhs.size ());
     rust_assert (lhs.size () == variances.size ());
     for (size_t i = 0; i < lhs.size (); ++i)
-      {
-	push_subset_all (variances[i], lhs[i], rhs[i]);
-      }
+      push_subset_all (variances[i], lhs[i], rhs[i]);
   }
 
   void push_subset_user (TyTy::BaseType *type, FreeRegions free_regions,
@@ -731,18 +702,14 @@ protected: // Subset helpers.
     for (size_t i = 0; i < free_regions.size (); ++i)
       {
 	if (user_regions[i].is_named ())
-	  {
-	    push_subset (variances[i], free_regions[i],
-			 {Polonius::Origin (user_regions[i].get_index ())});
-	  }
+	  push_subset (variances[i], free_regions[i],
+		       {Polonius::Origin (user_regions[i].get_index ())});
 	else if (user_regions[i].is_anonymous ())
 	  {
 	    // IGNORE
 	  }
 	else
-	  {
-	    rust_internal_error_at (UNKNOWN_LOCATION, "Unexpected region type");
-	  }
+	  rust_internal_error_at (UNKNOWN_LOCATION, "Unexpected region type");
       }
   }
 
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h b/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
index 0560a894ab0..e5d6ef3c98b 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
@@ -75,21 +75,13 @@ public:
     for (auto &region : regions)
       {
 	if (region.is_early_bound ())
-	  {
-	    free_regions.push_back (parent_free_regions[region.get_index ()]);
-	  }
+	  free_regions.push_back (parent_free_regions[region.get_index ()]);
 	else if (region.is_static ())
-	  {
-	    free_regions.push_back (0);
-	  }
+	  free_regions.push_back (0);
 	else if (region.is_anonymous ())
-	  {
-	    free_regions.push_back (get_next_free_region ());
-	  }
+	  free_regions.push_back (get_next_free_region ());
 	else if (region.is_named ())
-	  {
-	    rust_unreachable (); // FIXME
-	  }
+	  rust_unreachable (); // FIXME
 	else
 	  {
 	    rust_sorry_at (UNKNOWN_LOCATION, "Unimplemented");
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index f22ab112b3e..752c8f42c00 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -233,28 +233,21 @@ public:
     PlaceId new_place = places.size () - 1;
     Place &new_place_ref = places[new_place]; // Intentional shadowing.
     if (last_sibling == 0)
-      {
-	places[new_place_ref.path.parent].path.first_child = new_place;
-      }
+      places[new_place_ref.path.parent].path.first_child = new_place;
     else
-      {
-	places[last_sibling].path.next_sibling = new_place;
-      }
+      places[last_sibling].path.next_sibling = new_place;
 
     if (new_place_ref.kind == Place::VARIABLE
 	|| new_place_ref.kind == Place::TEMPORARY)
-      {
-	scopes[current_scope].locals.push_back (new_place);
-      }
+      scopes[current_scope].locals.push_back (new_place);
 
     auto variances = Resolver::TypeCheckContext::get ()
 		       ->get_variance_analysis_ctx ()
 		       .query_type_variances (new_place_ref.tyty);
     std::vector<Polonius::Origin> regions;
     for (size_t i = 0; i < variances.size (); i++)
-      {
-	regions.push_back (next_free_region++);
-      }
+      regions.push_back (next_free_region++);
+
     new_place_ref.regions.set_from (std::move (regions));
 
     return new_place;
diff --git a/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc b/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
index 77726eb1c26..ae06aadaa5b 100644
--- a/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
@@ -92,10 +92,8 @@ BorrowChecker::go (HIR::Crate &crate)
     }
 
   for (auto closure ATTRIBUTE_UNUSED : collector.get_closures ())
-    {
-      rust_sorry_at (closure->get_locus (),
-		     "Closure borrow checking is not implemented yet.");
-    }
+    rust_sorry_at (closure->get_locus (),
+		   "Closure borrow checking is not implemented yet.");
 }
 
 } // namespace HIR
diff --git a/gcc/rust/checks/errors/borrowck/rust-function-collector.h b/gcc/rust/checks/errors/borrowck/rust-function-collector.h
index 272f20d5f93..7058451f2b5 100644
--- a/gcc/rust/checks/errors/borrowck/rust-function-collector.h
+++ b/gcc/rust/checks/errors/borrowck/rust-function-collector.h
@@ -50,9 +50,7 @@ protected:
   template <typename T> void visit_all (std::vector<std::unique_ptr<T>> &items)
   {
     for (std::unique_ptr<T> &item : items)
-      {
-	item->accept_vis (*this);
-      }
+      item->accept_vis (*this);
   }
 
   void visit (HIR::Function &function) override
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 123/125] gccrs: borrowck: Bump copyright notice
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (120 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 122/125] gccrs: borrowck: Remove block braces to satisfy GNU style Arthur Cohen
@ 2024-08-01 14:57 ` Arthur Cohen
  2024-08-01 14:58 ` [PATCH 124/125] gccrs: Visit type during resolution of inherent impl Arthur Cohen
  2024-08-01 14:58 ` [PATCH 125/125] gccrs: Add a test for inherent impl type name resolve Arthur Cohen
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Jakub Dupak

From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Bump copyright.
	* checks/errors/borrowck/ffi-polonius/src/lib.rs: Bump copyright.
	* checks/errors/borrowck/polonius/rust-polonius-ffi.h: Bump copyright.
	* checks/errors/borrowck/polonius/rust-polonius.h: Bump copyright.
	* checks/errors/borrowck/rust-bir-dump.cc: Bump copyright.
	* checks/errors/borrowck/rust-bir-fact-collector.h: Bump copyright.
	* checks/errors/borrowck/rust-bir-free-region.h: Bump copyright.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 .../borrowck/ffi-polonius/src/gccrs_ffi.rs     |  2 +-
 .../errors/borrowck/ffi-polonius/src/lib.rs    |  2 +-
 .../borrowck/polonius/rust-polonius-ffi.h      |  2 +-
 .../errors/borrowck/polonius/rust-polonius.h   |  2 +-
 .../checks/errors/borrowck/rust-bir-dump.cc    | 18 ++++++++++++++++++
 .../errors/borrowck/rust-bir-fact-collector.h  |  2 +-
 .../errors/borrowck/rust-bir-free-region.h     | 18 ++++++++++++++++++
 7 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
index 3a849444bbc..5b4e6d39d21 100644
--- a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
+++ b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
 
 // This file is part of GCC.
 
diff --git a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
index a9aa8106b69..819c34a9374 100644
--- a/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
+++ b/gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
 
 // This file is part of GCC.
 
diff --git a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
index 500d25a3222..ebfddab7617 100644
--- a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
+++ b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
 
 // This file is part of GCC.
 
diff --git a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
index df746dd0c76..239cc344011 100644
--- a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
+++ b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2022 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
 
 // This file is part of GCC.
 
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
index a39f145f8f9..d3398b6f405 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-dump.cc
@@ -1,3 +1,21 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>
+
 #include "rust-system.h"
 #include "rust-bir-dump.h"
 #include "rust-diagnostics.h"
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h b/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
index 527ae65606c..bb8fedaf3db 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
 
 // This file is part of GCC.
 
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h b/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
index e5d6ef3c98b..b8d73c9c070 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-free-region.h
@@ -1,3 +1,21 @@
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>
+
 #ifndef RUST_BIR_FREE_REGION_H
 #define RUST_BIR_FREE_REGION_H
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 124/125] gccrs: Visit type during resolution of inherent impl
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (121 preceding siblings ...)
  2024-08-01 14:57 ` [PATCH 123/125] gccrs: borrowck: Bump copyright notice Arthur Cohen
@ 2024-08-01 14:58 ` Arthur Cohen
  2024-08-01 14:58 ` [PATCH 125/125] gccrs: Add a test for inherent impl type name resolve Arthur Cohen
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Inherent impl has a type it applies to. This type
was not visited and thus not resolved.

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
	inherent impl type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/rust/resolve/rust-default-resolver.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index 393994808ee..c54cabad2e5 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -115,6 +115,7 @@ void
 DefaultResolver::visit (AST::InherentImpl &impl)
 {
   auto inner_fn = [this, &impl] () {
+    visit (impl.get_type ());
     for (auto &item : impl.get_impl_items ())
       item->accept_vis (*this);
   };
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 125/125] gccrs: Add a test for inherent impl type name resolve
  2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
                   ` (122 preceding siblings ...)
  2024-08-01 14:58 ` [PATCH 124/125] gccrs: Visit type during resolution of inherent impl Arthur Cohen
@ 2024-08-01 14:58 ` Arthur Cohen
  123 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-08-01 14:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-rust, Pierre-Emmanuel Patry

From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

A previous bug with name resolution 2.0 was caused by an incorrectly
resolved inherent impl name. This test shall highlight the behavior
and prevent regression.

gcc/testsuite/ChangeLog:

	* rust/compile/name_resolution25.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/testsuite/rust/compile/name_resolution25.rs | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/name_resolution25.rs

diff --git a/gcc/testsuite/rust/compile/name_resolution25.rs b/gcc/testsuite/rust/compile/name_resolution25.rs
new file mode 100644
index 00000000000..3cacac7f64b
--- /dev/null
+++ b/gcc/testsuite/rust/compile/name_resolution25.rs
@@ -0,0 +1,5 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+struct Test; // { dg-warning "struct is never constructed: .Test." }
+
+impl Test {}
-- 
2.45.2


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library)
  2024-08-01 14:56 ` [PATCH 005/125] gccrs: libgrust: Add format_parser library Arthur Cohen
@ 2024-08-05  8:18   ` Thomas Schwinge
  2024-11-23 20:09   ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' " Thomas Schwinge
  1 sibling, 0 replies; 130+ messages in thread
From: Thomas Schwinge @ 2024-08-05  8:18 UTC (permalink / raw)
  To: Arthur Cohen, gcc-patches, gcc-rust

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

Hi!

On 2024-08-01T16:56:01+0200, Arthur Cohen <arthur.cohen@embecosm.com> wrote:
> Compile libformat_parser and link to it.

> --- a/gcc/rust/Make-lang.in
> +++ b/gcc/rust/Make-lang.in

> +LIBS += -ldl -lpthread

That's still not correct.  I've pushed to trunk branch
commit 816c4de4d062c89f5b7a68f68f29b2b033f5b136
"Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS'",
see attached.


Grüße
 Thomas



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-override-LIBS-if-enable-languages-rust-use-CRA.patch --]
[-- Type: text/x-diff, Size: 1924 bytes --]

From 816c4de4d062c89f5b7a68f68f29b2b033f5b136 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Mon, 5 Aug 2024 10:06:05 +0200
Subject: [PATCH] Don't override 'LIBS' if '--enable-languages=rust'; use
 'CRAB1_LIBS'

Recent commit 6fef4d6ffcab0fec8518adcb05458cba5dbeac25
"gccrs: libgrust: Add format_parser library", added a general override of
'LIBS += -ldl -lpthread' if '--enable-languages=rust'.  This is wrong
conceptually, and will make the build fail on systems not providing such
libraries.  Instead, 'CRAB1_LIBS', added a while ago in
commit 75299e4fe50aa8d9b3ff529e48db4ed246083e64
"rust: Do not link with libdl and libpthread unconditionally", should be used,
and not generally, but for 'crab1' only.

	gcc/rust/
	* Make-lang.in (LIBS): Don't override.
	(crab1$(exeext):): Use 'CRAB1_LIBS'.
---
 gcc/rust/Make-lang.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 24229c02770..c3be5f9d81b 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -54,8 +54,6 @@ GCCRS_D_OBJS = \
    rust/rustspec.o \
    $(END)
 
-LIBS += -ldl -lpthread
-
 gccrs$(exeext): $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	  $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
@@ -237,7 +235,7 @@ RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
 crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev)
 	@$(call LINK_PROGRESS,$(INDEX.rust),start)
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
+	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(CRAB1_LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
 	@$(call LINK_PROGRESS,$(INDEX.rust),end)
 
 # Build hooks.
-- 
2.34.1


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Inline 'gcc/rust/Make-lang.in:RUST_LIBDEPS' (was: [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER')
  2024-08-01 14:56 ` [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER' Arthur Cohen
@ 2024-08-05  8:45   ` Thomas Schwinge
  0 siblings, 0 replies; 130+ messages in thread
From: Thomas Schwinge @ 2024-08-05  8:45 UTC (permalink / raw)
  To: Arthur Cohen, gcc-patches, gcc-rust

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]

Hi!

On 2024-08-01T16:56:02+0200, Arthur Cohen <arthur.cohen@embecosm.com> wrote:
> --- a/gcc/rust/Make-lang.in
> +++ b/gcc/rust/Make-lang.in
> @@ -212,6 +212,9 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
>  rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
>  
>  LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
> +LIBFORMAT_PARSER = rust/libformat_parser.a
> +
> +RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
>  
>  
>  RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)

That must've been a mis-merge; my GCC/Rust master branch original of this
commit (as part of <https://github.com/Rust-GCC/gccrs/pull/2947>
"Move 'libformat_parser' build into the GCC build directory, and into libgrust")
didn't include a bogus second definition of 'RUST_LIBDEPS'.  I've pushed
to trunk branch commit aab9f33ed1f1b92444a82eb3ea5cab1048593791
"Inline 'gcc/rust/Make-lang.in:RUST_LIBDEPS'", see attached -- this
commit apparently had been omitted from the 2024-08-01 upstream
submission.


Grüße
 Thomas



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Inline-gcc-rust-Make-lang.in-RUST_LIBDEPS.patch --]
[-- Type: text/x-diff, Size: 1585 bytes --]

From aab9f33ed1f1b92444a82eb3ea5cab1048593791 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Wed, 28 Feb 2024 23:06:25 +0100
Subject: [PATCH] Inline 'gcc/rust/Make-lang.in:RUST_LIBDEPS'

..., also fixing up an apparently mis-merged
commit 2340894554334a310b891a1d9e9d5e3f502357ac
"gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER'", which was adding a bogus
second definition of 'RUST_LIBDEPS'.

	gcc/rust/
	* Make-lang.in (RUST_LIBDEPS): Inline into all users.
---
 gcc/rust/Make-lang.in | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index c3be5f9d81b..aed9a998c80 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -226,13 +226,8 @@ rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
 LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a
 LIBFORMAT_PARSER = ../libgrust/libformat_parser/debug/liblibformat_parser.a
 
-RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER)
-
-
-RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
-
 # The compiler itself is called crab1
-crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev)
+crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(rust.prev)
 	@$(call LINK_PROGRESS,$(INDEX.rust),start)
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	      $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(CRAB1_LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Rust: Work around 'error[E0658]: `let...else` statements are unstable' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library)
  2024-08-01 14:56 ` [PATCH 005/125] gccrs: libgrust: Add format_parser library Arthur Cohen
  2024-08-05  8:18   ` Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library) Thomas Schwinge
@ 2024-11-23 20:09   ` Thomas Schwinge
  2024-11-25 10:24     ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' Arthur Cohen
  1 sibling, 1 reply; 130+ messages in thread
From: Thomas Schwinge @ 2024-11-23 20:09 UTC (permalink / raw)
  To: Arthur Cohen, gcc-patches; +Cc: gcc-rust

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

Hi!

On 2024-08-01T16:56:01+0200, Arthur Cohen <arthur.cohen@embecosm.com> wrote:
> Compile libformat_parser and link to it.

> --- /dev/null
> +++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
> @@ -0,0 +1,1102 @@
> +[...]
> +    let Some(unescaped) = unescape_string(snippet) else {
> +        return InputStringKind::NotALiteral;
> +    };
> +[...]

OK to push the attached
"Rust: Work around 'error[E0658]: `let...else` statements are unstable'"?
Builds and tests fine, but I don't know if this code path is actually
exercised at this time, so please check carefully; as you know I'm not
actually a Rust programmer (yet).  ;-)


Grüße
 Thomas



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Rust-Work-around-error-E0658-let.else-statements-are.patch --]
[-- Type: text/x-diff, Size: 2564 bytes --]

From 9d71d9814b9967b184956cb949c45e0f23ff0b81 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Sat, 3 Aug 2024 16:08:42 +0200
Subject: [PATCH] Rust: Work around 'error[E0658]: `let...else` statements are
 unstable'

Compiling with Debian GNU/Linux 12 (bookworm) packages:

    $ apt-cache madison cargo rustc
         cargo | 0.66.0+ds1-1 | http://deb.debian.org/debian bookworm/main ppc64el Packages
         cargo | 0.66.0+ds1-1 | http://deb.debian.org/debian bookworm/main Sources
         rustc | 1.63.0+dfsg1-2 | http://deb.debian.org/debian bookworm/main ppc64el Packages
         rustc | 1.63.0+dfsg1-2 | http://deb.debian.org/debian bookworm/main Sources

..., we run into:

       Compiling generic_format_parser v0.1.0 ([...]/source-gcc/libgrust/libformat_parser/generic_format_parser)
    error[E0658]: `let...else` statements are unstable
       --> generic_format_parser/src/lib.rs:994:5
        |
    994 | /     let Some(unescaped) = unescape_string(snippet) else {
    995 | |         return InputStringKind::NotALiteral;
    996 | |     };
        | |______^
        |
        = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information

Rewrite backwards, per <https://rust-lang.github.io/rfcs/3137-let-else.html>.

	libgrust/
	* libformat_parser/generic_format_parser/src/lib.rs: Work around
	'error[E0658]: `let...else` statements are unstable'.
---
 libgrust/libformat_parser/generic_format_parser/src/lib.rs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
index 8062bf9e5cec..ed3d8577befa 100644
--- a/libgrust/libformat_parser/generic_format_parser/src/lib.rs
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -991,8 +991,11 @@ fn find_width_map_from_snippet(
     // If we only trimmed it off the input, `format!("\n")` would cause a mismatch as here we they actually match up.
     // Alternatively, we could just count the trailing newlines and only trim one from the input if they don't match up.
     let input_no_nl = input.trim_end_matches('\n');
-    let Some(unescaped) = unescape_string(snippet) else {
-        return InputStringKind::NotALiteral;
+    let unescaped = match unescape_string(snippet) {
+        Some(unescaped) => unescaped,
+        _ => {
+            return InputStringKind::NotALiteral;
+        }
     };
 
     let unescaped_no_nl = unescaped.trim_end_matches('\n');
-- 
2.34.1


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Rust: Work around 'error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope' (was: [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory)
  2024-08-01 14:56 ` [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory Arthur Cohen
@ 2024-11-23 20:17   ` Thomas Schwinge
  0 siblings, 0 replies; 130+ messages in thread
From: Thomas Schwinge @ 2024-11-23 20:17 UTC (permalink / raw)
  To: Arthur Cohen, gcc-patches; +Cc: gcc-rust

[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

Hi!

On 2024-08-01T16:56:44+0200, Arthur Cohen <arthur.cohen@embecosm.com> wrote:
> --- a/libgrust/libformat_parser/src/lib.rs
> +++ b/libgrust/libformat_parser/src/lib.rs

> [...]
> +    let rust_string = RustString {
> +        len: str.len(),
> +        cap: str.capacity(),
> +        ptr: str.leak().as_ptr(),
> +    };
> [...]

> [...]
> +    let RustString { ptr, len, cap } = *s;
> +    let s = unsafe { String::from_raw_parts(ptr as *mut u8, len, cap) };
> +    let cloned_s = s.clone();
> +
> +    // FIXME: Documentation
> +    s.leak();
> +
> +    let rust_string = RustString {
> +        len: cloned_s.len(),
> +        cap: cloned_s.capacity(),
> +        ptr: cloned_s.leak().as_ptr(),
> +    };
> [...]

OK to push the attached
"Rust: Work around 'error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope'"?
Builds and tests fine, but I don't know if this code path is actually
exercised at this time, so please check carefully; as you know I'm not
actually a Rust programmer (yet).  ;-)


Grüße
 Thomas



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Rust-Work-around-error-E0599-no-method-named-leak-fo.patch --]
[-- Type: text/x-diff, Size: 3240 bytes --]

From 8d4821dabcf4663e51c7db859801837710038821 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Sat, 3 Aug 2024 16:39:17 +0200
Subject: [PATCH] Rust: Work around 'error[E0599]: no method named `leak` found
 for struct `std::string::String` in the current scope'

Compiling with Debian GNU/Linux 12 (bookworm) packages:

    $ apt-cache madison cargo rustc
         cargo | 0.66.0+ds1-1 | http://deb.debian.org/debian bookworm/main ppc64el Packages
         cargo | 0.66.0+ds1-1 | http://deb.debian.org/debian bookworm/main Sources
         rustc | 1.63.0+dfsg1-2 | http://deb.debian.org/debian bookworm/main ppc64el Packages
         rustc | 1.63.0+dfsg1-2 | http://deb.debian.org/debian bookworm/main Sources

..., we run into:

       Compiling libformat_parser v0.1.0 ([...]/source-gcc/libgrust/libformat_parser)
    error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope
       --> src/lib.rs:396:18
        |
    396 |         ptr: str.leak().as_ptr(),
        |                  ^^^^ method not found in `std::string::String`

    error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope
       --> src/lib.rs:434:7
        |
    434 |     s.leak();
        |       ^^^^ method not found in `std::string::String`

    error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope
       --> src/lib.rs:439:23
        |
    439 |         ptr: cloned_s.leak().as_ptr(),
        |                       ^^^^ method not found in `std::string::String`

Locally replace 1.72.0+ method 'leak' for struct 'std::string::String'.

	libgrust/
	* libformat_parser/src/lib.rs: Work around 'error[E0599]:
	no method named `leak` found for struct `std::string::String` in the current scope'.
---
 libgrust/libformat_parser/src/lib.rs | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 84fac38e224d..28f6a6a62b62 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -5,6 +5,13 @@
 
 use std::ffi::CStr;
 
+// Local replacement for 1.72.0+ method 'leak' for struct 'std::string::String',
+// <https://doc.rust-lang.org/1.72.0/src/alloc/string.rs.html#1853>
+fn leak_string<'a>(s: String) -> &'a mut str {
+    let slice = s.into_bytes().leak();
+    unsafe { std::str::from_utf8_unchecked_mut(slice) }
+}
+
 trait IntoFFI<T> {
     fn into_ffi(self) -> T;
 }
@@ -393,7 +400,7 @@ pub extern "C" fn collect_pieces(
     let rust_string = RustString {
         len: str.len(),
         cap: str.capacity(),
-        ptr: str.leak().as_ptr(),
+        ptr: leak_string(str).as_ptr(),
     };
 
     FormatArgsHandle(piece_slice, rust_string)
@@ -431,12 +438,12 @@ pub extern "C" fn clone_pieces(
     let cloned_s = s.clone();
 
     // FIXME: Documentation
-    s.leak();
+    leak_string(s);
 
     let rust_string = RustString {
         len: cloned_s.len(),
         cap: cloned_s.capacity(),
-        ptr: cloned_s.leak().as_ptr(),
+        ptr: leak_string(cloned_s).as_ptr(),
     };
 
     FormatArgsHandle(piece_slice, rust_string)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: Rust: Work around 'error[E0658]: `let...else` statements are unstable'
  2024-11-23 20:09   ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' " Thomas Schwinge
@ 2024-11-25 10:24     ` Arthur Cohen
  0 siblings, 0 replies; 130+ messages in thread
From: Arthur Cohen @ 2024-11-25 10:24 UTC (permalink / raw)
  To: Thomas Schwinge, gcc-patches; +Cc: gcc-rust


[-- Attachment #1.1.1: Type: text/plain, Size: 1516 bytes --]

Hi Thomas!

Thanks, this patch (and your other one on the matter) looks good but I 
have a slight issue with it. We had previously done something similar to 
adapt to Rust 1.72 when we originally reused the format_args parser:

https://github.com/Rust-GCC/gccrs/pull/2964

This was later reverted because a GSoC student needed some nightly 
features. I would rather re-apply this entire patch, lower our Rust 
version requirement to 1.49, and upstream the fixes as part of our next 
upstreaming period. What do you think about this?

There are a couple more fixes to go from 1.72 to 1.49, and the 
`String::leak` method is also slightly easier to use.

Let me know and I'm happy to reapply the PR.

Best,

Arthur

On 11/23/24 9:09 PM, Thomas Schwinge wrote:
> Hi!
> 
> On 2024-08-01T16:56:01+0200, Arthur Cohen <arthur.cohen@embecosm.com> wrote:
>> Compile libformat_parser and link to it.
> 
>> --- /dev/null
>> +++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
>> @@ -0,0 +1,1102 @@
>> +[...]
>> +    let Some(unescaped) = unescape_string(snippet) else {
>> +        return InputStringKind::NotALiteral;
>> +    };
>> +[...]
> 
> OK to push the attached
> "Rust: Work around 'error[E0658]: `let...else` statements are unstable'"?
> Builds and tests fine, but I don't know if this code path is actually
> exercised at this time, so please check carefully; as you know I'm not
> actually a Rust programmer (yet).  ;-)
> 
> 
> Grüße
>   Thomas
> 
> 


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3195 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 130+ messages in thread

end of thread, other threads:[~2024-11-25 10:23 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
2024-08-01 14:55 ` [PATCH 002/125] gccrs: Fix false positive for top-level AltPattern Arthur Cohen
2024-08-01 14:55 ` [PATCH 003/125] gccrs: minor cleanup in langhook.type_for_mode Arthur Cohen
2024-08-01 14:56 ` [PATCH 004/125] gccrs: fmt: Start working on format_args!() parser Arthur Cohen
2024-08-01 14:56 ` [PATCH 005/125] gccrs: libgrust: Add format_parser library Arthur Cohen
2024-08-05  8:18   ` Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library) Thomas Schwinge
2024-11-23 20:09   ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' " Thomas Schwinge
2024-11-25 10:24     ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' Arthur Cohen
2024-08-01 14:56 ` [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER' Arthur Cohen
2024-08-05  8:45   ` Inline 'gcc/rust/Make-lang.in:RUST_LIBDEPS' (was: [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER') Thomas Schwinge
2024-08-01 14:56 ` [PATCH 007/125] gccrs: libgrust: Vendor Rust dependencies Arthur Cohen
2024-08-01 14:56 ` [PATCH 008/125] Rust: Don't cache 'libformat_parser.a' Arthur Cohen
2024-08-01 14:56 ` [PATCH 009/125] Rust: Move 'libformat_parser' build into the GCC build directory Arthur Cohen
2024-08-01 14:56 ` [PATCH 010/125] Rust: Move 'libformat_parser' build into libgrust Arthur Cohen
2024-08-01 14:56 ` [PATCH 011/125] gccrs: libformat_parser: Add FFI safe interface Arthur Cohen
2024-08-01 14:56 ` [PATCH 012/125] gccrs: libformat_parser: Start experimenting with cbindgen Arthur Cohen
2024-08-01 14:56 ` [PATCH 013/125] gccrs: libformat_parser: Update header and remove old interface Arthur Cohen
2024-08-01 14:56 ` [PATCH 014/125] gccrs: libformat_parser: Send boxed values across FFI properly Arthur Cohen
2024-08-01 14:56 ` [PATCH 015/125] gccrs: format_args: Parse format string properly Arthur Cohen
2024-08-01 14:56 ` [PATCH 016/125] gccrs: format_args: Parse entire token invocation Arthur Cohen
2024-08-01 14:56 ` [PATCH 017/125] gccrs: rust-fmt: Store parsed string in Pieces struct Arthur Cohen
2024-08-01 14:56 ` [PATCH 018/125] gccrs: libformat_parser: Fix Rust warnings Arthur Cohen
2024-08-01 14:56 ` [PATCH 019/125] gccrs: format-parser: Add `is_some_and` method for Option<T> Arthur Cohen
2024-08-01 14:56 ` [PATCH 020/125] gccrs: Adjust error checks to match name resolution 2.0 Arthur Cohen
2024-08-01 14:56 ` [PATCH 021/125] gccrs: Fix small FixMe task in rust macro builtins Arthur Cohen
2024-08-01 14:56 ` [PATCH 022/125] gccrs: lang-items: Cleanup parsing and lookups of lang items Arthur Cohen
2024-08-01 14:56 ` [PATCH 023/125] gccrs: lang-items: Make lang items enum stronger, rename class, cleanup ns Arthur Cohen
2024-08-01 14:56 ` [PATCH 024/125] gccrs: extern-types: Declare external types in name resolver Arthur Cohen
2024-08-01 14:56 ` [PATCH 025/125] gccrs: hir: Add ExternalTypeItem node Arthur Cohen
2024-08-01 14:56 ` [PATCH 026/125] gccrs: extern-types: Lower to HIR::ExternalTypeItem properly Arthur Cohen
2024-08-01 14:56 ` [PATCH 027/125] gccrs: Make DefaultResolver visit more of the AST Arthur Cohen
2024-08-01 14:56 ` [PATCH 028/125] gccrs: ast: Add base nodes for FormatArgs Arthur Cohen
2024-08-01 14:56 ` [PATCH 029/125] gccrs: macro-builtins: Add newline generic format_args!() handler Arthur Cohen
2024-08-01 14:56 ` [PATCH 030/125] gccrs: parser: Add peek(n) method to parser Arthur Cohen
2024-08-01 14:56 ` [PATCH 031/125] gccrs: format-args: Fix Rust interface and add input parsing Arthur Cohen
2024-08-01 14:56 ` [PATCH 032/125] gccrs: lower: Add base for lowering FormatArgs nodes Arthur Cohen
2024-08-01 14:56 ` [PATCH 033/125] gccrs: format-args: Add documentation for future expansion of function Arthur Cohen
2024-08-01 14:56 ` [PATCH 034/125] gccrs: Add error emitting when we can't resolve id expr Arthur Cohen
2024-08-01 14:56 ` [PATCH 035/125] gccrs: Add curly brackets, formatted clang Arthur Cohen
2024-08-01 14:56 ` [PATCH 036/125] gccrs: Ensure TupleStructPattern and TuplePattern have items Arthur Cohen
2024-08-01 14:56 ` [PATCH 037/125] gccrs: Clean BiMap to use tl::optional for lookups Arthur Cohen
2024-08-01 14:56 ` [PATCH 038/125] gccrs: Add support for external functions Arthur Cohen
2024-08-01 14:56 ` [PATCH 039/125] gccrs: Add get_pattern_kind to Pattern Arthur Cohen
2024-08-01 14:56 ` [PATCH 040/125] gccrs: Unify ASTValidation::visit for ExternalFunctionItem and Function Arthur Cohen
2024-08-01 14:56 ` [PATCH 041/125] gccrs: Update resolver to use `AST::Function` instead of `AST::ExternalFunctionItem` Arthur Cohen
2024-08-01 14:56 ` [PATCH 042/125] gccrs: Remove dead code associated with `AST::ExternalFunctionItem` Arthur Cohen
2024-08-01 14:56 ` [PATCH 043/125] gccrs: Placate clang-format re 'gcc/rust/backend/rust-tree.cc' Arthur Cohen
2024-08-01 14:56 ` [PATCH 044/125] gccrs: Replace reference to unique pointer with reference Arthur Cohen
2024-08-01 14:56 ` [PATCH 045/125] gccrs: Replace unique_ptr references with references Arthur Cohen
2024-08-01 14:56 ` [PATCH 046/125] gccrs: macro: Use MacroInvocation's node_id in ExternalItem constructor Arthur Cohen
2024-08-01 14:56 ` [PATCH 047/125] gccrs: format-args: Add base for expanding FormatArgs nodes Arthur Cohen
2024-08-01 14:56 ` [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory Arthur Cohen
2024-11-23 20:17   ` Rust: Work around 'error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope' (was: [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory) Thomas Schwinge
2024-08-01 14:56 ` [PATCH 049/125] gccrs: format-args: Add basic expansion of unnamed Display::fmt arguments Arthur Cohen
2024-08-01 14:56 ` [PATCH 050/125] gccrs: format-args: Add basic test case Arthur Cohen
2024-08-01 14:56 ` [PATCH 051/125] gccrs: format-args: Only pass the format string to the parser Arthur Cohen
2024-08-01 14:56 ` [PATCH 052/125] gccrs: TyTy: add common SubstitutionRef API Arthur Cohen
2024-08-01 14:56 ` [PATCH 053/125] gccrs: TyTy: Variance analysis module Arthur Cohen
2024-08-01 14:56 ` [PATCH 054/125] gccrs: TyTy: Collect variance info from types Arthur Cohen
2024-08-01 14:56 ` [PATCH 055/125] gccrs: Store visibility properly in ExternalTypeItem Arthur Cohen
2024-08-01 14:56 ` [PATCH 056/125] gccrs: Fix typo Arthur Cohen
2024-08-01 14:56 ` [PATCH 057/125] gccrs: Split up rust-macro-builtins.cc Arthur Cohen
2024-08-01 14:56 ` [PATCH 058/125] gccrs: Placate clang-format re 'gcc/rust/lex/rust-lex.cc' Arthur Cohen
2024-08-01 14:56 ` [PATCH 059/125] gccrs: nr2.0: Add new ImmutableNameResolutionCtx class Arthur Cohen
2024-08-01 14:56 ` [PATCH 060/125] gccrs: sesh: Add late name resolution 2.0 Arthur Cohen
2024-08-01 14:56 ` [PATCH 061/125] gccrs: session-manager: Dump name resolution pass Arthur Cohen
2024-08-01 14:56 ` [PATCH 062/125] gccrs: session manager: Init Immutable name resolver Arthur Cohen
2024-08-01 14:56 ` [PATCH 063/125] gccrs: nr2.0: Add lookup of resolved nodes Arthur Cohen
2024-08-01 14:57 ` [PATCH 064/125] gccrs: typecheck: Start using nr2.0 properly Arthur Cohen
2024-08-01 14:57 ` [PATCH 065/125] gccrs: backend: Use new name resolver where necessary Arthur Cohen
2024-08-01 14:57 ` [PATCH 066/125] gccrs: nr2.0: Start using newtype pattern for Usage and Declaration Arthur Cohen
2024-08-01 14:57 ` [PATCH 067/125] gccrs: late: Setup builtin types properly, change Rib API Arthur Cohen
2024-08-01 14:57 ` [PATCH 068/125] gccrs: Fix duplicate detection Arthur Cohen
2024-08-01 14:57 ` [PATCH 069/125] gccrs: Emit error on identical use declarations Arthur Cohen
2024-08-01 14:57 ` [PATCH 070/125] gccrs: Change error message on unresolved import Arthur Cohen
2024-08-01 14:57 ` [PATCH 071/125] gccrs: Prevent error emission on resolver reentry Arthur Cohen
2024-08-01 14:57 ` [PATCH 072/125] gccrs: late: Add bool builtin type Arthur Cohen
2024-08-01 14:57 ` [PATCH 073/125] gccrs: Add modules to type namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 074/125] gccrs: Add name resolution for on globbing use decl Arthur Cohen
2024-08-01 14:57 ` [PATCH 075/125] gccrs: Shape up name resolver for normal direct calls Arthur Cohen
2024-08-01 14:57 ` [PATCH 076/125] gccrs: Add call to globbing visitor Arthur Cohen
2024-08-01 14:57 ` [PATCH 077/125] gccrs: Make globbing definition shadowable by default Arthur Cohen
2024-08-01 14:57 ` [PATCH 078/125] gccrs: Add support for ambiguous use declarations Arthur Cohen
2024-08-01 14:57 ` [PATCH 079/125] gccrs: Add tuple struct constructor to value namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 080/125] gccrs: Change error message to match test Arthur Cohen
2024-08-01 14:57 ` [PATCH 081/125] gccrs: Visit function return type in default resolver Arthur Cohen
2024-08-01 14:57 ` [PATCH 082/125] gccrs: Visit constant item " Arthur Cohen
2024-08-01 14:57 ` [PATCH 083/125] gccrs: Raw pointer type visitor didn't require overload Arthur Cohen
2024-08-01 14:57 ` [PATCH 084/125] gccrs: Values shall be inserted in the value namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 085/125] gccrs: Unit struct constructor shall be resolved Arthur Cohen
2024-08-01 14:57 ` [PATCH 086/125] gccrs: Add tuple struct to the type namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 087/125] gccrs: Change enum namespace from value to type Arthur Cohen
2024-08-01 14:57 ` [PATCH 088/125] gccrs: Struct are types, not values Arthur Cohen
2024-08-01 14:57 ` [PATCH 089/125] gccrs: Add constant identifiers to the value namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 090/125] gccrs: Remove extern block scoping Arthur Cohen
2024-08-01 14:57 ` [PATCH 091/125] gccrs: Remove unsafe block empty visit function Arthur Cohen
2024-08-01 14:57 ` [PATCH 092/125] gccrs: Use new name resolver to compile constant items Arthur Cohen
2024-08-01 14:57 ` [PATCH 093/125] gccrs: Reinject Self parameter in new resolver Arthur Cohen
2024-08-01 14:57 ` [PATCH 094/125] gccrs: Update assignment operator with cratenum Arthur Cohen
2024-08-01 14:57 ` [PATCH 095/125] gccrs: Prevent getting immutable context with classic nr Arthur Cohen
2024-08-01 14:57 ` [PATCH 096/125] gccrs: Fix quoted string format Arthur Cohen
2024-08-01 14:57 ` [PATCH 097/125] gccrs: Add mappings for struct base and struct fields Arthur Cohen
2024-08-01 14:57 ` [PATCH 098/125] gccrs: Fix use rebind name resolution Arthur Cohen
2024-08-01 14:57 ` [PATCH 099/125] gccrs: compile: resolve-path-ref: properly resolve nodeId with nr2.0 Arthur Cohen
2024-08-01 14:57 ` [PATCH 100/125] gccrs: nr2.0: Add new test cases Arthur Cohen
2024-08-01 14:57 ` [PATCH 101/125] gccrs: Add globbing name resolution 2.0 test Arthur Cohen
2024-08-01 14:57 ` [PATCH 102/125] gccrs: Change dfs function return type to support gcc 4.8 Arthur Cohen
2024-08-01 14:57 ` [PATCH 103/125] gccrs: Improve parsing of raw byte string literals Arthur Cohen
2024-08-01 14:57 ` [PATCH 104/125] gccrs: Recognize rustc_deprecated as a builtin attribute Arthur Cohen
2024-08-01 14:57 ` [PATCH 105/125] gccrs: Recognize unstable " Arthur Cohen
2024-08-01 14:57 ` [PATCH 106/125] gccrs: Avoid parsing const unsafe/extern functions as async Arthur Cohen
2024-08-01 14:57 ` [PATCH 107/125] gccrs: Improve parsing of raw string literals Arthur Cohen
2024-08-01 14:57 ` [PATCH 108/125] gccrs: raw-strings: Remove dg-excess-error directive Arthur Cohen
2024-08-01 14:57 ` [PATCH 109/125] gccrs: unify: Always coerce `!` to the target type Arthur Cohen
2024-08-01 14:57 ` [PATCH 110/125] gccrs: borrowck: Use rust-system.h Arthur Cohen
2024-08-01 14:57 ` [PATCH 111/125] gccrs: borrowck: Unify BIR terminilogy (node->statement) Arthur Cohen
2024-08-01 14:57 ` [PATCH 112/125] gccrs: borrowck: BIR: use callable API Arthur Cohen
2024-08-01 14:57 ` [PATCH 113/125] gccrs: borrowck: BIR: Place tree traverse API Arthur Cohen
2024-08-01 14:57 ` [PATCH 114/125] gccrs: borrowck: BIR: scope handling Arthur Cohen
2024-08-01 14:57 ` [PATCH 115/125] gccrs: borrowck: BIR: emit moves Arthur Cohen
2024-08-01 14:57 ` [PATCH 116/125] gccrs: borrowck: BIR: make BIR visitor const Arthur Cohen
2024-08-01 14:57 ` [PATCH 117/125] gccrs: borrowck: Polonius FFI Arthur Cohen
2024-08-01 14:57 ` [PATCH 118/125] gccrs: borrowck: Free region representation Arthur Cohen
2024-08-01 14:57 ` [PATCH 119/125] gccrs: borrowck: extract regions from types using VA Arthur Cohen
2024-08-01 14:57 ` [PATCH 120/125] gccrs: borrowck: Regions in BIR Arthur Cohen
2024-08-01 14:57 ` [PATCH 121/125] gccrs: borrowck: Fact collector Arthur Cohen
2024-08-01 14:57 ` [PATCH 122/125] gccrs: borrowck: Remove block braces to satisfy GNU style Arthur Cohen
2024-08-01 14:57 ` [PATCH 123/125] gccrs: borrowck: Bump copyright notice Arthur Cohen
2024-08-01 14:58 ` [PATCH 124/125] gccrs: Visit type during resolution of inherent impl Arthur Cohen
2024-08-01 14:58 ` [PATCH 125/125] gccrs: Add a test for inherent impl type name resolve Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).