aboutsummaryrefslogtreecommitdiff
path: root/src/unix/haiku
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2023-06-09 23:30:31 +0000
committerMatthew Maurer <mmaurer@google.com>2023-06-09 23:32:21 +0000
commitd821e1f7a8389fe8e04217e930ca668aa6a3dbd3 (patch)
treeff2d237ae8a62b1f2259099affc06428368592b8 /src/unix/haiku
parentdb73f80a4493567b524f3cd53fa016a01a51f394 (diff)
downloadlibc-d821e1f7a8389fe8e04217e930ca668aa6a3dbd3.tar.gz
Upgrade libc to 0.2.146
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/libc For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Bug: 286599631 Change-Id: Iff2cf3b4041de3317caa722b744dfaedac73bcdc
Diffstat (limited to 'src/unix/haiku')
-rw-r--r--src/unix/haiku/mod.rs61
1 files changed, 59 insertions, 2 deletions
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index 95ddadae..24aa599c 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -55,6 +55,8 @@ 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 {}
@@ -437,6 +439,19 @@ s! {
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! {
@@ -670,6 +685,9 @@ 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;
@@ -961,7 +979,7 @@ 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/master/headers/posix/net/if.h#L80
+// 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;
@@ -1486,7 +1504,7 @@ f! {
as ::c_uint
}
- pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
}
@@ -1984,6 +2002,17 @@ extern "C" {
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")]
@@ -2006,6 +2035,34 @@ extern "C" {
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;
}
cfg_if! {