", .{ first_number, second_number });
@@ -774,7 +767,7 @@ fn isType(name: []const u8) bool {
fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Token, raw_src: []const u8) !void {
const src = mem.trim(u8, raw_src, " \n");
- try out.write("");
+ try out.writeAll("");
var tokenizer = std.zig.Tokenizer.init(src);
var index: usize = 0;
var next_tok_is_fn = false;
@@ -835,15 +828,15 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
.Keyword_allowzero,
.Keyword_while,
=> {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
},
.Keyword_fn => {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
next_tok_is_fn = true;
},
@@ -852,24 +845,24 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
.Keyword_true,
.Keyword_false,
=> {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
},
.StringLiteral,
.MultilineStringLiteralLine,
.CharLiteral,
=> {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
},
.Builtin => {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
},
.LineComment,
@@ -877,16 +870,16 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
.ContainerDocComment,
.ShebangLine,
=> {
- try out.write("");
},
.Identifier => {
if (prev_tok_was_fn) {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
} else {
const is_int = blk: {
if (src[token.start] != 'i' and src[token.start] != 'u')
@@ -901,9 +894,9 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
break :blk true;
};
if (is_int or isType(src[token.start..token.end])) {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
} else {
try writeEscaped(out, src[token.start..token.end]);
}
@@ -913,9 +906,9 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
.IntegerLiteral,
.FloatLiteral,
=> {
- try out.write("");
+ try out.writeAll("");
try writeEscaped(out, src[token.start..token.end]);
- try out.write("");
+ try out.writeAll("");
},
.Bang,
@@ -983,7 +976,7 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
}
index = token.end;
}
- try out.write("");
+ try out.writeAll("");
}
fn tokenizeAndPrint(docgen_tokenizer: *Tokenizer, out: var, source_token: Token) !void {
@@ -1002,7 +995,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
for (toc.nodes) |node| {
switch (node) {
.Content => |data| {
- try out.write(data);
+ try out.writeAll(data);
},
.Link => |info| {
if (!toc.urls.contains(info.url)) {
@@ -1011,12 +1004,12 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
try out.print("{}", .{ info.url, info.name });
},
.Nav => {
- try out.write(toc.toc);
+ try out.writeAll(toc.toc);
},
.Builtin => |tok| {
- try out.write("");
+ try out.writeAll("");
try tokenizeAndPrintRaw(tokenizer, out, tok, builtin_code);
- try out.write("");
+ try out.writeAll("");
},
.HeaderOpen => |info| {
try out.print(
@@ -1025,7 +1018,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
);
},
.SeeAlso => |items| {
- try out.write("See also:
\n");
+ try out.writeAll("See also:
\n");
for (items) |item| {
const url = try urlize(allocator, item.name);
if (!toc.urls.contains(url)) {
@@ -1033,7 +1026,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
}
try out.print("- {}
\n", .{ url, item.name });
}
- try out.write("
\n");
+ try out.writeAll("
\n");
},
.Syntax => |content_tok| {
try tokenizeAndPrint(tokenizer, out, content_tok);
@@ -1047,9 +1040,9 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
if (!code.is_inline) {
try out.print("{}.zig
", .{code.name});
}
- try out.write("");
+ try out.writeAll("");
try tokenizeAndPrint(tokenizer, out, code.source_token);
- try out.write("");
+ try out.writeAll("");
const name_plus_ext = try std.fmt.allocPrint(allocator, "{}.zig", .{code.name});
const tmp_source_file_name = try fs.path.join(
allocator,
diff --git a/doc/langref.html.in b/doc/langref.html.in
index a39f73cf9657f1a268a2dda1025feeeb89801a49..83e96d5c953b19b7748b1d72acc52ff8d333918d 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -230,7 +230,7 @@
const std = @import("std");
pub fn main() !void {
- const stdout = &std.io.getStdOut().outStream().stream;
+ const stdout = std.io.getStdOut().outStream();
try stdout.print("Hello, {}!\n", .{"world"});
}
{#code_end#}
@@ -6728,17 +6728,8 @@ async fn func(y: *i32) void {
This builtin function atomically dereferences a pointer and returns the value.
- {#syntax#}T{#endsyntax#} must be a pointer type, a {#syntax#}bool{#endsyntax#}, a float,
- an integer whose bit count meets these requirements:
-
-
- - At least 8
- - At most the same as usize
- - Power of 2
-
or an enum with a valid integer tag type.
-
- TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe
- we can remove this restriction
+ {#syntax#}T{#endsyntax#} must be a {#syntax#}bool{#endsyntax#}, a float,
+ an integer or an enum.
{#header_close#}
{#header_open|@atomicRmw#}
@@ -6747,17 +6738,8 @@ async fn func(y: *i32) void {
This builtin function atomically modifies memory and then returns the previous value.
- {#syntax#}T{#endsyntax#} must be a pointer type, a {#syntax#}bool{#endsyntax#},
- or an integer whose bit count meets these requirements:
-
-
- - At least 8
- - At most the same as usize
- - Power of 2
-
-
- TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe
- we can remove this restriction
+ {#syntax#}T{#endsyntax#} must be a {#syntax#}bool{#endsyntax#}, a float,
+ an integer or an enum.
Supported operations:
@@ -6782,17 +6764,8 @@ async fn func(y: *i32) void {
This builtin function atomically stores a value.
- {#syntax#}T{#endsyntax#} must be a pointer type, a {#syntax#}bool{#endsyntax#}, a float,
- an integer whose bit count meets these requirements:
-
-
- - At least 8
- - At most the same as usize
- - Power of 2
-
or an enum with a valid integer tag type.
-
- TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe
- we can remove this restriction
+ {#syntax#}T{#endsyntax#} must be a {#syntax#}bool{#endsyntax#}, a float,
+ an integer or an enum.
{#header_close#}
{#header_open|@bitCast#}
@@ -7074,7 +7047,8 @@ fn cmpxchgStrongButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_v
more efficiently in machine instructions.
- {#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("builtin").AtomicOrder{#endsyntax#}.
+ {#syntax#}T{#endsyntax#} must be a {#syntax#}bool{#endsyntax#}, a float,
+ an integer or an enum.
{#syntax#}@TypeOf(ptr).alignment{#endsyntax#} must be {#syntax#}>= @sizeOf(T).{#endsyntax#}
{#see_also|Compile Variables|cmpxchgWeak#}
@@ -7102,7 +7076,8 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
However if you need a stronger guarantee, use {#link|@cmpxchgStrong#}.
- {#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("builtin").AtomicOrder{#endsyntax#}.
+ {#syntax#}T{#endsyntax#} must be a {#syntax#}bool{#endsyntax#}, a float,
+ an integer or an enum.
{#syntax#}@TypeOf(ptr).alignment{#endsyntax#} must be {#syntax#}>= @sizeOf(T).{#endsyntax#}
{#see_also|Compile Variables|cmpxchgStrong#}
diff --git a/lib/libc/include/aarch64-linux-musl/bits/alltypes.h b/lib/libc/include/aarch64-linux-musl/bits/alltypes.h
index 0ee3cb4646b6f5fc31e73dfa3f84c425615eeb81..fd60fe3a0fb728206e9a1f0549d5f6ef7b3dc2f4 100644
--- a/lib/libc/include/aarch64-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/aarch64-linux-musl/bits/alltypes.h
@@ -2,16 +2,13 @@
#define _Int64 long
#define _Reg long
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
+#if __AARCH64EB__
+#define __BYTE_ORDER 4321
+#else
+#define __BYTE_ORDER 1234
#endif
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -53,52 +50,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -135,6 +89,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -270,7 +234,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -366,6 +330,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -401,6 +376,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/aarch64-linux-musl/bits/endian.h b/lib/libc/include/aarch64-linux-musl/bits/endian.h
deleted file mode 100644
index 3ab24cc932287bfdb8170b6cda4f5f75b15c460b..0000000000000000000000000000000000000000
--- a/lib/libc/include/aarch64-linux-musl/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __AARCH64EB__
-#define __BYTE_ORDER __BIG_ENDIAN
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/aarch64-linux-musl/bits/socket.h b/lib/libc/include/aarch64-linux-musl/bits/socket.h
deleted file mode 100644
index b4e9fb6a1cd407ada73476d64b2a6c33ab649a9a..0000000000000000000000000000000000000000
--- a/lib/libc/include/aarch64-linux-musl/bits/socket.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1, msg_iovlen;
-#else
- int msg_iovlen, __pad1;
-#endif
- void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad2;
- socklen_t msg_controllen;
-#else
- socklen_t msg_controllen;
- int __pad2;
-#endif
- int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1;
- socklen_t cmsg_len;
-#else
- socklen_t cmsg_len;
- int __pad1;
-#endif
- int cmsg_level;
- int cmsg_type;
-};
\ No newline at end of file
diff --git a/lib/libc/include/aarch64-linux-musl/bits/syscall.h b/lib/libc/include/aarch64-linux-musl/bits/syscall.h
index 53f296e037f3b08a1227a1b3ef0f39e763fc84ca..72392b874fc2a8974bc5cfb64d7471b399d84500 100644
--- a/lib/libc/include/aarch64-linux-musl/bits/syscall.h
+++ b/lib/libc/include/aarch64-linux-musl/bits/syscall.h
@@ -287,6 +287,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define SYS_io_setup 0
#define SYS_io_destroy 1
@@ -576,4 +578,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/alltypes.h b/lib/libc/include/arm-linux-musl/bits/alltypes.h
index d1ad5774d5ffece3f3b73fe21f4bd68d64833367..a99e771958b343664c34468e1668b5c88af635ce 100644
--- a/lib/libc/include/arm-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/arm-linux-musl/bits/alltypes.h
@@ -1,17 +1,15 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
+#if __ARMEB__
+#define __BYTE_ORDER 4321
+#else
+#define __BYTE_ORDER 1234
#endif
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -37,52 +35,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -119,6 +74,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -254,7 +219,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -350,6 +315,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -385,6 +361,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/endian.h b/lib/libc/include/arm-linux-musl/bits/endian.h
deleted file mode 100644
index e4d86deb111d15b2e331e364e12649ec8155d03b..0000000000000000000000000000000000000000
--- a/lib/libc/include/arm-linux-musl/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __ARMEB__
-#define __BYTE_ORDER __BIG_ENDIAN
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/ipcstat.h b/lib/libc/include/arm-linux-musl/bits/ipcstat.h
new file mode 100644
index 0000000000000000000000000000000000000000..d055f3e83716e7d28975b2f1836b04e8714f793e
--- /dev/null
+++ b/lib/libc/include/arm-linux-musl/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/limits.h b/lib/libc/include/arm-linux-musl/bits/limits.h
deleted file mode 100644
index ba9c3aa003aea39ddb20eccc06cea142ec15de84..0000000000000000000000000000000000000000
--- a/lib/libc/include/arm-linux-musl/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/msg.h b/lib/libc/include/arm-linux-musl/bits/msg.h
index e5c8ba75208c2ed80da66995f1afe78fdab39893..037fd956d4fc97531893940f657f2ca61c5cc63d 100644
--- a/lib/libc/include/arm-linux-musl/bits/msg.h
+++ b/lib/libc/include/arm-linux-musl/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/sem.h b/lib/libc/include/arm-linux-musl/bits/sem.h
index 9097f9ffdb7e7474fe09be608ddafa8cb4c52e5b..eaa885a8b52bde814a4196fcef8a629b4b1c62a1 100644
--- a/lib/libc/include/arm-linux-musl/bits/sem.h
+++ b/lib/libc/include/arm-linux-musl/bits/sem.h
@@ -1,9 +1,9 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- long __unused1;
- time_t sem_ctime;
- long __unused2;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_lo;
+ unsigned long __sem_ctime_hi;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
@@ -13,4 +13,6 @@ struct semid_ds {
#endif
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/shm.h b/lib/libc/include/arm-linux-musl/bits/shm.h
index aa5587127ab24a71b87e7bef5946234c46a9c916..1ecb03ca0e4ac95ea0a2c9c4236293ff024472ca 100644
--- a/lib/libc/include/arm-linux-musl/bits/shm.h
+++ b/lib/libc/include/arm-linux-musl/bits/shm.h
@@ -3,17 +3,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- int __unused1;
- time_t shm_dtime;
- int __unused2;
- time_t shm_ctime;
- int __unused3;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __shm_ctime_hi;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ unsigned long __pad3;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/include/arm-linux-musl/bits/stat.h b/lib/libc/include/arm-linux-musl/bits/stat.h
index 78e91b40281427d98133894da7574cde7e83396b..3bf02b37564c0380675344ce1e9f9d82395256bd 100644
--- a/lib/libc/include/arm-linux-musl/bits/stat.h
+++ b/lib/libc/include/arm-linux-musl/bits/stat.h
@@ -14,8 +14,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ ino_t st_ino;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- ino_t st_ino;
};
\ No newline at end of file
diff --git a/lib/libc/include/arm-linux-musl/bits/syscall.h b/lib/libc/include/arm-linux-musl/bits/syscall.h
index 778430b8744a7f5cb036640cfcea33317a8407b1..5429a867e38363c47a20464b62adae2e8cfe84ee 100644
--- a/lib/libc/include/arm-linux-musl/bits/syscall.h
+++ b/lib/libc/include/arm-linux-musl/bits/syscall.h
@@ -55,8 +55,8 @@
#define __NR_sethostname 74
#define __NR_setrlimit 75
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_symlink 83
@@ -211,14 +211,14 @@
#define __NR_remap_file_pages 253
#define __NR_set_tid_address 256
#define __NR_timer_create 257
-#define __NR_timer_settime 258
-#define __NR_timer_gettime 259
+#define __NR_timer_settime32 258
+#define __NR_timer_gettime32 259
#define __NR_timer_getoverrun 260
#define __NR_timer_delete 261
-#define __NR_clock_settime 262
-#define __NR_clock_gettime 263
-#define __NR_clock_getres 264
-#define __NR_clock_nanosleep 265
+#define __NR_clock_settime32 262
+#define __NR_clock_gettime32 263
+#define __NR_clock_getres_time32 264
+#define __NR_clock_nanosleep_time32 265
#define __NR_statfs64 266
#define __NR_fstatfs64 267
#define __NR_tgkill 268
@@ -308,8 +308,8 @@
#define __NR_timerfd_create 350
#define __NR_eventfd 351
#define __NR_fallocate 352
-#define __NR_timerfd_settime 353
-#define __NR_timerfd_gettime 354
+#define __NR_timerfd_settime32 353
+#define __NR_timerfd_gettime32 354
#define __NR_signalfd4 355
#define __NR_eventfd2 356
#define __NR_epoll_create1 357
@@ -387,6 +387,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define __ARM_NR_breakpoint 0x0f0001
#define __ARM_NR_cacheflush 0x0f0002
@@ -452,8 +454,8 @@
#define SYS_sethostname 74
#define SYS_setrlimit 75
#define SYS_getrusage 77
-#define SYS_gettimeofday 78
-#define SYS_settimeofday 79
+#define SYS_gettimeofday_time32 78
+#define SYS_settimeofday_time32 79
#define SYS_getgroups 80
#define SYS_setgroups 81
#define SYS_symlink 83
@@ -608,14 +610,14 @@
#define SYS_remap_file_pages 253
#define SYS_set_tid_address 256
#define SYS_timer_create 257
-#define SYS_timer_settime 258
-#define SYS_timer_gettime 259
+#define SYS_timer_settime32 258
+#define SYS_timer_gettime32 259
#define SYS_timer_getoverrun 260
#define SYS_timer_delete 261
-#define SYS_clock_settime 262
-#define SYS_clock_gettime 263
-#define SYS_clock_getres 264
-#define SYS_clock_nanosleep 265
+#define SYS_clock_settime32 262
+#define SYS_clock_gettime32 263
+#define SYS_clock_getres_time32 264
+#define SYS_clock_nanosleep_time32 265
#define SYS_statfs64 266
#define SYS_fstatfs64 267
#define SYS_tgkill 268
@@ -705,8 +707,8 @@
#define SYS_timerfd_create 350
#define SYS_eventfd 351
#define SYS_fallocate 352
-#define SYS_timerfd_settime 353
-#define SYS_timerfd_gettime 354
+#define SYS_timerfd_settime32 353
+#define SYS_timerfd_gettime32 354
#define SYS_signalfd4 355
#define SYS_eventfd2 356
#define SYS_epoll_create1 357
@@ -783,4 +785,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/aio.h b/lib/libc/include/generic-musl/aio.h
index 0830b10c2cdc733fc1d6d26c0b86f1ebbe68dd08..4588ff2e3941488a31089dc710522682502b6b97 100644
--- a/lib/libc/include/generic-musl/aio.h
+++ b/lib/libc/include/generic-musl/aio.h
@@ -62,6 +62,10 @@ int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sige
#define off64_t off_t
#endif
+#if _REDIR_TIME64
+__REDIR(aio_suspend, __aio_suspend_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/alloca.h b/lib/libc/include/generic-musl/alloca.h
index 53dd20479d29d8b51d406876569d642f480342ec..28390cee6b5577328f3a6ba5fddfc112c19e3a76 100644
--- a/lib/libc/include/generic-musl/alloca.h
+++ b/lib/libc/include/generic-musl/alloca.h
@@ -10,9 +10,7 @@ extern "C" {
void *alloca(size_t);
-#ifdef __GNUC__
#define alloca __builtin_alloca
-#endif
#ifdef __cplusplus
}
diff --git a/lib/libc/include/generic-musl/arpa/nameser.h b/lib/libc/include/generic-musl/arpa/nameser.h
index bd411459eb496fec950c06c96b79d5ace36b7049..10db66745e2235f1144ed7436dad32781146bcdd 100644
--- a/lib/libc/include/generic-musl/arpa/nameser.h
+++ b/lib/libc/include/generic-musl/arpa/nameser.h
@@ -7,7 +7,6 @@ extern "C" {
#include
#include
-#include
#define __NAMESER 19991006
#define NS_PACKETSZ 512
diff --git a/lib/libc/include/generic-musl/bits/dirent.h b/lib/libc/include/generic-musl/bits/dirent.h
new file mode 100644
index 0000000000000000000000000000000000000000..16f37f69828fb05197b5ac68c046ef37c520571d
--- /dev/null
+++ b/lib/libc/include/generic-musl/bits/dirent.h
@@ -0,0 +1,11 @@
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
+
+struct dirent {
+ ino_t d_ino;
+ off_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+};
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/bits/endian.h b/lib/libc/include/generic-musl/bits/endian.h
deleted file mode 100644
index b1a7affbbb6f6a0f504b5ef4b4b2022d90636159..0000000000000000000000000000000000000000
--- a/lib/libc/include/generic-musl/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __LITTLE_ENDIAN
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/bits/ioctl.h b/lib/libc/include/generic-musl/bits/ioctl.h
index 3af94ce07ac75dc9d36e5c729ee7d325c21a3ab4..1f814548d3baf05173868d8c20d76e783ae8a0c8 100644
--- a/lib/libc/include/generic-musl/bits/ioctl.h
+++ b/lib/libc/include/generic-musl/bits/ioctl.h
@@ -104,7 +104,12 @@
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
+#if __LONG_MAX == 0x7fffffff
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
+#else
#define SIOCGSTAMP 0x8906
#define SIOCGSTAMPNS 0x8907
+#endif
#include
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/bits/limits.h b/lib/libc/include/generic-musl/bits/limits.h
index 1be0deba7abfc5619657e0b90912d054efc53313..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/lib/libc/include/generic-musl/bits/limits.h
+++ b/lib/libc/include/generic-musl/bits/limits.h
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/bits/socket.h b/lib/libc/include/generic-musl/bits/socket.h
index 34aba4d2a22d0318a556880a69eb36cc8af74ce9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/lib/libc/include/generic-musl/bits/socket.h
+++ b/lib/libc/include/generic-musl/bits/socket.h
@@ -1,15 +0,0 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/dirent.h b/lib/libc/include/generic-musl/dirent.h
index 2be943aa18d7dafade841c253e65382c7937462a..665c411a6f608dda465e7242defaa92d726866f6 100644
--- a/lib/libc/include/generic-musl/dirent.h
+++ b/lib/libc/include/generic-musl/dirent.h
@@ -15,20 +15,10 @@ extern "C" {
#include
+#include
+
typedef struct __dirstream DIR;
-#define _DIRENT_HAVE_D_RECLEN
-#define _DIRENT_HAVE_D_OFF
-#define _DIRENT_HAVE_D_TYPE
-
-struct dirent {
- ino_t d_ino;
- off_t d_off;
- unsigned short d_reclen;
- unsigned char d_type;
- char d_name[256];
-};
-
#define d_fileno d_ino
int closedir(DIR *);
diff --git a/lib/libc/include/generic-musl/dlfcn.h b/lib/libc/include/generic-musl/dlfcn.h
index 871f385859ad3961db79d9a5dd7c2aecb07a6eb3..c38b56c4707191aa5d3a58c3d164b7a84137a076 100644
--- a/lib/libc/include/generic-musl/dlfcn.h
+++ b/lib/libc/include/generic-musl/dlfcn.h
@@ -35,6 +35,10 @@ int dladdr(const void *, Dl_info *);
int dlinfo(void *, int, void *);
#endif
+#if _REDIR_TIME64
+__REDIR(dlsym, __dlsym_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/endian.h b/lib/libc/include/generic-musl/endian.h
index 35198b06a5ec13dbb1e3f6a1887c1a44638e7fd9..12b8d3038405b6c01d2506e98335ad0091aac4b1 100644
--- a/lib/libc/include/generic-musl/endian.h
+++ b/lib/libc/include/generic-musl/endian.h
@@ -3,25 +3,19 @@
#include
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
+#define __NEED_uint16_t
+#define __NEED_uint32_t
+#define __NEED_uint64_t
+
+#include
+
#define __PDP_ENDIAN 3412
-#if defined(__GNUC__) && defined(__BYTE_ORDER__)
-#define __BYTE_ORDER __BYTE_ORDER__
-#else
-#include
-#endif
-
-#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-
#define BIG_ENDIAN __BIG_ENDIAN
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define PDP_ENDIAN __PDP_ENDIAN
#define BYTE_ORDER __BYTE_ORDER
-#include
-
static __inline uint16_t __bswap16(uint16_t __x)
{
return __x<<8 | __x>>8;
@@ -40,43 +34,47 @@ static __inline uint64_t __bswap64(uint64_t __x)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htobe16(x) __bswap16(x)
#define be16toh(x) __bswap16(x)
-#define betoh16(x) __bswap16(x)
#define htobe32(x) __bswap32(x)
#define be32toh(x) __bswap32(x)
-#define betoh32(x) __bswap32(x)
#define htobe64(x) __bswap64(x)
#define be64toh(x) __bswap64(x)
-#define betoh64(x) __bswap64(x)
#define htole16(x) (uint16_t)(x)
#define le16toh(x) (uint16_t)(x)
-#define letoh16(x) (uint16_t)(x)
#define htole32(x) (uint32_t)(x)
#define le32toh(x) (uint32_t)(x)
-#define letoh32(x) (uint32_t)(x)
#define htole64(x) (uint64_t)(x)
#define le64toh(x) (uint64_t)(x)
-#define letoh64(x) (uint64_t)(x)
#else
#define htobe16(x) (uint16_t)(x)
#define be16toh(x) (uint16_t)(x)
-#define betoh16(x) (uint16_t)(x)
#define htobe32(x) (uint32_t)(x)
#define be32toh(x) (uint32_t)(x)
-#define betoh32(x) (uint32_t)(x)
#define htobe64(x) (uint64_t)(x)
#define be64toh(x) (uint64_t)(x)
-#define betoh64(x) (uint64_t)(x)
#define htole16(x) __bswap16(x)
#define le16toh(x) __bswap16(x)
-#define letoh16(x) __bswap16(x)
#define htole32(x) __bswap32(x)
#define le32toh(x) __bswap32(x)
-#define letoh32(x) __bswap32(x)
#define htole64(x) __bswap64(x)
#define le64toh(x) __bswap64(x)
+#endif
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define betoh16(x) __bswap16(x)
+#define betoh32(x) __bswap32(x)
+#define betoh64(x) __bswap64(x)
+#define letoh16(x) (uint16_t)(x)
+#define letoh32(x) (uint32_t)(x)
+#define letoh64(x) (uint64_t)(x)
+#else
+#define betoh16(x) (uint16_t)(x)
+#define betoh32(x) (uint32_t)(x)
+#define betoh64(x) (uint64_t)(x)
+#define letoh16(x) __bswap16(x)
+#define letoh32(x) __bswap32(x)
#define letoh64(x) __bswap64(x)
#endif
-
#endif
#endif
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/features.h b/lib/libc/include/generic-musl/features.h
index f649c1773b6c987593789c42450dc72ace073d42..6b8e6aa25acc63d2f5872085c83536ac3a7222ca 100644
--- a/lib/libc/include/generic-musl/features.h
+++ b/lib/libc/include/generic-musl/features.h
@@ -35,4 +35,6 @@
#define _Noreturn
#endif
+#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
+
#endif
\ No newline at end of file
diff --git a/lib/libc/include/generic-musl/limits.h b/lib/libc/include/generic-musl/limits.h
index 38ad59e60187fd200e345bc5c9b17804a23db481..78db5b776ba57bbd2bc7142ded747d802c8f1447 100644
--- a/lib/libc/include/generic-musl/limits.h
+++ b/lib/libc/include/generic-musl/limits.h
@@ -3,9 +3,7 @@
#include
-/* Most limits are system-specific */
-
-#include
+#include /* __LONG_MAX */
/* Support signed or unsigned plain-char */
@@ -17,8 +15,6 @@
#define CHAR_MAX 127
#endif
-/* Some universal constants... */
-
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
@@ -30,8 +26,10 @@
#define INT_MAX 0x7fffffff
#define UINT_MAX 0xffffffffU
#define LONG_MIN (-LONG_MAX-1)
+#define LONG_MAX __LONG_MAX
#define ULONG_MAX (2UL*LONG_MAX+1)
#define LLONG_MIN (-LLONG_MAX-1)
+#define LLONG_MAX 0x7fffffffffffffffLL
#define ULLONG_MAX (2ULL*LLONG_MAX+1)
#define MB_LEN_MAX 4
@@ -39,9 +37,13 @@
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#include
+
#define PIPE_BUF 4096
#define FILESIZEBITS 64
+#ifndef NAME_MAX
#define NAME_MAX 255
+#endif
#define PATH_MAX 4096
#define NGROUPS_MAX 32
#define ARG_MAX 131072
@@ -53,6 +55,12 @@
#define TTY_NAME_MAX 32
#define HOST_NAME_MAX 255
+#if LONG_MAX == 0x7fffffffL
+#define LONG_BIT 32
+#else
+#define LONG_BIT 64
+#endif
+
/* Implementation choices... */
#define PTHREAD_KEYS_MAX 128
diff --git a/lib/libc/include/generic-musl/mqueue.h b/lib/libc/include/generic-musl/mqueue.h
index 917b80c2e348d73cc544cacdb9d250a295b2f5b5..1b0a1b16e34909b952f0a1619a342d4b77db32da 100644
--- a/lib/libc/include/generic-musl/mqueue.h
+++ b/lib/libc/include/generic-musl/mqueue.h
@@ -30,6 +30,11 @@ ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, c
int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *);
int mq_unlink(const char *);
+#if _REDIR_TIME64
+__REDIR(mq_timedreceive, __mq_timedreceive_time64);
+__REDIR(mq_timedsend, __mq_timedsend_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/netinet/icmp6.h b/lib/libc/include/generic-musl/netinet/icmp6.h
index 6419a5a0a78565c287dce8df328968f6e5c65597..44a2d8b0f3d8502271cb308e33e46d3b9f8e97e9 100644
--- a/lib/libc/include/generic-musl/netinet/icmp6.h
+++ b/lib/libc/include/generic-musl/netinet/icmp6.h
@@ -9,7 +9,6 @@ extern "C" {
#include
#include
#include
-#include
#define ICMP6_FILTER 1
diff --git a/lib/libc/include/generic-musl/netinet/if_ether.h b/lib/libc/include/generic-musl/netinet/if_ether.h
index 37d81698eb003fbf1665639974ee16b5cfc474e0..8be01cd4efd4861b54772d46b936d7a207da97b3 100644
--- a/lib/libc/include/generic-musl/netinet/if_ether.h
+++ b/lib/libc/include/generic-musl/netinet/if_ether.h
@@ -58,6 +58,7 @@
#define ETH_P_ERSPAN 0x88BE
#define ETH_P_PREAUTH 0x88C7
#define ETH_P_TIPC 0x88CA
+#define ETH_P_LLDP 0x88CC
#define ETH_P_MACSEC 0x88E5
#define ETH_P_8021AH 0x88E7
#define ETH_P_MVRP 0x88F5
diff --git a/lib/libc/include/generic-musl/netinet/ip.h b/lib/libc/include/generic-musl/netinet/ip.h
index 95baf6bdb1458082b926550f53be5835641c9a51..4a8a746f8ecfeeaf0102a1f522fcbaba420cfd29 100644
--- a/lib/libc/include/generic-musl/netinet/ip.h
+++ b/lib/libc/include/generic-musl/netinet/ip.h
@@ -7,7 +7,6 @@ extern "C" {
#include
#include
-#include
struct timestamp {
uint8_t len;
@@ -191,6 +190,8 @@ struct ip_timestamp {
#define IP_MSS 576
+#define __UAPI_DEF_IPHDR 0
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/netinet/ip6.h b/lib/libc/include/generic-musl/netinet/ip6.h
index cb1292a6476e9ef057b88612059de7855d52d339..dfb237795f345fad1444fd72c3ae051a534dbe00 100644
--- a/lib/libc/include/generic-musl/netinet/ip6.h
+++ b/lib/libc/include/generic-musl/netinet/ip6.h
@@ -7,7 +7,6 @@ extern "C" {
#include
#include
-#include
struct ip6_hdr {
union {
diff --git a/lib/libc/include/generic-musl/netinet/tcp.h b/lib/libc/include/generic-musl/netinet/tcp.h
index 949f701493aaa2b0a3836cafb9e88162f6057348..f0bdb1923279e6ab0d8d70104c9676810d2966e0 100644
--- a/lib/libc/include/generic-musl/netinet/tcp.h
+++ b/lib/libc/include/generic-musl/netinet/tcp.h
@@ -38,6 +38,7 @@
#define TCP_FASTOPEN_NO_COOKIE 34
#define TCP_ZEROCOPY_RECEIVE 35
#define TCP_INQ 36
+#define TCP_TX_DELAY 37
#define TCP_CM_INQ TCP_INQ
@@ -97,7 +98,6 @@ enum {
#include
#include
#include
-#include
typedef uint32_t tcp_seq;
@@ -234,6 +234,8 @@ struct tcp_info {
uint64_t tcpi_bytes_retrans;
uint32_t tcpi_dsack_dups;
uint32_t tcpi_reord_seen;
+ uint32_t tcpi_rcv_ooopack;
+ uint32_t tcpi_snd_wnd;
};
#define TCP_MD5SIG_MAXKEYLEN 80
diff --git a/lib/libc/include/generic-musl/poll.h b/lib/libc/include/generic-musl/poll.h
index be58c6417462c1a9a2f39fcf138facaa5b2cd79a..45078b866dabf961baa350b5a21d6b65b8035689 100644
--- a/lib/libc/include/generic-musl/poll.h
+++ b/lib/libc/include/generic-musl/poll.h
@@ -44,6 +44,12 @@ int poll (struct pollfd *, nfds_t, int);
int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
#endif
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(ppoll, __ppoll_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/pthread.h b/lib/libc/include/generic-musl/pthread.h
index 6bfa3a5acec93bb299c73ecb5cd70e643c5e7607..e812c675c2620f23386905bcec165c01a740d623 100644
--- a/lib/libc/include/generic-musl/pthread.h
+++ b/lib/libc/include/generic-musl/pthread.h
@@ -224,6 +224,16 @@ int pthread_tryjoin_np(pthread_t, void **);
int pthread_timedjoin_np(pthread_t, void **, const struct timespec *);
#endif
+#if _REDIR_TIME64
+__REDIR(pthread_mutex_timedlock, __pthread_mutex_timedlock_time64);
+__REDIR(pthread_cond_timedwait, __pthread_cond_timedwait_time64);
+__REDIR(pthread_rwlock_timedrdlock, __pthread_rwlock_timedrdlock_time64);
+__REDIR(pthread_rwlock_timedwrlock, __pthread_rwlock_timedwrlock_time64);
+#ifdef _GNU_SOURCE
+__REDIR(pthread_timedjoin_np, __pthread_timedjoin_np_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sched.h b/lib/libc/include/generic-musl/sched.h
index 7963785f67b34ad59657117c0943a94381091ab2..6225d25d5389b28ed2bd0429a2745f4fba59152c 100644
--- a/lib/libc/include/generic-musl/sched.h
+++ b/lib/libc/include/generic-musl/sched.h
@@ -19,10 +19,14 @@ extern "C" {
struct sched_param {
int sched_priority;
int __reserved1;
+#if _REDIR_TIME64
+ long __reserved2[4];
+#else
struct {
time_t __reserved1;
long __reserved2;
} __reserved2[2];
+#endif
int __reserved3;
};
@@ -133,6 +137,10 @@ __CPU_op_func_S(XOR, ^)
#endif
+#if _REDIR_TIME64
+__REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/semaphore.h b/lib/libc/include/generic-musl/semaphore.h
index 52f956ad23a870446c6c739ff08d879abf1f020b..8f26fb75f79612084402f881bdb5f65329667eb5 100644
--- a/lib/libc/include/generic-musl/semaphore.h
+++ b/lib/libc/include/generic-musl/semaphore.h
@@ -29,6 +29,10 @@ int sem_trywait(sem_t *);
int sem_unlink(const char *);
int sem_wait(sem_t *);
+#if _REDIR_TIME64
+__REDIR(sem_timedwait, __sem_timedwait_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/signal.h b/lib/libc/include/generic-musl/signal.h
index 37ee858c48af971425591fb3e3f648d13c166507..99d473c50eef56628955d347ccfd9ddc42892149 100644
--- a/lib/libc/include/generic-musl/signal.h
+++ b/lib/libc/include/generic-musl/signal.h
@@ -271,6 +271,14 @@ typedef int sig_atomic_t;
void (*signal(int, void (*)(int)))(int);
int raise(int);
+#if _REDIR_TIME64
+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+__REDIR(sigtimedwait, __sigtimedwait_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/acct.h b/lib/libc/include/generic-musl/sys/acct.h
index 02e4c7887cf89c1c871bd43ee8bd2048c7f5b952..b4161dec6b540ad607e7aceeab8563c501a6045c 100644
--- a/lib/libc/include/generic-musl/sys/acct.h
+++ b/lib/libc/include/generic-musl/sys/acct.h
@@ -6,7 +6,6 @@ extern "C" {
#endif
#include
-#include
#include
#include
diff --git a/lib/libc/include/generic-musl/sys/ioctl.h b/lib/libc/include/generic-musl/sys/ioctl.h
index 7d3a88079a14f56cb1450ced47b18c0b7975b335..28c9b6e24fb7e06cf5aaf0d7cc33eb941ab2ab50 100644
--- a/lib/libc/include/generic-musl/sys/ioctl.h
+++ b/lib/libc/include/generic-musl/sys/ioctl.h
@@ -4,6 +4,7 @@
extern "C" {
#endif
+#include
#include
#define N_TTY 0
diff --git a/lib/libc/include/generic-musl/sys/mman.h b/lib/libc/include/generic-musl/sys/mman.h
index 85c605b75f0d32312a2fa8f7a2aaaf4f9692c5d3..9bfd0a1075f45d0b820bb3c41c18b886e7ba7c6b 100644
--- a/lib/libc/include/generic-musl/sys/mman.h
+++ b/lib/libc/include/generic-musl/sys/mman.h
@@ -92,6 +92,8 @@ extern "C" {
#define MADV_DODUMP 17
#define MADV_WIPEONFORK 18
#define MADV_KEEPONFORK 19
+#define MADV_COLD 20
+#define MADV_PAGEOUT 21
#define MADV_HWPOISON 100
#define MADV_SOFT_OFFLINE 101
#endif
diff --git a/lib/libc/include/generic-musl/sys/prctl.h b/lib/libc/include/generic-musl/sys/prctl.h
index 4cc6567f936fb63c0522162664f387ca9d33befe..c5f79d86d2e59050957b6dab69a558681bdec049 100644
--- a/lib/libc/include/generic-musl/sys/prctl.h
+++ b/lib/libc/include/generic-musl/sys/prctl.h
@@ -154,6 +154,10 @@ struct prctl_mm_map {
#define PR_PAC_APDBKEY (1UL << 3)
#define PR_PAC_APGAKEY (1UL << 4)
+#define PR_SET_TAGGED_ADDR_CTRL 55
+#define PR_GET_TAGGED_ADDR_CTRL 56
+#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
+
int prctl (int, ...);
#ifdef __cplusplus
diff --git a/lib/libc/include/generic-musl/sys/procfs.h b/lib/libc/include/generic-musl/sys/procfs.h
index 6c255d3a8beb6f7f0325f8816161089fa9a0db5d..03db62abfa40f4efaabe70aec2d63818cc792501 100644
--- a/lib/libc/include/generic-musl/sys/procfs.h
+++ b/lib/libc/include/generic-musl/sys/procfs.h
@@ -23,10 +23,9 @@ struct elf_prstatus {
pid_t pr_ppid;
pid_t pr_pgrp;
pid_t pr_sid;
- struct timeval pr_utime;
- struct timeval pr_stime;
- struct timeval pr_cutime;
- struct timeval pr_cstime;
+ struct {
+ long tv_sec, tv_usec;
+ } pr_utime, pr_stime, pr_cutime, pr_cstime;
elf_gregset_t pr_reg;
int pr_fpvalid;
};
diff --git a/lib/libc/include/generic-musl/sys/ptrace.h b/lib/libc/include/generic-musl/sys/ptrace.h
index a37ef97bcfda7638777c521fbed016960008289c..1f0c6890fee218cecbffac72a316a8bb8fae2887 100644
--- a/lib/libc/include/generic-musl/sys/ptrace.h
+++ b/lib/libc/include/generic-musl/sys/ptrace.h
@@ -41,6 +41,7 @@ extern "C" {
#define PTRACE_SETSIGMASK 0x420b
#define PTRACE_SECCOMP_GET_FILTER 0x420c
#define PTRACE_SECCOMP_GET_METADATA 0x420d
+#define PTRACE_GET_SYSCALL_INFO 0x420e
#define PT_READ_I PTRACE_PEEKTEXT
#define PT_READ_D PTRACE_PEEKDATA
@@ -88,6 +89,11 @@ extern "C" {
#define PTRACE_PEEKSIGINFO_SHARED 1
+#define PTRACE_SYSCALL_INFO_NONE 0
+#define PTRACE_SYSCALL_INFO_ENTRY 1
+#define PTRACE_SYSCALL_INFO_EXIT 2
+#define PTRACE_SYSCALL_INFO_SECCOMP 3
+
#include
struct __ptrace_peeksiginfo_args {
@@ -101,6 +107,29 @@ struct __ptrace_seccomp_metadata {
uint64_t flags;
};
+struct __ptrace_syscall_info {
+ uint8_t op;
+ uint8_t __pad[3];
+ uint32_t arch;
+ uint64_t instruction_pointer;
+ uint64_t stack_pointer;
+ union {
+ struct {
+ uint64_t nr;
+ uint64_t args[6];
+ } entry;
+ struct {
+ int64_t rval;
+ uint8_t is_error;
+ } exit;
+ struct {
+ uint64_t nr;
+ uint64_t args[6];
+ uint32_t ret_data;
+ } seccomp;
+ };
+};
+
long ptrace(int, ...);
#ifdef __cplusplus
diff --git a/lib/libc/include/generic-musl/sys/resource.h b/lib/libc/include/generic-musl/sys/resource.h
index 90def956e6c4971f602f42131eb6949bd2649519..8ef18ec050691f4417c563ea15b3eca9b3b71f4f 100644
--- a/lib/libc/include/generic-musl/sys/resource.h
+++ b/lib/libc/include/generic-musl/sys/resource.h
@@ -90,7 +90,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
#define RLIMIT_MSGQUEUE 12
#define RLIMIT_NICE 13
#define RLIMIT_RTPRIO 14
-#define RLIMIT_NLIMITS 15
+#define RLIMIT_RTTIME 15
+#define RLIMIT_NLIMITS 16
#define RLIM_NLIMITS RLIMIT_NLIMITS
@@ -104,6 +105,10 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
#define rlim64_t rlim_t
#endif
+#if _REDIR_TIME64
+__REDIR(getrusage, __getrusage_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/select.h b/lib/libc/include/generic-musl/sys/select.h
index 1a54ab5880c1027f99bae544b0006fb862be3002..8ebe0c8b083f562a5a72db18826eaa5eacccafdf 100644
--- a/lib/libc/include/generic-musl/sys/select.h
+++ b/lib/libc/include/generic-musl/sys/select.h
@@ -35,6 +35,11 @@ int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, co
#define NFDBITS (8*(int)sizeof(long))
#endif
+#if _REDIR_TIME64
+__REDIR(select, __select_time64);
+__REDIR(pselect, __pselect_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/sem.h b/lib/libc/include/generic-musl/sys/sem.h
index 95e5d9433c668395a80a5d52e5a071267ae9daf7..41362fab28a3dcedd9c2c00c7b8f2a1047d72d6f 100644
--- a/lib/libc/include/generic-musl/sys/sem.h
+++ b/lib/libc/include/generic-musl/sys/sem.h
@@ -25,8 +25,6 @@ extern "C" {
#define SETVAL 16
#define SETALL 17
-#include
-
#include
#define _SEM_SEMUN_UNDEFINED 1
@@ -62,6 +60,12 @@ int semop(int, struct sembuf *, size_t);
int semtimedop(int, struct sembuf *, size_t, const struct timespec *);
#endif
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(semtimedop, __semtimedop_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/socket.h b/lib/libc/include/generic-musl/sys/socket.h
index 2c82ee12b209d698d32c877eb916629f4957cdbe..957d3da9f0dc86e677544601822ef5af7c4ec7b5 100644
--- a/lib/libc/include/generic-musl/sys/socket.h
+++ b/lib/libc/include/generic-musl/sys/socket.h
@@ -19,6 +19,40 @@ extern "C" {
#include
+struct msghdr {
+ void *msg_name;
+ socklen_t msg_namelen;
+ struct iovec *msg_iov;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+ int __pad1;
+#endif
+ int msg_iovlen;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+ int __pad1;
+#endif
+ void *msg_control;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+ int __pad2;
+#endif
+ socklen_t msg_controllen;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+ int __pad2;
+#endif
+ int msg_flags;
+};
+
+struct cmsghdr {
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+ int __pad1;
+#endif
+ socklen_t cmsg_len;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+ int __pad1;
+#endif
+ int cmsg_level;
+ int cmsg_type;
+};
+
#ifdef _GNU_SOURCE
struct ucred {
pid_t pid;
@@ -182,8 +216,6 @@ struct linger {
#define SO_PEERCRED 17
#define SO_RCVLOWAT 18
#define SO_SNDLOWAT 19
-#define SO_RCVTIMEO 20
-#define SO_SNDTIMEO 21
#define SO_ACCEPTCONN 30
#define SO_PEERSEC 31
#define SO_SNDBUFFORCE 32
@@ -192,6 +224,28 @@ struct linger {
#define SO_DOMAIN 39
#endif
+#ifndef SO_RCVTIMEO
+#if __LONG_MAX == 0x7fffffff
+#define SO_RCVTIMEO 66
+#define SO_SNDTIMEO 67
+#else
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+#endif
+#endif
+
+#ifndef SO_TIMESTAMP
+#if __LONG_MAX == 0x7fffffff
+#define SO_TIMESTAMP 63
+#define SO_TIMESTAMPNS 64
+#define SO_TIMESTAMPING 65
+#else
+#define SO_TIMESTAMP 29
+#define SO_TIMESTAMPNS 35
+#define SO_TIMESTAMPING 37
+#endif
+#endif
+
#define SO_SECURITY_AUTHENTICATION 22
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
@@ -203,14 +257,10 @@ struct linger {
#define SO_GET_FILTER SO_ATTACH_FILTER
#define SO_PEERNAME 28
-#define SO_TIMESTAMP 29
#define SCM_TIMESTAMP SO_TIMESTAMP
-
#define SO_PASSSEC 34
-#define SO_TIMESTAMPNS 35
#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
#define SO_MARK 36
-#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
#define SO_RXQ_OVFL 40
#define SO_WIFI_STATUS 41
@@ -238,6 +288,7 @@ struct linger {
#define SO_TXTIME 61
#define SCM_TXTIME SO_TXTIME
#define SO_BINDTOIFINDEX 62
+#define SO_DETACH_REUSEPORT_BPF 68
#ifndef SOL_SOCKET
#define SOL_SOCKET 1
@@ -350,6 +401,12 @@ int setsockopt (int, int, int, const void *, socklen_t);
int sockatmark (int);
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(recvmmsg, __recvmmsg_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/stat.h b/lib/libc/include/generic-musl/sys/stat.h
index 521b873afa13c2dbc4095b6e7c483112ed769b2a..e8a3753445ed321eb60580d2b0de97694a056be0 100644
--- a/lib/libc/include/generic-musl/sys/stat.h
+++ b/lib/libc/include/generic-musl/sys/stat.h
@@ -110,6 +110,15 @@ int lchmod(const char *, mode_t);
#define off64_t off_t
#endif
+#if _REDIR_TIME64
+__REDIR(stat, __stat_time64);
+__REDIR(fstat, __fstat_time64);
+__REDIR(lstat, __lstat_time64);
+__REDIR(fstatat, __fstatat_time64);
+__REDIR(futimens, __futimens_time64);
+__REDIR(utimensat, __utimensat_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/statvfs.h b/lib/libc/include/generic-musl/sys/statvfs.h
index b2fb003b324ba927a7224016ae8fe3890ce16bd1..0da838f1ef94c07ca87fa24c520bd71ff7abe640 100644
--- a/lib/libc/include/generic-musl/sys/statvfs.h
+++ b/lib/libc/include/generic-musl/sys/statvfs.h
@@ -11,8 +11,6 @@ extern "C" {
#define __NEED_fsfilcnt_t
#include
-#include
-
struct statvfs {
unsigned long f_bsize, f_frsize;
fsblkcnt_t f_blocks, f_bfree, f_bavail;
diff --git a/lib/libc/include/generic-musl/sys/time.h b/lib/libc/include/generic-musl/sys/time.h
index cb3022c7789078b49ad7e3195a30eca4058e180c..301c098ab43cab078655638fe25de7279e553e51 100644
--- a/lib/libc/include/generic-musl/sys/time.h
+++ b/lib/libc/include/generic-musl/sys/time.h
@@ -56,6 +56,20 @@ int adjtime (const struct timeval *, struct timeval *);
(void)0 )
#endif
+#if _REDIR_TIME64
+__REDIR(gettimeofday, __gettimeofday_time64);
+__REDIR(getitimer, __getitimer_time64);
+__REDIR(setitimer, __setitimer_time64);
+__REDIR(utimes, __utimes_time64);
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+__REDIR(futimes, __futimes_time64);
+__REDIR(futimesat, __futimesat_time64);
+__REDIR(lutimes, __lutimes_time64);
+__REDIR(settimeofday, __settimeofday_time64);
+__REDIR(adjtime, __adjtime64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/timeb.h b/lib/libc/include/generic-musl/sys/timeb.h
index acbde569f28bfc0979f3da2ed56d22800d7d02c6..6da1226b16a16791724cf5ab826029ac6104f711 100644
--- a/lib/libc/include/generic-musl/sys/timeb.h
+++ b/lib/libc/include/generic-musl/sys/timeb.h
@@ -4,6 +4,8 @@
extern "C" {
#endif
+#include
+
#define __NEED_time_t
#include
@@ -16,6 +18,10 @@ struct timeb {
int ftime(struct timeb *);
+#if _REDIR_TIME64
+__REDIR(ftime, __ftime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/timerfd.h b/lib/libc/include/generic-musl/sys/timerfd.h
index 3bea27f45a2031afa8d8ba6677ca8abc15ef2449..ff158861cff5329c9c5586374263d5fa2918264a 100644
--- a/lib/libc/include/generic-musl/sys/timerfd.h
+++ b/lib/libc/include/generic-musl/sys/timerfd.h
@@ -20,6 +20,11 @@ int timerfd_create(int, int);
int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *);
int timerfd_gettime(int, struct itimerspec *);
+#if _REDIR_TIME64
+__REDIR(timerfd_settime, __timerfd_settime64);
+__REDIR(timerfd_gettime, __timerfd_gettime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/timex.h b/lib/libc/include/generic-musl/sys/timex.h
index fc42fc653bd3f3d2360ecb10f7272008bcd81304..cab33a954cacb1ae14ab73ad40a84b54331ac5ea 100644
--- a/lib/libc/include/generic-musl/sys/timex.h
+++ b/lib/libc/include/generic-musl/sys/timex.h
@@ -91,6 +91,11 @@ struct timex {
int adjtimex(struct timex *);
int clock_adjtime(clockid_t, struct timex *);
+#if _REDIR_TIME64
+__REDIR(adjtimex, __adjtimex_time64);
+__REDIR(clock_adjtime, __clock_adjtime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/sys/ttydefaults.h b/lib/libc/include/generic-musl/sys/ttydefaults.h
index 2324873319a1e966499e61c7487380582975ca5d..602a4af79ae0fa7adc93c6ceca8703e8b8f18592 100644
--- a/lib/libc/include/generic-musl/sys/ttydefaults.h
+++ b/lib/libc/include/generic-musl/sys/ttydefaults.h
@@ -6,16 +6,11 @@
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
#define TTYDEF_SPEED (B9600)
-#define CTRL(x) (x&037)
+#define CTRL(x) ((x)&037)
#define CEOF CTRL('d')
-#ifdef _POSIX_VDISABLE
-#define CEOL _POSIX_VDISABLE
-#define CSTATUS _POSIX_VDISABLE
-#else
#define CEOL '\0'
#define CSTATUS '\0'
-#endif
#define CERASE 0177
#define CINTR CTRL('c')
diff --git a/lib/libc/include/generic-musl/sys/wait.h b/lib/libc/include/generic-musl/sys/wait.h
index 352fdcadf1ba510a27b34cf367db88c7e7a13cd2..0ad11ab54f9417e29704d0b5e9de001b548ad3ab 100644
--- a/lib/libc/include/generic-musl/sys/wait.h
+++ b/lib/libc/include/generic-musl/sys/wait.h
@@ -13,7 +13,8 @@ extern "C" {
typedef enum {
P_ALL = 0,
P_PID = 1,
- P_PGID = 2
+ P_PGID = 2,
+ P_PIDFD = 3
} idtype_t;
pid_t wait (int *);
@@ -53,6 +54,13 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#define WIFCONTINUED(s) ((s) == 0xffff)
+#if _REDIR_TIME64
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+__REDIR(wait3, __wait3_time64);
+__REDIR(wait4, __wait4_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/threads.h b/lib/libc/include/generic-musl/threads.h
index 51ef3bad7b25b67ecb5b214d9dd0fdabaf20d790..cecff6647c445ac50ca49e8b7ee9dd71bf751ebf 100644
--- a/lib/libc/include/generic-musl/threads.h
+++ b/lib/libc/include/generic-musl/threads.h
@@ -80,6 +80,12 @@ void tss_delete(tss_t);
int tss_set(tss_t, void *);
void *tss_get(tss_t);
+#if _REDIR_TIME64
+__REDIR(thrd_sleep, __thrd_sleep_time64);
+__REDIR(mtx_timedlock, __mtx_timedlock_time64);
+__REDIR(cnd_timedwait, __cnd_timedwait_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/time.h b/lib/libc/include/generic-musl/time.h
index 755c6ad7aa04f1bebb9e8a0097a7ce211bfe5cdc..5a9f61eb4d6a22cda03a5624ebbf18aeb14a4283 100644
--- a/lib/libc/include/generic-musl/time.h
+++ b/lib/libc/include/generic-musl/time.h
@@ -130,6 +130,34 @@ int stime(const time_t *);
time_t timegm(struct tm *);
#endif
+#if _REDIR_TIME64
+__REDIR(time, __time64);
+__REDIR(difftime, __difftime64);
+__REDIR(mktime, __mktime64);
+__REDIR(gmtime, __gmtime64);
+__REDIR(localtime, __localtime64);
+__REDIR(ctime, __ctime64);
+__REDIR(timespec_get, __timespec_get_time64);
+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+__REDIR(gmtime_r, __gmtime64_r);
+__REDIR(localtime_r, __localtime64_r);
+__REDIR(ctime_r, __ctime64_r);
+__REDIR(nanosleep, __nanosleep_time64);
+__REDIR(clock_getres, __clock_getres_time64);
+__REDIR(clock_gettime, __clock_gettime64);
+__REDIR(clock_settime, __clock_settime64);
+__REDIR(clock_nanosleep, __clock_nanosleep_time64);
+__REDIR(timer_settime, __timer_settime64);
+__REDIR(timer_gettime, __timer_gettime64);
+#endif
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+__REDIR(stime, __stime64);
+__REDIR(timegm, __timegm_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/utime.h b/lib/libc/include/generic-musl/utime.h
index 89c2bc8013b1f45fcde894bceef59a76e257b8f9..1ad5c49c5d8580b012f005803aa79e2c707f8ff5 100644
--- a/lib/libc/include/generic-musl/utime.h
+++ b/lib/libc/include/generic-musl/utime.h
@@ -5,6 +5,8 @@
extern "C" {
#endif
+#include
+
#define __NEED_time_t
#include
@@ -16,6 +18,10 @@ struct utimbuf {
int utime (const char *, const struct utimbuf *);
+#if _REDIR_TIME64
+__REDIR(utime, __utime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/include/generic-musl/utmpx.h b/lib/libc/include/generic-musl/utmpx.h
index 769101a2fe9d959409f1ef0ecaab6f442a804a57..29fa60d2f1a6135c827f5de653d3f12c157a9174 100644
--- a/lib/libc/include/generic-musl/utmpx.h
+++ b/lib/libc/include/generic-musl/utmpx.h
@@ -16,6 +16,7 @@ extern "C" {
struct utmpx {
short ut_type;
+ short __ut_pad1;
pid_t ut_pid;
char ut_line[32];
char ut_id[4];
@@ -25,7 +26,11 @@ struct utmpx {
short __e_termination;
short __e_exit;
} ut_exit;
- long ut_session;
+#if __BYTE_ORDER == 1234
+ int ut_session, __ut_pad2;
+#else
+ int __ut_pad2, ut_session;
+#endif
struct timeval ut_tv;
unsigned ut_addr_v6[4];
char __unused[20];
diff --git a/lib/libc/include/i386-linux-musl/bits/alltypes.h b/lib/libc/include/i386-linux-musl/bits/alltypes.h
index b4a1272fe6a6db92b31add2741c4e9a4aa647047..c330f5dd05962d0bd3958cb8cd6e1c9c741dde7c 100644
--- a/lib/libc/include/i386-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/i386-linux-musl/bits/alltypes.h
@@ -1,30 +1,10 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-#if __GNUC__ >= 3
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
-#endif
-
-#else
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef struct __va_list * va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef struct __va_list * __isoc_va_list;
-#define __DEFINED___isoc_va_list
-#endif
-
-#endif
+#define __BYTE_ORDER 1234
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#ifdef __WCHAR_TYPE__
@@ -85,52 +65,9 @@ typedef struct { alignas(8) long long __ll; long double __ld; } max_align_t;
#endif
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -167,6 +104,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -302,7 +249,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -398,6 +345,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -433,6 +391,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/i386-linux-musl/bits/ipcstat.h b/lib/libc/include/i386-linux-musl/bits/ipcstat.h
new file mode 100644
index 0000000000000000000000000000000000000000..d055f3e83716e7d28975b2f1836b04e8714f793e
--- /dev/null
+++ b/lib/libc/include/i386-linux-musl/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
\ No newline at end of file
diff --git a/lib/libc/include/i386-linux-musl/bits/limits.h b/lib/libc/include/i386-linux-musl/bits/limits.h
index 208e36bcd7438919a9145fbd447a7b7329991d65..fc11433d980df7405e8995f67023006f0f5b85c6 100644
--- a/lib/libc/include/i386-linux-musl/bits/limits.h
+++ b/lib/libc/include/i386-linux-musl/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define PAGESIZE 4096
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
+#define PAGESIZE 4096
\ No newline at end of file
diff --git a/lib/libc/include/i386-linux-musl/bits/msg.h b/lib/libc/include/i386-linux-musl/bits/msg.h
index e5c8ba75208c2ed80da66995f1afe78fdab39893..037fd956d4fc97531893940f657f2ca61c5cc63d 100644
--- a/lib/libc/include/i386-linux-musl/bits/msg.h
+++ b/lib/libc/include/i386-linux-musl/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/i386-linux-musl/bits/sem.h b/lib/libc/include/i386-linux-musl/bits/sem.h
index e63d0732bb46a1de99588265deaf5b98b6bf2930..f4936d6f5aad4b0d64de7158623fc9532be97e81 100644
--- a/lib/libc/include/i386-linux-musl/bits/sem.h
+++ b/lib/libc/include/i386-linux-musl/bits/sem.h
@@ -1,11 +1,13 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- long __unused1;
- time_t sem_ctime;
- long __unused2;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_lo;
+ unsigned long __sem_ctime_hi;
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/i386-linux-musl/bits/shm.h b/lib/libc/include/i386-linux-musl/bits/shm.h
index aa5587127ab24a71b87e7bef5946234c46a9c916..1ecb03ca0e4ac95ea0a2c9c4236293ff024472ca 100644
--- a/lib/libc/include/i386-linux-musl/bits/shm.h
+++ b/lib/libc/include/i386-linux-musl/bits/shm.h
@@ -3,17 +3,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- int __unused1;
- time_t shm_dtime;
- int __unused2;
- time_t shm_ctime;
- int __unused3;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __shm_ctime_hi;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ unsigned long __pad3;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/include/i386-linux-musl/bits/stat.h b/lib/libc/include/i386-linux-musl/bits/stat.h
index 78e91b40281427d98133894da7574cde7e83396b..3bf02b37564c0380675344ce1e9f9d82395256bd 100644
--- a/lib/libc/include/i386-linux-musl/bits/stat.h
+++ b/lib/libc/include/i386-linux-musl/bits/stat.h
@@ -14,8 +14,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ ino_t st_ino;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- ino_t st_ino;
};
\ No newline at end of file
diff --git a/lib/libc/include/i386-linux-musl/bits/syscall.h b/lib/libc/include/i386-linux-musl/bits/syscall.h
index 482f1d1d19c4c2933235746c27184dd3509fc88a..c9bfc7f95e077f5ed9d5c4cf5c832076ef24982b 100644
--- a/lib/libc/include/i386-linux-musl/bits/syscall.h
+++ b/lib/libc/include/i386-linux-musl/bits/syscall.h
@@ -76,8 +76,8 @@
#define __NR_setrlimit 75
#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
@@ -257,14 +257,14 @@
#define __NR_remap_file_pages 257
#define __NR_set_tid_address 258
#define __NR_timer_create 259
-#define __NR_timer_settime (__NR_timer_create+1)
-#define __NR_timer_gettime (__NR_timer_create+2)
+#define __NR_timer_settime32 (__NR_timer_create+1)
+#define __NR_timer_gettime32 (__NR_timer_create+2)
#define __NR_timer_getoverrun (__NR_timer_create+3)
#define __NR_timer_delete (__NR_timer_create+4)
-#define __NR_clock_settime (__NR_timer_create+5)
-#define __NR_clock_gettime (__NR_timer_create+6)
-#define __NR_clock_getres (__NR_timer_create+7)
-#define __NR_clock_nanosleep (__NR_timer_create+8)
+#define __NR_clock_settime32 (__NR_timer_create+5)
+#define __NR_clock_gettime32 (__NR_timer_create+6)
+#define __NR_clock_getres_time32 (__NR_timer_create+7)
+#define __NR_clock_nanosleep_time32 (__NR_timer_create+8)
#define __NR_statfs64 268
#define __NR_fstatfs64 269
#define __NR_tgkill 270
@@ -322,8 +322,8 @@
#define __NR_timerfd_create 322
#define __NR_eventfd 323
#define __NR_fallocate 324
-#define __NR_timerfd_settime 325
-#define __NR_timerfd_gettime 326
+#define __NR_timerfd_settime32 325
+#define __NR_timerfd_gettime32 326
#define __NR_signalfd4 327
#define __NR_eventfd2 328
#define __NR_epoll_create1 329
@@ -424,6 +424,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define SYS_restart_syscall 0
#define SYS_exit 1
@@ -503,8 +505,8 @@
#define SYS_setrlimit 75
#define SYS_getrlimit 76 /* Back compatible 2Gig limited rlimit */
#define SYS_getrusage 77
-#define SYS_gettimeofday 78
-#define SYS_settimeofday 79
+#define SYS_gettimeofday_time32 78
+#define SYS_settimeofday_time32 79
#define SYS_getgroups 80
#define SYS_setgroups 81
#define SYS_select 82
@@ -682,14 +684,14 @@
#define SYS_remap_file_pages 257
#define SYS_set_tid_address 258
#define SYS_timer_create 259
-#define SYS_timer_settime (__NR_timer_create+1)
-#define SYS_timer_gettime (__NR_timer_create+2)
+#define SYS_timer_settime32 (__NR_timer_create+1)
+#define SYS_timer_gettime32 (__NR_timer_create+2)
#define SYS_timer_getoverrun (__NR_timer_create+3)
#define SYS_timer_delete (__NR_timer_create+4)
-#define SYS_clock_settime (__NR_timer_create+5)
-#define SYS_clock_gettime (__NR_timer_create+6)
-#define SYS_clock_getres (__NR_timer_create+7)
-#define SYS_clock_nanosleep (__NR_timer_create+8)
+#define SYS_clock_settime32 (__NR_timer_create+5)
+#define SYS_clock_gettime32 (__NR_timer_create+6)
+#define SYS_clock_getres_time32 (__NR_timer_create+7)
+#define SYS_clock_nanosleep_time32 (__NR_timer_create+8)
#define SYS_statfs64 268
#define SYS_fstatfs64 269
#define SYS_tgkill 270
@@ -747,8 +749,8 @@
#define SYS_timerfd_create 322
#define SYS_eventfd 323
#define SYS_fallocate 324
-#define SYS_timerfd_settime 325
-#define SYS_timerfd_gettime 326
+#define SYS_timerfd_settime32 325
+#define SYS_timerfd_gettime32 326
#define SYS_signalfd4 327
#define SYS_eventfd2 328
#define SYS_epoll_create1 329
@@ -848,4 +850,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/alltypes.h b/lib/libc/include/mips-linux-musl/bits/alltypes.h
index d0f00474bd8fda7b70f9b62af72bfe8d811c2328..c714577aaac4be6ba32723daf077b7d8cec18f4c 100644
--- a/lib/libc/include/mips-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/mips-linux-musl/bits/alltypes.h
@@ -1,17 +1,15 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
+#if _MIPSEL || __MIPSEL || __MIPSEL__
+#define __BYTE_ORDER 1234
+#else
+#define __BYTE_ORDER 4321
#endif
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -37,52 +35,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -119,6 +74,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -254,7 +219,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -350,6 +315,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -385,6 +361,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/endian.h b/lib/libc/include/mips-linux-musl/bits/endian.h
deleted file mode 100644
index e888a1939f559d2e58684c14e938f8dea4a962fd..0000000000000000000000000000000000000000
--- a/lib/libc/include/mips-linux-musl/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if _MIPSEL || __MIPSEL || __MIPSEL__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/hwcap.h b/lib/libc/include/mips-linux-musl/bits/hwcap.h
index 0cc1faa9f77a1596dcbba04310760c3901611f86..bcdd936f16c81849cb4a8b1f93258ccbba60b250 100644
--- a/lib/libc/include/mips-linux-musl/bits/hwcap.h
+++ b/lib/libc/include/mips-linux-musl/bits/hwcap.h
@@ -1,3 +1,14 @@
#define HWCAP_MIPS_R6 (1 << 0)
#define HWCAP_MIPS_MSA (1 << 1)
-#define HWCAP_MIPS_CRC32 (1 << 2)
\ No newline at end of file
+#define HWCAP_MIPS_CRC32 (1 << 2)
+#define HWCAP_MIPS_MIPS16 (1 << 3)
+#define HWCAP_MIPS_MDMX (1 << 4)
+#define HWCAP_MIPS_MIPS3D (1 << 5)
+#define HWCAP_MIPS_SMARTMIPS (1 << 6)
+#define HWCAP_MIPS_DSP (1 << 7)
+#define HWCAP_MIPS_DSP2 (1 << 8)
+#define HWCAP_MIPS_DSP3 (1 << 9)
+#define HWCAP_MIPS_MIPS16E2 (1 << 10)
+#define HWCAP_LOONGSON_MMI (1 << 11)
+#define HWCAP_LOONGSON_EXT (1 << 12)
+#define HWCAP_LOONGSON_EXT2 (1 << 13)
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/ioctl.h b/lib/libc/include/mips-linux-musl/bits/ioctl.h
index ce20d2e760859b557f23e37cd91c009b211b2e35..c4fbd0d8dfa26f399852fd726df2c50ec00d49de 100644
--- a/lib/libc/include/mips-linux-musl/bits/ioctl.h
+++ b/lib/libc/include/mips-linux-musl/bits/ioctl.h
@@ -110,5 +110,5 @@
#define SIOCATMARK _IOR('s', 7, int)
#define SIOCSPGRP _IOW('s', 8, pid_t)
#define SIOCGPGRP _IOR('s', 9, pid_t)
-#define SIOCGSTAMP 0x8906
-#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/ipcstat.h b/lib/libc/include/mips-linux-musl/bits/ipcstat.h
new file mode 100644
index 0000000000000000000000000000000000000000..d055f3e83716e7d28975b2f1836b04e8714f793e
--- /dev/null
+++ b/lib/libc/include/mips-linux-musl/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/limits.h b/lib/libc/include/mips-linux-musl/bits/limits.h
deleted file mode 100644
index ba9c3aa003aea39ddb20eccc06cea142ec15de84..0000000000000000000000000000000000000000
--- a/lib/libc/include/mips-linux-musl/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/msg.h b/lib/libc/include/mips-linux-musl/bits/msg.h
index f310867d192bcbb664f4c174350c018af5762369..9e428cabd53e2fa8c105bae01ae615741cf7f91d 100644
--- a/lib/libc/include/mips-linux-musl/bits/msg.h
+++ b/lib/libc/include/mips-linux-musl/bits/msg.h
@@ -1,19 +1,19 @@
struct msqid_ds {
struct ipc_perm msg_perm;
#if _MIPSEL || __MIPSEL || __MIPSEL__
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
#else
- int __unused1;
- time_t msg_stime;
- int __unused2;
- time_t msg_rtime;
- int __unused3;
- time_t msg_ctime;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_ctime_hi;
+ unsigned long __msg_ctime_lo;
#endif
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
@@ -21,4 +21,7 @@ struct msqid_ds {
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/sem.h b/lib/libc/include/mips-linux-musl/bits/sem.h
new file mode 100644
index 0000000000000000000000000000000000000000..87b05d488d13c7b568c5b8f59ac5b62b5742f8b0
--- /dev/null
+++ b/lib/libc/include/mips-linux-musl/bits/sem.h
@@ -0,0 +1,16 @@
+struct semid_ds {
+ struct ipc_perm sem_perm;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_ctime_lo;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned short sem_nsems;
+ char __sem_nsems_pad[sizeof(long)-sizeof(short)];
+#else
+ char __sem_nsems_pad[sizeof(long)-sizeof(short)];
+ unsigned short sem_nsems;
+#endif
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_hi;
+ time_t sem_otime;
+ time_t sem_ctime;
+};
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/shm.h b/lib/libc/include/mips-linux-musl/bits/shm.h
new file mode 100644
index 0000000000000000000000000000000000000000..4e5357d24f3d60abab4d06f5bf482a932272abff
--- /dev/null
+++ b/lib/libc/include/mips-linux-musl/bits/shm.h
@@ -0,0 +1,29 @@
+#define SHMLBA 4096
+
+struct shmid_ds {
+ struct ipc_perm shm_perm;
+ size_t shm_segsz;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_ctime_lo;
+ pid_t shm_cpid;
+ pid_t shm_lpid;
+ unsigned long shm_nattch;
+ unsigned short __shm_atime_hi;
+ unsigned short __shm_dtime_hi;
+ unsigned short __shm_ctime_hi;
+ unsigned short __pad1;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
+};
+
+struct shminfo {
+ unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
+};
+
+struct shm_info {
+ int __used_ids;
+ unsigned long shm_tot, shm_rss, shm_swp;
+ unsigned long __swap_attempts, __swap_successes;
+};
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/signal.h b/lib/libc/include/mips-linux-musl/bits/signal.h
index 8a7d5852ed141264cfb950c300fdcaec3bf7bacb..f9a6ea657a41f6f15b7d07af6204a95f4132f81d 100644
--- a/lib/libc/include/mips-linux-musl/bits/signal.h
+++ b/lib/libc/include/mips-linux-musl/bits/signal.h
@@ -19,14 +19,18 @@ typedef struct {
} fpregset_t;
struct sigcontext {
unsigned sc_regmask, sc_status;
- unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
+ unsigned long long sc_pc;
+ gregset_t sc_regs;
+ fpregset_t sc_fpregs;
unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
unsigned long long sc_mdhi, sc_mdlo;
unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
};
typedef struct {
unsigned regmask, status;
- unsigned long long pc, gregs[32], fpregs[32];
+ unsigned long long pc;
+ gregset_t gregs;
+ fpregset_t fpregs;
unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
unsigned long long mdhi, mdlo;
unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
diff --git a/lib/libc/include/mips-linux-musl/bits/socket.h b/lib/libc/include/mips-linux-musl/bits/socket.h
index dd4c03b7f6e788370135ba401b066ecf8be22a37..751f71fc475d68b8132a422bc79a1541c66ae34d 100644
--- a/lib/libc/include/mips-linux-musl/bits/socket.h
+++ b/lib/libc/include/mips-linux-musl/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
-
#define SOCK_STREAM 2
#define SOCK_DGRAM 1
@@ -32,8 +16,6 @@ struct cmsghdr {
#define SO_RCVBUF 0x1002
#define SO_SNDLOWAT 0x1003
#define SO_RCVLOWAT 0x1004
-#define SO_RCVTIMEO 0x1006
-#define SO_SNDTIMEO 0x1005
#define SO_ERROR 0x1007
#define SO_TYPE 0x1008
#define SO_ACCEPTCONN 0x1009
diff --git a/lib/libc/include/mips-linux-musl/bits/stat.h b/lib/libc/include/mips-linux-musl/bits/stat.h
index 5e9d7ce475aed6cd502044184891ff07fb2fef94..f247f6983de595c9da9a615a39242383d015e3f5 100644
--- a/lib/libc/include/mips-linux-musl/bits/stat.h
+++ b/lib/libc/include/mips-linux-musl/bits/stat.h
@@ -12,11 +12,15 @@ struct stat {
dev_t st_rdev;
long __st_padding2[2];
off_t st_size;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
blksize_t st_blksize;
long __st_padding3;
blkcnt_t st_blocks;
- long __st_padding4[14];
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ long __st_padding4[2];
};
\ No newline at end of file
diff --git a/lib/libc/include/mips-linux-musl/bits/syscall.h b/lib/libc/include/mips-linux-musl/bits/syscall.h
index 67bd95fa5c78eb931329e01122bcc9627ff48ece..3f2666e56f6138d76a03018d1cb3a5e4f8bbf952 100644
--- a/lib/libc/include/mips-linux-musl/bits/syscall.h
+++ b/lib/libc/include/mips-linux-musl/bits/syscall.h
@@ -76,8 +76,8 @@
#define __NR_setrlimit 4075
#define __NR_getrlimit 4076
#define __NR_getrusage 4077
-#define __NR_gettimeofday 4078
-#define __NR_settimeofday 4079
+#define __NR_gettimeofday_time32 4078
+#define __NR_settimeofday_time32 4079
#define __NR_getgroups 4080
#define __NR_setgroups 4081
#define __NR_reserved82 4082
@@ -256,14 +256,14 @@
#define __NR_statfs64 4255
#define __NR_fstatfs64 4256
#define __NR_timer_create 4257
-#define __NR_timer_settime 4258
-#define __NR_timer_gettime 4259
+#define __NR_timer_settime32 4258
+#define __NR_timer_gettime32 4259
#define __NR_timer_getoverrun 4260
#define __NR_timer_delete 4261
-#define __NR_clock_settime 4262
-#define __NR_clock_gettime 4263
-#define __NR_clock_getres 4264
-#define __NR_clock_nanosleep 4265
+#define __NR_clock_settime32 4262
+#define __NR_clock_gettime32 4263
+#define __NR_clock_getres_time32 4264
+#define __NR_clock_nanosleep_time32 4265
#define __NR_tgkill 4266
#define __NR_utimes 4267
#define __NR_mbind 4268
@@ -319,8 +319,8 @@
#define __NR_eventfd 4319
#define __NR_fallocate 4320
#define __NR_timerfd_create 4321
-#define __NR_timerfd_gettime 4322
-#define __NR_timerfd_settime 4323
+#define __NR_timerfd_gettime32 4322
+#define __NR_timerfd_settime32 4323
#define __NR_signalfd4 4324
#define __NR_eventfd2 4325
#define __NR_epoll_create1 4326
@@ -406,6 +406,8 @@
#define __NR_fsconfig 4431
#define __NR_fsmount 4432
#define __NR_fspick 4433
+#define __NR_pidfd_open 4434
+#define __NR_clone3 4435
#define SYS_syscall 4000
#define SYS_exit 4001
@@ -485,8 +487,8 @@
#define SYS_setrlimit 4075
#define SYS_getrlimit 4076
#define SYS_getrusage 4077
-#define SYS_gettimeofday 4078
-#define SYS_settimeofday 4079
+#define SYS_gettimeofday_time32 4078
+#define SYS_settimeofday_time32 4079
#define SYS_getgroups 4080
#define SYS_setgroups 4081
#define SYS_reserved82 4082
@@ -665,14 +667,14 @@
#define SYS_statfs64 4255
#define SYS_fstatfs64 4256
#define SYS_timer_create 4257
-#define SYS_timer_settime 4258
-#define SYS_timer_gettime 4259
+#define SYS_timer_settime32 4258
+#define SYS_timer_gettime32 4259
#define SYS_timer_getoverrun 4260
#define SYS_timer_delete 4261
-#define SYS_clock_settime 4262
-#define SYS_clock_gettime 4263
-#define SYS_clock_getres 4264
-#define SYS_clock_nanosleep 4265
+#define SYS_clock_settime32 4262
+#define SYS_clock_gettime32 4263
+#define SYS_clock_getres_time32 4264
+#define SYS_clock_nanosleep_time32 4265
#define SYS_tgkill 4266
#define SYS_utimes 4267
#define SYS_mbind 4268
@@ -728,8 +730,8 @@
#define SYS_eventfd 4319
#define SYS_fallocate 4320
#define SYS_timerfd_create 4321
-#define SYS_timerfd_gettime 4322
-#define SYS_timerfd_settime 4323
+#define SYS_timerfd_gettime32 4322
+#define SYS_timerfd_settime32 4323
#define SYS_signalfd4 4324
#define SYS_eventfd2 4325
#define SYS_epoll_create1 4326
@@ -814,4 +816,6 @@
#define SYS_fsopen 4430
#define SYS_fsconfig 4431
#define SYS_fsmount 4432
-#define SYS_fspick 4433
\ No newline at end of file
+#define SYS_fspick 4433
+#define SYS_pidfd_open 4434
+#define SYS_clone3 4435
\ No newline at end of file
diff --git a/lib/libc/include/mips64-linux-musl/bits/alltypes.h b/lib/libc/include/mips64-linux-musl/bits/alltypes.h
index 2078964487f3c70f41ac8f61b52935d2da428745..9745553d1671a4bd140f8a0f680d869fc5cdb211 100644
--- a/lib/libc/include/mips64-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/mips64-linux-musl/bits/alltypes.h
@@ -2,16 +2,13 @@
#define _Int64 long
#define _Reg long
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
+#if _MIPSEL || __MIPSEL || __MIPSEL__
+#define __BYTE_ORDER 1234
+#else
+#define __BYTE_ORDER 4321
#endif
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -38,57 +35,14 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#endif
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned nlink_t;
#define __DEFINED_nlink_t
#endif
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -125,6 +79,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -260,7 +224,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -356,6 +320,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -391,6 +366,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/mips64-linux-musl/bits/endian.h b/lib/libc/include/mips64-linux-musl/bits/endian.h
deleted file mode 100644
index e888a1939f559d2e58684c14e938f8dea4a962fd..0000000000000000000000000000000000000000
--- a/lib/libc/include/mips64-linux-musl/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if _MIPSEL || __MIPSEL || __MIPSEL__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/mips64-linux-musl/bits/limits.h b/lib/libc/include/mips64-linux-musl/bits/limits.h
deleted file mode 100644
index ac11a8d7bf616d40717cfe0ccc0849e442b3c64d..0000000000000000000000000000000000000000
--- a/lib/libc/include/mips64-linux-musl/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
diff --git a/lib/libc/include/mips64-linux-musl/bits/socket.h b/lib/libc/include/mips64-linux-musl/bits/socket.h
index 87d555b12d1340ecae980a9e4a22a17e677f84b9..4207084528add35103ae62ae84c93341bc01d319 100644
--- a/lib/libc/include/mips64-linux-musl/bits/socket.h
+++ b/lib/libc/include/mips64-linux-musl/bits/socket.h
@@ -1,37 +1,3 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1, msg_iovlen;
-#else
- int msg_iovlen, __pad1;
-#endif
- void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad2;
- socklen_t msg_controllen;
-#else
- socklen_t msg_controllen;
- int __pad2;
-#endif
- int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1;
- socklen_t cmsg_len;
-#else
- socklen_t cmsg_len;
- int __pad1;
-#endif
- int cmsg_level;
- int cmsg_type;
-};
-
#define SOCK_STREAM 2
#define SOCK_DGRAM 1
#define SOL_SOCKET 65535
diff --git a/lib/libc/include/mips64-linux-musl/bits/syscall.h b/lib/libc/include/mips64-linux-musl/bits/syscall.h
index e14881035bda3b57217a9cfce9033e5307b36453..b3d86fe1d838bfb768fcc5c4c477c2ff468fba79 100644
--- a/lib/libc/include/mips64-linux-musl/bits/syscall.h
+++ b/lib/libc/include/mips64-linux-musl/bits/syscall.h
@@ -336,6 +336,8 @@
#define __NR_fsconfig 5431
#define __NR_fsmount 5432
#define __NR_fspick 5433
+#define __NR_pidfd_open 5434
+#define __NR_clone3 5435
#define SYS_read 5000
#define SYS_write 5001
@@ -674,4 +676,6 @@
#define SYS_fsopen 5430
#define SYS_fsconfig 5431
#define SYS_fsmount 5432
-#define SYS_fspick 5433
\ No newline at end of file
+#define SYS_fspick 5433
+#define SYS_pidfd_open 5434
+#define SYS_clone3 5435
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/alltypes.h b/lib/libc/include/powerpc-linux-musl/bits/alltypes.h
index f94f3e2f448a60ac270b946171e0bb296274f439..f655b43e3ddce0fe12df528ebb18cbe4ce7669cd 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/alltypes.h
@@ -1,17 +1,10 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
-#endif
-
+#define __BYTE_ORDER 4321
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#ifdef __WCHAR_TYPE__
@@ -45,52 +38,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -127,6 +77,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -262,7 +222,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -358,6 +318,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -393,6 +364,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/endian.h b/lib/libc/include/powerpc-linux-musl/bits/endian.h
deleted file mode 100644
index ca2af1ed577b135232fc013836d070d18354f3fc..0000000000000000000000000000000000000000
--- a/lib/libc/include/powerpc-linux-musl/bits/endian.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifdef __BIG_ENDIAN__
- #if __BIG_ENDIAN__
- #define __BYTE_ORDER __BIG_ENDIAN
- #endif
-#endif /* __BIG_ENDIAN__ */
-
-#ifdef __LITTLE_ENDIAN__
- #if __LITTLE_ENDIAN__
- #define __BYTE_ORDER __LITTLE_ENDIAN
- #endif
-#endif /* __LITTLE_ENDIAN__ */
-
-#ifndef __BYTE_ORDER
- #define __BYTE_ORDER __BIG_ENDIAN
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/ioctl.h b/lib/libc/include/powerpc-linux-musl/bits/ioctl.h
index 98eff9a7d502534fe14b23986c93fed9a888b22c..bce4b193204688816f96d6aeb7a5b80d9e294b76 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/ioctl.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/ioctl.h
@@ -116,5 +116,5 @@
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
-#define SIOCGSTAMP 0x8906
-#define SIOCGSTAMPNS 0x8907
\ No newline at end of file
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/ipcstat.h b/lib/libc/include/powerpc-linux-musl/bits/ipcstat.h
new file mode 100644
index 0000000000000000000000000000000000000000..d055f3e83716e7d28975b2f1836b04e8714f793e
--- /dev/null
+++ b/lib/libc/include/powerpc-linux-musl/bits/ipcstat.h
@@ -0,0 +1 @@
+#define IPC_STAT 0x102
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/limits.h b/lib/libc/include/powerpc-linux-musl/bits/limits.h
deleted file mode 100644
index ba9c3aa003aea39ddb20eccc06cea142ec15de84..0000000000000000000000000000000000000000
--- a/lib/libc/include/powerpc-linux-musl/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/msg.h b/lib/libc/include/powerpc-linux-musl/bits/msg.h
index 1bbca229c7fa5bfed72bf5f5b77bef6c2a017bec..9232e03800d56ec4525043cb166b7688c189c555 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/msg.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- int __unused1;
- time_t msg_stime;
- int __unused2;
- time_t msg_rtime;
- int __unused3;
- time_t msg_ctime;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_ctime_hi;
+ unsigned long __msg_ctime_lo;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/sem.h b/lib/libc/include/powerpc-linux-musl/bits/sem.h
index fefd211aa9eba35ed5b6fd2fbe2cd114a7413ec6..715a0ac85c3bdaf210ad15f44869f21c1a523e0b 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/sem.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/sem.h
@@ -1,10 +1,12 @@
struct semid_ds {
struct ipc_perm sem_perm;
- int __unused1;
- time_t sem_otime;
- int __unused2;
- time_t sem_ctime;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_ctime_hi;
+ unsigned long __sem_ctime_lo;
unsigned short __sem_nsems_pad, sem_nsems;
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/shm.h b/lib/libc/include/powerpc-linux-musl/bits/shm.h
index ef46d7f1010a90b1910c483689beb2cf8c5c9598..e45c2ab19a700dddbd09d3a09907319bc66749e0 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/shm.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/shm.h
@@ -2,19 +2,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
- int __unused1;
- time_t shm_atime;
- int __unused2;
- time_t shm_dtime;
- int __unused3;
- time_t shm_ctime;
- int __unused4;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_ctime_hi;
+ unsigned long __shm_ctime_lo;
size_t shm_segsz;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/include/powerpc-linux-musl/bits/signal.h b/lib/libc/include/powerpc-linux-musl/bits/signal.h
index 12e00013168ea0bbb6330d358c2dbf58aea31908..48051afb6332c6d5465de62812b0aeb24fdaa53d 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/signal.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/signal.h
@@ -28,7 +28,7 @@ struct sigcontext {
int signal;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
};
typedef struct {
diff --git a/lib/libc/include/powerpc-linux-musl/bits/socket.h b/lib/libc/include/powerpc-linux-musl/bits/socket.h
index ba5e2b50d2c30979d51f99473c0cbf614d023cbf..4225b9177925668f11a7071055d3e382315bee39 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/socket.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
-
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
@@ -31,8 +15,6 @@ struct cmsghdr {
#define SO_REUSEPORT 15
#define SO_RCVLOWAT 16
#define SO_SNDLOWAT 17
-#define SO_RCVTIMEO 18
-#define SO_SNDTIMEO 19
#define SO_PASSCRED 20
#define SO_PEERCRED 21
#define SO_ACCEPTCONN 30
diff --git a/lib/libc/include/powerpc-linux-musl/bits/stat.h b/lib/libc/include/powerpc-linux-musl/bits/stat.h
index e5298772daca95f03ec78c9261f9dfc68d10eb61..fa6d8dfdb8b09a20b5e7f57268f4ee91a2744403 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/stat.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/stat.h
@@ -13,8 +13,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ unsigned __unused[2];
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- unsigned __unused[2];
};
\ No newline at end of file
diff --git a/lib/libc/include/powerpc-linux-musl/bits/syscall.h b/lib/libc/include/powerpc-linux-musl/bits/syscall.h
index 888868ad5c4d47d931e6f0ccd6eb923538d04f0a..ce2818352c6deb4ca216939aa978ae1333217587 100644
--- a/lib/libc/include/powerpc-linux-musl/bits/syscall.h
+++ b/lib/libc/include/powerpc-linux-musl/bits/syscall.h
@@ -76,8 +76,8 @@
#define __NR_setrlimit 75
#define __NR_getrlimit 76
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
@@ -238,14 +238,14 @@
#define __NR_epoll_wait 238
#define __NR_remap_file_pages 239
#define __NR_timer_create 240
-#define __NR_timer_settime 241
-#define __NR_timer_gettime 242
+#define __NR_timer_settime32 241
+#define __NR_timer_gettime32 242
#define __NR_timer_getoverrun 243
#define __NR_timer_delete 244
-#define __NR_clock_settime 245
-#define __NR_clock_gettime 246
-#define __NR_clock_getres 247
-#define __NR_clock_nanosleep 248
+#define __NR_clock_settime32 245
+#define __NR_clock_gettime32 246
+#define __NR_clock_getres_time32 247
+#define __NR_clock_nanosleep_time32 248
#define __NR_swapcontext 249
#define __NR_tgkill 250
#define __NR_utimes 251
@@ -307,8 +307,8 @@
#define __NR_sync_file_range2 308
#define __NR_fallocate 309
#define __NR_subpage_prot 310
-#define __NR_timerfd_settime 311
-#define __NR_timerfd_gettime 312
+#define __NR_timerfd_settime32 311
+#define __NR_timerfd_gettime32 312
#define __NR_signalfd4 313
#define __NR_eventfd2 314
#define __NR_epoll_create1 315
@@ -413,6 +413,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define SYS_restart_syscall 0
#define SYS_exit 1
@@ -492,8 +494,8 @@
#define SYS_setrlimit 75
#define SYS_getrlimit 76
#define SYS_getrusage 77
-#define SYS_gettimeofday 78
-#define SYS_settimeofday 79
+#define SYS_gettimeofday_time32 78
+#define SYS_settimeofday_time32 79
#define SYS_getgroups 80
#define SYS_setgroups 81
#define SYS_select 82
@@ -654,14 +656,14 @@
#define SYS_epoll_wait 238
#define SYS_remap_file_pages 239
#define SYS_timer_create 240
-#define SYS_timer_settime 241
-#define SYS_timer_gettime 242
+#define SYS_timer_settime32 241
+#define SYS_timer_gettime32 242
#define SYS_timer_getoverrun 243
#define SYS_timer_delete 244
-#define SYS_clock_settime 245
-#define SYS_clock_gettime 246
-#define SYS_clock_getres 247
-#define SYS_clock_nanosleep 248
+#define SYS_clock_settime32 245
+#define SYS_clock_gettime32 246
+#define SYS_clock_getres_time32 247
+#define SYS_clock_nanosleep_time32 248
#define SYS_swapcontext 249
#define SYS_tgkill 250
#define SYS_utimes 251
@@ -723,8 +725,8 @@
#define SYS_sync_file_range2 308
#define SYS_fallocate 309
#define SYS_subpage_prot 310
-#define SYS_timerfd_settime 311
-#define SYS_timerfd_gettime 312
+#define SYS_timerfd_settime32 311
+#define SYS_timerfd_gettime32 312
#define SYS_signalfd4 313
#define SYS_eventfd2 314
#define SYS_epoll_create1 315
@@ -828,4 +830,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/include/powerpc64-linux-musl/bits/alltypes.h b/lib/libc/include/powerpc64-linux-musl/bits/alltypes.h
index b650fe8f9a1f7efbadf8167e63e8222911d91fd1..6177874ffa5f0340531b72ba43c91f67bd51e290 100644
--- a/lib/libc/include/powerpc64-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/powerpc64-linux-musl/bits/alltypes.h
@@ -2,16 +2,13 @@
#define _Int64 long
#define _Reg long
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
+#if __BIG_ENDIAN__
+#define __BYTE_ORDER 4321
+#else
+#define __BYTE_ORDER 1234
#endif
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -37,52 +34,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -119,6 +73,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -254,7 +218,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -350,6 +314,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -385,6 +360,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/powerpc64-linux-musl/bits/endian.h b/lib/libc/include/powerpc64-linux-musl/bits/endian.h
deleted file mode 100644
index 4f3a41f0c199caa54eb6809a3692514569a7d914..0000000000000000000000000000000000000000
--- a/lib/libc/include/powerpc64-linux-musl/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __BIG_ENDIAN__
-#define __BYTE_ORDER __BIG_ENDIAN
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/powerpc64-linux-musl/bits/signal.h b/lib/libc/include/powerpc64-linux-musl/bits/signal.h
index c312b0d4590a946a89523f17ea5a3f4307024d1b..de82cf9ec77037e82fe86e1a894ba3b1f17b4267 100644
--- a/lib/libc/include/powerpc64-linux-musl/bits/signal.h
+++ b/lib/libc/include/powerpc64-linux-musl/bits/signal.h
@@ -9,11 +9,7 @@
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned long greg_t, gregset_t[48];
-
-typedef struct {
- double fpregs[32];
- double fpscr;
-} fpregset_t;
+typedef double fpregset_t[33];
typedef struct {
#ifdef __GNUC__
@@ -36,7 +32,7 @@ typedef struct sigcontext {
int _pad0;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
gregset_t gp_regs;
fpregset_t fp_regs;
vrregset_t *v_regs;
diff --git a/lib/libc/include/powerpc64-linux-musl/bits/socket.h b/lib/libc/include/powerpc64-linux-musl/bits/socket.h
index d453d65ce4a05434714ed21fb17c55d73bba9a32..1fa551d93e3c8dc05cbe6c0382d4d519acac93df 100644
--- a/lib/libc/include/powerpc64-linux-musl/bits/socket.h
+++ b/lib/libc/include/powerpc64-linux-musl/bits/socket.h
@@ -1,37 +1,3 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1, msg_iovlen;
-#else
- int msg_iovlen, __pad1;
-#endif
- void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad2;
- socklen_t msg_controllen;
-#else
- socklen_t msg_controllen;
- int __pad2;
-#endif
- int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1;
- socklen_t cmsg_len;
-#else
- socklen_t cmsg_len;
- int __pad1;
-#endif
- int cmsg_level;
- int cmsg_type;
-};
-
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
diff --git a/lib/libc/include/powerpc64-linux-musl/bits/syscall.h b/lib/libc/include/powerpc64-linux-musl/bits/syscall.h
index 38b8263144a80fa0a20c97757b66b2d9b823905f..4592aac64db178d8c26915c52754461746f55130 100644
--- a/lib/libc/include/powerpc64-linux-musl/bits/syscall.h
+++ b/lib/libc/include/powerpc64-linux-musl/bits/syscall.h
@@ -385,6 +385,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define SYS_restart_syscall 0
#define SYS_exit 1
@@ -772,4 +774,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/include/riscv64-linux-musl/bits/alltypes.h b/lib/libc/include/riscv64-linux-musl/bits/alltypes.h
index c326d32774a904616a9cbbf649bcf84206a916d0..8db53c82938482111d07d463ef63c8e4b6048194 100644
--- a/lib/libc/include/riscv64-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/riscv64-linux-musl/bits/alltypes.h
@@ -2,16 +2,8 @@
#define _Int64 long
#define _Reg long
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
-#endif
-
+#define __BYTE_ORDER 1234
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -48,52 +40,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -130,6 +79,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -265,7 +224,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -361,6 +320,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -396,6 +366,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/riscv64-linux-musl/bits/reg.h b/lib/libc/include/riscv64-linux-musl/bits/reg.h
deleted file mode 100644
index b449472ae91ff047c331d97a8d893d0802753d29..0000000000000000000000000000000000000000
--- a/lib/libc/include/riscv64-linux-musl/bits/reg.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#undef __WORDSIZE
-#define __WORDSIZE 64
-#define REG_PC 0
-#define REG_RA 1
-#define REG_SP 2
-#define REG_TP 4
-#define REG_S0 8
-#define REG_A0 10
\ No newline at end of file
diff --git a/lib/libc/include/riscv64-linux-musl/bits/signal.h b/lib/libc/include/riscv64-linux-musl/bits/signal.h
index 5eddfd18bc98a267216e137865bbf164eae45150..87ae2ee7d1b8bc93c54b1060ef5d67903b3263d0 100644
--- a/lib/libc/include/riscv64-linux-musl/bits/signal.h
+++ b/lib/libc/include/riscv64-linux-musl/bits/signal.h
@@ -35,6 +35,15 @@ typedef struct mcontext_t {
union __riscv_mc_fp_state __fpregs;
} mcontext_t;
+#if defined(_GNU_SOURCE)
+#define REG_PC 0
+#define REG_RA 1
+#define REG_SP 2
+#define REG_TP 4
+#define REG_S0 8
+#define REG_A0 10
+#endif
+
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned long greg_t;
typedef unsigned long gregset_t[32];
diff --git a/lib/libc/include/riscv64-linux-musl/bits/socket.h b/lib/libc/include/riscv64-linux-musl/bits/socket.h
deleted file mode 100644
index dfedbe836f02d690e89a502b2d80aa4bf0c153d4..0000000000000000000000000000000000000000
--- a/lib/libc/include/riscv64-linux-musl/bits/socket.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen, __pad1;
- void *msg_control;
- socklen_t msg_controllen;
- int __pad2;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int __pad1;
- int cmsg_level;
- int cmsg_type;
-};
\ No newline at end of file
diff --git a/lib/libc/include/riscv64-linux-musl/bits/syscall.h b/lib/libc/include/riscv64-linux-musl/bits/syscall.h
index 423de02ab13da2e568ef2882b1ed987f0e4f81e9..808207fb4b4472270d29ebd8680b86a63eee8e43 100644
--- a/lib/libc/include/riscv64-linux-musl/bits/syscall.h
+++ b/lib/libc/include/riscv64-linux-musl/bits/syscall.h
@@ -287,6 +287,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define __NR_sysriscv __NR_arch_specific_syscall
#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
@@ -579,5 +581,7 @@
#define SYS_fsconfig 431
#define SYS_fsmount 432
#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
#define SYS_sysriscv __NR_arch_specific_syscall
#define SYS_riscv_flush_icache (__NR_sysriscv + 15)
\ No newline at end of file
diff --git a/lib/libc/include/s390x-linux-musl/bits/alltypes.h b/lib/libc/include/s390x-linux-musl/bits/alltypes.h
index e831219e08e3350a4a1187e9c7fbc5f6754ef5c8..55dbfa500cfe81f41eb9dcdf6cca67faf26d2a4d 100644
--- a/lib/libc/include/s390x-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/s390x-linux-musl/bits/alltypes.h
@@ -2,16 +2,8 @@
#define _Int64 long
#define _Reg long
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
-#endif
-
+#define __BYTE_ORDER 4321
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -37,52 +29,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -119,6 +68,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -254,7 +213,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -350,6 +309,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -385,6 +355,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/s390x-linux-musl/bits/endian.h b/lib/libc/include/s390x-linux-musl/bits/endian.h
deleted file mode 100644
index 19063e7423a14c881e033008f6d9e4d25068407b..0000000000000000000000000000000000000000
--- a/lib/libc/include/s390x-linux-musl/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __BIG_ENDIAN
\ No newline at end of file
diff --git a/lib/libc/include/s390x-linux-musl/bits/limits.h b/lib/libc/include/s390x-linux-musl/bits/limits.h
index e984295854e013fc250a8c8b81bce9731e458843..fc11433d980df7405e8995f67023006f0f5b85c6 100644
--- a/lib/libc/include/s390x-linux-musl/bits/limits.h
+++ b/lib/libc/include/s390x-linux-musl/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define PAGESIZE 4096
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
+#define PAGESIZE 4096
\ No newline at end of file
diff --git a/lib/libc/include/s390x-linux-musl/bits/socket.h b/lib/libc/include/s390x-linux-musl/bits/socket.h
deleted file mode 100644
index decce207336b7a45b438793938f3c9b5bf409ddb..0000000000000000000000000000000000000000
--- a/lib/libc/include/s390x-linux-musl/bits/socket.h
+++ /dev/null
@@ -1,17 +0,0 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int __pad1, msg_iovlen;
- void *msg_control;
- int __pad2;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- int __pad1;
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
\ No newline at end of file
diff --git a/lib/libc/include/s390x-linux-musl/bits/syscall.h b/lib/libc/include/s390x-linux-musl/bits/syscall.h
index e2436d95c8f4756634ab5924e129e9a16945f961..790f5137362634e46e3ca499810f69a5d5424c7c 100644
--- a/lib/libc/include/s390x-linux-musl/bits/syscall.h
+++ b/lib/libc/include/s390x-linux-musl/bits/syscall.h
@@ -350,6 +350,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define SYS_exit 1
#define SYS_fork 2
@@ -702,4 +704,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-linux-musl/bits/alltypes.h b/lib/libc/include/x86_64-linux-musl/bits/alltypes.h
index ec6a904f5884e06687b7580401c5e37416a9f6ad..7418a4823444d8c3f97d0fe5d556cbabaf6f6689 100644
--- a/lib/libc/include/x86_64-linux-musl/bits/alltypes.h
+++ b/lib/libc/include/x86_64-linux-musl/bits/alltypes.h
@@ -2,16 +2,8 @@
#define _Int64 long
#define _Reg long
-#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
-typedef __builtin_va_list va_list;
-#define __DEFINED_va_list
-#endif
-
-#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
-typedef __builtin_va_list __isoc_va_list;
-#define __DEFINED___isoc_va_list
-#endif
-
+#define __BYTE_ORDER 1234
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
@@ -50,52 +42,9 @@ typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
-
-#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
-typedef long time_t;
-#define __DEFINED_time_t
-#endif
-
-#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
-typedef long suseconds_t;
-#define __DEFINED_suseconds_t
-#endif
-
-
-#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-#define __DEFINED_pthread_attr_t
-#endif
-
-#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-#define __DEFINED_pthread_mutex_t
-#endif
-
-#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
-typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-#define __DEFINED_mtx_t
-#endif
-
-#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-#define __DEFINED_pthread_cond_t
-#endif
-
-#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
-typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-#define __DEFINED_cnd_t
-#endif
-
-#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
-typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-#define __DEFINED_pthread_rwlock_t
-#endif
-
-#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
-typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
-#define __DEFINED_pthread_barrier_t
-#endif
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
@@ -132,6 +81,16 @@ typedef _Reg register_t;
#define __DEFINED_register_t
#endif
+#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
+typedef _Int64 time_t;
+#define __DEFINED_time_t
+#endif
+
+#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
+typedef _Int64 suseconds_t;
+#define __DEFINED_suseconds_t
+#endif
+
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
@@ -267,7 +226,7 @@ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#endif
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
-struct timespec { time_t tv_sec; long tv_nsec; };
+struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
#define __DEFINED_struct_timespec
#endif
@@ -363,6 +322,17 @@ typedef struct _IO_FILE FILE;
#endif
+#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
+typedef __builtin_va_list va_list;
+#define __DEFINED_va_list
+#endif
+
+#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
+typedef __builtin_va_list __isoc_va_list;
+#define __DEFINED___isoc_va_list
+#endif
+
+
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
@@ -398,6 +368,42 @@ typedef unsigned short sa_family_t;
#endif
+#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
+typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+#define __DEFINED_pthread_attr_t
+#endif
+
+#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+#define __DEFINED_pthread_mutex_t
+#endif
+
+#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
+typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+#define __DEFINED_mtx_t
+#endif
+
+#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+#define __DEFINED_pthread_cond_t
+#endif
+
+#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
+typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+#define __DEFINED_cnd_t
+#endif
+
+#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
+typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+#define __DEFINED_pthread_rwlock_t
+#endif
+
+#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
+typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+#define __DEFINED_pthread_barrier_t
+#endif
+
+
#undef _Addr
#undef _Int64
#undef _Reg
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-linux-musl/bits/limits.h b/lib/libc/include/x86_64-linux-musl/bits/limits.h
index e984295854e013fc250a8c8b81bce9731e458843..fc11433d980df7405e8995f67023006f0f5b85c6 100644
--- a/lib/libc/include/x86_64-linux-musl/bits/limits.h
+++ b/lib/libc/include/x86_64-linux-musl/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define PAGESIZE 4096
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
\ No newline at end of file
+#define PAGESIZE 4096
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-linux-musl/bits/socket.h b/lib/libc/include/x86_64-linux-musl/bits/socket.h
deleted file mode 100644
index 0372d7dd0e4dc85342eeb42a7424edf6abc7d371..0000000000000000000000000000000000000000
--- a/lib/libc/include/x86_64-linux-musl/bits/socket.h
+++ /dev/null
@@ -1,16 +0,0 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen, __pad1;
- void *msg_control;
- socklen_t msg_controllen, __pad2;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int __pad1;
- int cmsg_level;
- int cmsg_type;
-};
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-linux-musl/bits/syscall.h b/lib/libc/include/x86_64-linux-musl/bits/syscall.h
index fed8f0384ee172f01780de03f88185514c5b344c..e4dbe4b061aadd4234e74190b5ac7c1bd39bd3ad 100644
--- a/lib/libc/include/x86_64-linux-musl/bits/syscall.h
+++ b/lib/libc/include/x86_64-linux-musl/bits/syscall.h
@@ -343,6 +343,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define SYS_read 0
#define SYS_write 1
@@ -688,4 +690,6 @@
#define SYS_fsopen 430
#define SYS_fsconfig 431
#define SYS_fsmount 432
-#define SYS_fspick 433
\ No newline at end of file
+#define SYS_fspick 433
+#define SYS_pidfd_open 434
+#define SYS_clone3 435
\ No newline at end of file
diff --git a/lib/libc/musl/COPYRIGHT b/lib/libc/musl/COPYRIGHT
index 67802d11907fdd3ff5dc04cf3e3b4bc435e8a223..e6472371462f7ce7c23a2d477dbb14445aecbf77 100644
--- a/lib/libc/musl/COPYRIGHT
+++ b/lib/libc/musl/COPYRIGHT
@@ -1,7 +1,7 @@
musl as a whole is licensed under the following standard MIT license:
----------------------------------------------------------------------
-Copyright © 2005-2019 Rich Felker, et al.
+Copyright © 2005-2020 Rich Felker, et al.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -26,6 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Authors/contributors include:
A. Wilcox
+Ada Worcester
Alex Dowad
Alex Suykov
Alexander Monakov
@@ -65,7 +66,6 @@ Jeremy Huntwork
Jo-Philipp Wich
Joakim Sindholt
John Spencer
-Josiah Worcester
Julien Ramseier
Justin Cormack
Kaarle Ritvanen
diff --git a/lib/libc/musl/arch/aarch64/bits/alltypes.h.in b/lib/libc/musl/arch/aarch64/bits/alltypes.h.in
index d56abdac96732253ad6d65961bc7fb3194d55f8c..c547ca0b72a3fc2a1a77a30997e66a2d597b73ee 100644
--- a/lib/libc/musl/arch/aarch64/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/aarch64/bits/alltypes.h.in
@@ -2,8 +2,13 @@
#define _Int64 long
#define _Reg long
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#if __AARCH64EB__
+#define __BYTE_ORDER 4321
+#else
+#define __BYTE_ORDER 1234
+#endif
+
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF unsigned wchar_t;
@@ -17,14 +22,3 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/aarch64/bits/endian.h b/lib/libc/musl/arch/aarch64/bits/endian.h
deleted file mode 100644
index 7a74d2febceedd63d37e6877758adcf757801b0f..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/aarch64/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __AARCH64EB__
-#define __BYTE_ORDER __BIG_ENDIAN
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
diff --git a/lib/libc/musl/arch/aarch64/bits/limits.h b/lib/libc/musl/arch/aarch64/bits/limits.h
deleted file mode 100644
index 0226588c3df9730c5eebcf6dad106f6202237978..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/aarch64/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/aarch64/bits/socket.h b/lib/libc/musl/arch/aarch64/bits/socket.h
deleted file mode 100644
index c11677e9d0d2c212bdad66ebc82332162eef1592..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/aarch64/bits/socket.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1, msg_iovlen;
-#else
- int msg_iovlen, __pad1;
-#endif
- void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad2;
- socklen_t msg_controllen;
-#else
- socklen_t msg_controllen;
- int __pad2;
-#endif
- int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1;
- socklen_t cmsg_len;
-#else
- socklen_t cmsg_len;
- int __pad1;
-#endif
- int cmsg_level;
- int cmsg_type;
-};
diff --git a/lib/libc/musl/arch/aarch64/bits/syscall.h.in b/lib/libc/musl/arch/aarch64/bits/syscall.h.in
index 955e2cabada6ae1384f98c61a4957116b4abce1c..93648afdfee636733f4b92a8c482c4d74b6a4278 100644
--- a/lib/libc/musl/arch/aarch64/bits/syscall.h.in
+++ b/lib/libc/musl/arch/aarch64/bits/syscall.h.in
@@ -287,4 +287,6 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
diff --git a/lib/libc/musl/arch/aarch64/reloc.h b/lib/libc/musl/arch/aarch64/reloc.h
index 40cf0b2891660dca6b6b51e03b096113941bd7cd..b1b68c7255ffbcf2049993800a4ff43ed30d7991 100644
--- a/lib/libc/musl/arch/aarch64/reloc.h
+++ b/lib/libc/musl/arch/aarch64/reloc.h
@@ -1,5 +1,3 @@
-#include
-
#if __BYTE_ORDER == __BIG_ENDIAN
#define ENDIAN_SUFFIX "_be"
#else
diff --git a/lib/libc/musl/arch/arm/bits/alltypes.h.in b/lib/libc/musl/arch/arm/bits/alltypes.h.in
index 667963c7e101148f7c0600e182f8be17482184cc..d62bd7bde666531941e4c44d2d4aa8cebc792bcf 100644
--- a/lib/libc/musl/arch/arm/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/arm/bits/alltypes.h.in
@@ -1,9 +1,15 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#if __ARMEB__
+#define __BYTE_ORDER 4321
+#else
+#define __BYTE_ORDER 1234
+#endif
+
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
TYPEDEF unsigned wchar_t;
@@ -13,14 +19,3 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/arm/bits/endian.h b/lib/libc/musl/arch/arm/bits/endian.h
deleted file mode 100644
index 5953724a0b69603238653b75cccfc2686c3ccb96..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/arm/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __ARMEB__
-#define __BYTE_ORDER __BIG_ENDIAN
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
diff --git a/lib/libc/musl/arch/arm/bits/ipcstat.h b/lib/libc/musl/arch/arm/bits/ipcstat.h
index 0018ad1e20f62a4bb426908c9397ee1253954cd5..4f4fcb0c5b74d7142e781f232b7615f9c86ef2ce 100644
--- a/lib/libc/musl/arch/arm/bits/ipcstat.h
+++ b/lib/libc/musl/arch/arm/bits/ipcstat.h
@@ -1 +1 @@
-#define IPC_STAT 2
+#define IPC_STAT 0x102
diff --git a/lib/libc/musl/arch/arm/bits/limits.h b/lib/libc/musl/arch/arm/bits/limits.h
deleted file mode 100644
index fbc6d238dc89b91dbe94af93ea60e862c67ac154..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/arm/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/arm/bits/msg.h b/lib/libc/musl/arch/arm/bits/msg.h
index bc8436c4ad26797d69e762b701aa906b9bed1271..7bbbb2bf43bebae1ec8fe785d38c5bbba0e77cfe 100644
--- a/lib/libc/musl/arch/arm/bits/msg.h
+++ b/lib/libc/musl/arch/arm/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
diff --git a/lib/libc/musl/arch/arm/bits/sem.h b/lib/libc/musl/arch/arm/bits/sem.h
index d383d4ea552d9a092e3960e36d1dc3f97feaecdd..544e3d2a522816553148b2d5d9dcfb86943baa8f 100644
--- a/lib/libc/musl/arch/arm/bits/sem.h
+++ b/lib/libc/musl/arch/arm/bits/sem.h
@@ -1,9 +1,9 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- long __unused1;
- time_t sem_ctime;
- long __unused2;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_lo;
+ unsigned long __sem_ctime_hi;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
@@ -13,4 +13,6 @@ struct semid_ds {
#endif
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/lib/libc/musl/arch/arm/bits/shm.h b/lib/libc/musl/arch/arm/bits/shm.h
index 81b2a29abb87642a2d1a56cf45ee932f16db1603..725fb46968a7eeeb67cd4ae31810de6e2fffa2b0 100644
--- a/lib/libc/musl/arch/arm/bits/shm.h
+++ b/lib/libc/musl/arch/arm/bits/shm.h
@@ -3,17 +3,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- int __unused1;
- time_t shm_dtime;
- int __unused2;
- time_t shm_ctime;
- int __unused3;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __shm_ctime_hi;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ unsigned long __pad3;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/musl/arch/arm/bits/stat.h b/lib/libc/musl/arch/arm/bits/stat.h
index 22b19bbfecf52c0b0158a2f84273c9bb7efd3d64..5d7828cf792baa9109d9868e2939ea9a5508f25c 100644
--- a/lib/libc/musl/arch/arm/bits/stat.h
+++ b/lib/libc/musl/arch/arm/bits/stat.h
@@ -14,8 +14,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ ino_t st_ino;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- ino_t st_ino;
};
diff --git a/lib/libc/musl/arch/arm/bits/syscall.h.in b/lib/libc/musl/arch/arm/bits/syscall.h.in
index a565a4ee1f0bf64111b7020925190d0965a92536..11d677635be39e7b05d7e387dff39b82869c278b 100644
--- a/lib/libc/musl/arch/arm/bits/syscall.h.in
+++ b/lib/libc/musl/arch/arm/bits/syscall.h.in
@@ -55,8 +55,8 @@
#define __NR_sethostname 74
#define __NR_setrlimit 75
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_symlink 83
@@ -211,14 +211,14 @@
#define __NR_remap_file_pages 253
#define __NR_set_tid_address 256
#define __NR_timer_create 257
-#define __NR_timer_settime 258
-#define __NR_timer_gettime 259
+#define __NR_timer_settime32 258
+#define __NR_timer_gettime32 259
#define __NR_timer_getoverrun 260
#define __NR_timer_delete 261
-#define __NR_clock_settime 262
-#define __NR_clock_gettime 263
-#define __NR_clock_getres 264
-#define __NR_clock_nanosleep 265
+#define __NR_clock_settime32 262
+#define __NR_clock_gettime32 263
+#define __NR_clock_getres_time32 264
+#define __NR_clock_nanosleep_time32 265
#define __NR_statfs64 266
#define __NR_fstatfs64 267
#define __NR_tgkill 268
@@ -308,8 +308,8 @@
#define __NR_timerfd_create 350
#define __NR_eventfd 351
#define __NR_fallocate 352
-#define __NR_timerfd_settime 353
-#define __NR_timerfd_gettime 354
+#define __NR_timerfd_settime32 353
+#define __NR_timerfd_gettime32 354
#define __NR_signalfd4 355
#define __NR_eventfd2 356
#define __NR_epoll_create1 357
@@ -387,6 +387,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define __ARM_NR_breakpoint 0x0f0001
#define __ARM_NR_cacheflush 0x0f0002
diff --git a/lib/libc/musl/arch/arm/reloc.h b/lib/libc/musl/arch/arm/reloc.h
index 2c2e7f58f968cd4478d980bde4a4e1a2da09f136..d091d2ad92fbf9e54a8c6b55f4f57c6ee6cee54d 100644
--- a/lib/libc/musl/arch/arm/reloc.h
+++ b/lib/libc/musl/arch/arm/reloc.h
@@ -1,5 +1,3 @@
-#include
-
#if __BYTE_ORDER == __BIG_ENDIAN
#define ENDIAN_SUFFIX "eb"
#else
diff --git a/lib/libc/musl/arch/arm/syscall_arch.h b/lib/libc/musl/arch/arm/syscall_arch.h
index 53fb155c0dcb7e94d3878f3a0634890003552bda..4b08762d7b35b056506d9532dcd538d142c20636 100644
--- a/lib/libc/musl/arch/arm/syscall_arch.h
+++ b/lib/libc/musl/arch/arm/syscall_arch.h
@@ -99,7 +99,9 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
}
#define VDSO_USEFUL
-#define VDSO_CGT_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_VER "LINUX_2.6"
+#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define SYSCALL_FADVISE_6_ARG
diff --git a/lib/libc/musl/arch/generic/bits/dirent.h b/lib/libc/musl/arch/generic/bits/dirent.h
new file mode 100644
index 0000000000000000000000000000000000000000..c845fe82dda20257d1bae78754bb110d7f7a2aa6
--- /dev/null
+++ b/lib/libc/musl/arch/generic/bits/dirent.h
@@ -0,0 +1,11 @@
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
+
+struct dirent {
+ ino_t d_ino;
+ off_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+};
diff --git a/lib/libc/musl/arch/generic/bits/ioctl.h b/lib/libc/musl/arch/generic/bits/ioctl.h
index d1a6c035f8323123dfac53d31211e36af2075250..60ae8b850b17b7ad5a658967e6d595188f63eba2 100644
--- a/lib/libc/musl/arch/generic/bits/ioctl.h
+++ b/lib/libc/musl/arch/generic/bits/ioctl.h
@@ -104,7 +104,12 @@
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
+#if __LONG_MAX == 0x7fffffff
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
+#else
#define SIOCGSTAMP 0x8906
#define SIOCGSTAMPNS 0x8907
+#endif
#include
diff --git a/lib/libc/musl/arch/generic/bits/limits.h b/lib/libc/musl/arch/generic/bits/limits.h
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/lib/libc/musl/arch/generic/bits/socket.h b/lib/libc/musl/arch/generic/bits/socket.h
index 1f73b995c68a61e5c1a291cb7dc4f98ea8ae9885..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/lib/libc/musl/arch/generic/bits/socket.h
+++ b/lib/libc/musl/arch/generic/bits/socket.h
@@ -1,15 +0,0 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
diff --git a/lib/libc/musl/arch/i386/bits/alltypes.h.in b/lib/libc/musl/arch/i386/bits/alltypes.h.in
index 1a8432d3e7bbbc550684d55b0dceec037bf1ae5f..6feb03a6c3f5ebef82100a2295911e25766c1583 100644
--- a/lib/libc/musl/arch/i386/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/i386/bits/alltypes.h.in
@@ -1,14 +1,10 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-#if __GNUC__ >= 3
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-#else
-TYPEDEF struct __va_list * va_list;
-TYPEDEF struct __va_list * __isoc_va_list;
-#endif
+#define __BYTE_ORDER 1234
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#ifdef __WCHAR_TYPE__
@@ -33,14 +29,3 @@ TYPEDEF struct { __attribute__((__aligned__(8))) long long __ll; long double __l
#else
TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
#endif
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/i386/bits/endian.h b/lib/libc/musl/arch/i386/bits/endian.h
deleted file mode 100644
index 172c338f5080a09c1f776237e761ea3001ebf1bf..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/i386/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/lib/libc/musl/arch/i386/bits/ipcstat.h b/lib/libc/musl/arch/i386/bits/ipcstat.h
index 0018ad1e20f62a4bb426908c9397ee1253954cd5..4f4fcb0c5b74d7142e781f232b7615f9c86ef2ce 100644
--- a/lib/libc/musl/arch/i386/bits/ipcstat.h
+++ b/lib/libc/musl/arch/i386/bits/ipcstat.h
@@ -1 +1 @@
-#define IPC_STAT 2
+#define IPC_STAT 0x102
diff --git a/lib/libc/musl/arch/i386/bits/limits.h b/lib/libc/musl/arch/i386/bits/limits.h
index c340ceb220afe396641fb0f9cf013401f7c64297..07743b6fd61fe0c71d78ba15dca10f2488c1061f 100644
--- a/lib/libc/musl/arch/i386/bits/limits.h
+++ b/lib/libc/musl/arch/i386/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGESIZE 4096
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/i386/bits/msg.h b/lib/libc/musl/arch/i386/bits/msg.h
index bc8436c4ad26797d69e762b701aa906b9bed1271..7bbbb2bf43bebae1ec8fe785d38c5bbba0e77cfe 100644
--- a/lib/libc/musl/arch/i386/bits/msg.h
+++ b/lib/libc/musl/arch/i386/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
diff --git a/lib/libc/musl/arch/i386/bits/sem.h b/lib/libc/musl/arch/i386/bits/sem.h
index e61571c121fc781d1254c33c39575025e6dcb436..65661542a56bce5bc0a23dceb4dff7a42e722f4b 100644
--- a/lib/libc/musl/arch/i386/bits/sem.h
+++ b/lib/libc/musl/arch/i386/bits/sem.h
@@ -1,11 +1,13 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- long __unused1;
- time_t sem_ctime;
- long __unused2;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_lo;
+ unsigned long __sem_ctime_hi;
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/lib/libc/musl/arch/i386/bits/shm.h b/lib/libc/musl/arch/i386/bits/shm.h
index 81b2a29abb87642a2d1a56cf45ee932f16db1603..725fb46968a7eeeb67cd4ae31810de6e2fffa2b0 100644
--- a/lib/libc/musl/arch/i386/bits/shm.h
+++ b/lib/libc/musl/arch/i386/bits/shm.h
@@ -3,17 +3,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- int __unused1;
- time_t shm_dtime;
- int __unused2;
- time_t shm_ctime;
- int __unused3;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __shm_ctime_hi;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ unsigned long __pad3;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/musl/arch/i386/bits/stat.h b/lib/libc/musl/arch/i386/bits/stat.h
index 22b19bbfecf52c0b0158a2f84273c9bb7efd3d64..5d7828cf792baa9109d9868e2939ea9a5508f25c 100644
--- a/lib/libc/musl/arch/i386/bits/stat.h
+++ b/lib/libc/musl/arch/i386/bits/stat.h
@@ -14,8 +14,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ ino_t st_ino;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- ino_t st_ino;
};
diff --git a/lib/libc/musl/arch/i386/bits/syscall.h.in b/lib/libc/musl/arch/i386/bits/syscall.h.in
index c95e108e55d577b16eb1c4396b07d272aad778cc..1ae4e48a8fea1a49cc189db7a5a19a4fb26da61d 100644
--- a/lib/libc/musl/arch/i386/bits/syscall.h.in
+++ b/lib/libc/musl/arch/i386/bits/syscall.h.in
@@ -76,8 +76,8 @@
#define __NR_setrlimit 75
#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
@@ -257,14 +257,14 @@
#define __NR_remap_file_pages 257
#define __NR_set_tid_address 258
#define __NR_timer_create 259
-#define __NR_timer_settime (__NR_timer_create+1)
-#define __NR_timer_gettime (__NR_timer_create+2)
+#define __NR_timer_settime32 (__NR_timer_create+1)
+#define __NR_timer_gettime32 (__NR_timer_create+2)
#define __NR_timer_getoverrun (__NR_timer_create+3)
#define __NR_timer_delete (__NR_timer_create+4)
-#define __NR_clock_settime (__NR_timer_create+5)
-#define __NR_clock_gettime (__NR_timer_create+6)
-#define __NR_clock_getres (__NR_timer_create+7)
-#define __NR_clock_nanosleep (__NR_timer_create+8)
+#define __NR_clock_settime32 (__NR_timer_create+5)
+#define __NR_clock_gettime32 (__NR_timer_create+6)
+#define __NR_clock_getres_time32 (__NR_timer_create+7)
+#define __NR_clock_nanosleep_time32 (__NR_timer_create+8)
#define __NR_statfs64 268
#define __NR_fstatfs64 269
#define __NR_tgkill 270
@@ -322,8 +322,8 @@
#define __NR_timerfd_create 322
#define __NR_eventfd 323
#define __NR_fallocate 324
-#define __NR_timerfd_settime 325
-#define __NR_timerfd_gettime 326
+#define __NR_timerfd_settime32 325
+#define __NR_timerfd_gettime32 326
#define __NR_signalfd4 327
#define __NR_eventfd2 328
#define __NR_epoll_create1 329
@@ -424,4 +424,6 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
diff --git a/lib/libc/musl/arch/i386/syscall_arch.h b/lib/libc/musl/arch/i386/syscall_arch.h
index 22b0b28b8349c5e80f59b44637b5bec56f071050..69642e578a5f16e783c2afe4f67744a9b17e8c73 100644
--- a/lib/libc/musl/arch/i386/syscall_arch.h
+++ b/lib/libc/musl/arch/i386/syscall_arch.h
@@ -83,7 +83,9 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a
}
#define VDSO_USEFUL
-#define VDSO_CGT_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_VER "LINUX_2.6"
+#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define SYSCALL_USE_SOCKETCALL
diff --git a/lib/libc/musl/arch/mips/bits/alltypes.h.in b/lib/libc/musl/arch/mips/bits/alltypes.h.in
index 66ca18ad61af9e0c327868f74e49fdd2c7951047..ff934a4c422ab737ac47c6ba906ac989d67fa705 100644
--- a/lib/libc/musl/arch/mips/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/mips/bits/alltypes.h.in
@@ -1,9 +1,15 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#if _MIPSEL || __MIPSEL || __MIPSEL__
+#define __BYTE_ORDER 1234
+#else
+#define __BYTE_ORDER 4321
+#endif
+
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -13,14 +19,3 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/mips/bits/endian.h b/lib/libc/musl/arch/mips/bits/endian.h
deleted file mode 100644
index 5399dcb54433380d7b10e2c0c011307e2656d273..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/mips/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if _MIPSEL || __MIPSEL || __MIPSEL__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif
diff --git a/lib/libc/musl/arch/mips/bits/hwcap.h b/lib/libc/musl/arch/mips/bits/hwcap.h
index 13e86fe702eefb44fbf38ce4df12401d19d6d79b..7986deb7f68f5236c50c9b95b8f375b233c3420e 100644
--- a/lib/libc/musl/arch/mips/bits/hwcap.h
+++ b/lib/libc/musl/arch/mips/bits/hwcap.h
@@ -1,3 +1,14 @@
#define HWCAP_MIPS_R6 (1 << 0)
#define HWCAP_MIPS_MSA (1 << 1)
#define HWCAP_MIPS_CRC32 (1 << 2)
+#define HWCAP_MIPS_MIPS16 (1 << 3)
+#define HWCAP_MIPS_MDMX (1 << 4)
+#define HWCAP_MIPS_MIPS3D (1 << 5)
+#define HWCAP_MIPS_SMARTMIPS (1 << 6)
+#define HWCAP_MIPS_DSP (1 << 7)
+#define HWCAP_MIPS_DSP2 (1 << 8)
+#define HWCAP_MIPS_DSP3 (1 << 9)
+#define HWCAP_MIPS_MIPS16E2 (1 << 10)
+#define HWCAP_LOONGSON_MMI (1 << 11)
+#define HWCAP_LOONGSON_EXT (1 << 12)
+#define HWCAP_LOONGSON_EXT2 (1 << 13)
diff --git a/lib/libc/musl/arch/mips/bits/ioctl.h b/lib/libc/musl/arch/mips/bits/ioctl.h
index e277c3f05c62fec053dbc5847e4a6cb6dcf19e58..e20bf19eaa77b44230ec054ee331b8b1971ec79c 100644
--- a/lib/libc/musl/arch/mips/bits/ioctl.h
+++ b/lib/libc/musl/arch/mips/bits/ioctl.h
@@ -110,5 +110,5 @@
#define SIOCATMARK _IOR('s', 7, int)
#define SIOCSPGRP _IOW('s', 8, pid_t)
#define SIOCGPGRP _IOR('s', 9, pid_t)
-#define SIOCGSTAMP 0x8906
-#define SIOCGSTAMPNS 0x8907
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
diff --git a/lib/libc/musl/arch/mips/bits/ipcstat.h b/lib/libc/musl/arch/mips/bits/ipcstat.h
index 0018ad1e20f62a4bb426908c9397ee1253954cd5..4f4fcb0c5b74d7142e781f232b7615f9c86ef2ce 100644
--- a/lib/libc/musl/arch/mips/bits/ipcstat.h
+++ b/lib/libc/musl/arch/mips/bits/ipcstat.h
@@ -1 +1 @@
-#define IPC_STAT 2
+#define IPC_STAT 0x102
diff --git a/lib/libc/musl/arch/mips/bits/limits.h b/lib/libc/musl/arch/mips/bits/limits.h
deleted file mode 100644
index fbc6d238dc89b91dbe94af93ea60e862c67ac154..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/mips/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/mips/bits/msg.h b/lib/libc/musl/arch/mips/bits/msg.h
index f28aece8fa4bd662f0df89931cb6174a5db92047..c734dbb5708525bd2e045290b02b5ac718730df9 100644
--- a/lib/libc/musl/arch/mips/bits/msg.h
+++ b/lib/libc/musl/arch/mips/bits/msg.h
@@ -1,19 +1,19 @@
struct msqid_ds {
struct ipc_perm msg_perm;
#if _MIPSEL || __MIPSEL || __MIPSEL__
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
#else
- int __unused1;
- time_t msg_stime;
- int __unused2;
- time_t msg_rtime;
- int __unused3;
- time_t msg_ctime;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_ctime_hi;
+ unsigned long __msg_ctime_lo;
#endif
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
@@ -21,4 +21,7 @@ struct msqid_ds {
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
diff --git a/lib/libc/musl/arch/mips/bits/sem.h b/lib/libc/musl/arch/mips/bits/sem.h
index 5184eb5977ece3775fe5f7a6659a83d6da24ca44..fe6f0948582b9bb241fc600c34c625e085cca32b 100644
--- a/lib/libc/musl/arch/mips/bits/sem.h
+++ b/lib/libc/musl/arch/mips/bits/sem.h
@@ -1,7 +1,7 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- time_t sem_ctime;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_ctime_lo;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
@@ -9,6 +9,8 @@ struct semid_ds {
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
unsigned short sem_nsems;
#endif
- long __unused3;
- long __unused4;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_hi;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/lib/libc/musl/arch/mips/bits/shm.h b/lib/libc/musl/arch/mips/bits/shm.h
index 8d19378191bacd8a43080a7f96027befcfd30e4c..ab8c642d825aba458641de167f3e250f6f3c4514 100644
--- a/lib/libc/musl/arch/mips/bits/shm.h
+++ b/lib/libc/musl/arch/mips/bits/shm.h
@@ -3,14 +3,19 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- time_t shm_dtime;
- time_t shm_ctime;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_ctime_lo;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
- unsigned long __pad1;
- unsigned long __pad2;
+ unsigned short __shm_atime_hi;
+ unsigned short __shm_dtime_hi;
+ unsigned short __shm_ctime_hi;
+ unsigned short __pad1;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/musl/arch/mips/bits/signal.h b/lib/libc/musl/arch/mips/bits/signal.h
index 1a84de5904bbe93aa688c33446ae2fcd656dd6ca..e1d97ac781595f651ceffec304c37cca142112c2 100644
--- a/lib/libc/musl/arch/mips/bits/signal.h
+++ b/lib/libc/musl/arch/mips/bits/signal.h
@@ -19,14 +19,18 @@ typedef struct {
} fpregset_t;
struct sigcontext {
unsigned sc_regmask, sc_status;
- unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
+ unsigned long long sc_pc;
+ gregset_t sc_regs;
+ fpregset_t sc_fpregs;
unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
unsigned long long sc_mdhi, sc_mdlo;
unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
};
typedef struct {
unsigned regmask, status;
- unsigned long long pc, gregs[32], fpregs[32];
+ unsigned long long pc;
+ gregset_t gregs;
+ fpregset_t fpregs;
unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
unsigned long long mdhi, mdlo;
unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
diff --git a/lib/libc/musl/arch/mips/bits/socket.h b/lib/libc/musl/arch/mips/bits/socket.h
index b82c7d341f0f880bc800414100a7db60dd44f994..02fbb88b4d25f0e23f882e9d39d48a958f428dc9 100644
--- a/lib/libc/musl/arch/mips/bits/socket.h
+++ b/lib/libc/musl/arch/mips/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
-
#define SOCK_STREAM 2
#define SOCK_DGRAM 1
@@ -32,8 +16,6 @@ struct cmsghdr {
#define SO_RCVBUF 0x1002
#define SO_SNDLOWAT 0x1003
#define SO_RCVLOWAT 0x1004
-#define SO_RCVTIMEO 0x1006
-#define SO_SNDTIMEO 0x1005
#define SO_ERROR 0x1007
#define SO_TYPE 0x1008
#define SO_ACCEPTCONN 0x1009
diff --git a/lib/libc/musl/arch/mips/bits/stat.h b/lib/libc/musl/arch/mips/bits/stat.h
index 3291a63620a2d491ef788102d267de91e6284d1a..48d4ac8044dbfa032f63c088e08f39a216d8e20a 100644
--- a/lib/libc/musl/arch/mips/bits/stat.h
+++ b/lib/libc/musl/arch/mips/bits/stat.h
@@ -12,11 +12,15 @@ struct stat {
dev_t st_rdev;
long __st_padding2[2];
off_t st_size;
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
blksize_t st_blksize;
long __st_padding3;
blkcnt_t st_blocks;
- long __st_padding4[14];
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ long __st_padding4[2];
};
diff --git a/lib/libc/musl/arch/mips/bits/syscall.h.in b/lib/libc/musl/arch/mips/bits/syscall.h.in
index 582fa3b51c7d9dcb23e61b7d1e67bb49c885e29e..86251bf31b41413e5ff6f62c408304365b77ff99 100644
--- a/lib/libc/musl/arch/mips/bits/syscall.h.in
+++ b/lib/libc/musl/arch/mips/bits/syscall.h.in
@@ -76,8 +76,8 @@
#define __NR_setrlimit 4075
#define __NR_getrlimit 4076
#define __NR_getrusage 4077
-#define __NR_gettimeofday 4078
-#define __NR_settimeofday 4079
+#define __NR_gettimeofday_time32 4078
+#define __NR_settimeofday_time32 4079
#define __NR_getgroups 4080
#define __NR_setgroups 4081
#define __NR_reserved82 4082
@@ -256,14 +256,14 @@
#define __NR_statfs64 4255
#define __NR_fstatfs64 4256
#define __NR_timer_create 4257
-#define __NR_timer_settime 4258
-#define __NR_timer_gettime 4259
+#define __NR_timer_settime32 4258
+#define __NR_timer_gettime32 4259
#define __NR_timer_getoverrun 4260
#define __NR_timer_delete 4261
-#define __NR_clock_settime 4262
-#define __NR_clock_gettime 4263
-#define __NR_clock_getres 4264
-#define __NR_clock_nanosleep 4265
+#define __NR_clock_settime32 4262
+#define __NR_clock_gettime32 4263
+#define __NR_clock_getres_time32 4264
+#define __NR_clock_nanosleep_time32 4265
#define __NR_tgkill 4266
#define __NR_utimes 4267
#define __NR_mbind 4268
@@ -319,8 +319,8 @@
#define __NR_eventfd 4319
#define __NR_fallocate 4320
#define __NR_timerfd_create 4321
-#define __NR_timerfd_gettime 4322
-#define __NR_timerfd_settime 4323
+#define __NR_timerfd_gettime32 4322
+#define __NR_timerfd_settime32 4323
#define __NR_signalfd4 4324
#define __NR_eventfd2 4325
#define __NR_epoll_create1 4326
@@ -406,4 +406,6 @@
#define __NR_fsconfig 4431
#define __NR_fsmount 4432
#define __NR_fspick 4433
+#define __NR_pidfd_open 4434
+#define __NR_clone3 4435
diff --git a/lib/libc/musl/arch/mips/reloc.h b/lib/libc/musl/arch/mips/reloc.h
index b3d59a45ca2c8022f6f92cefe463851ba09c8179..88d236390edaf7d8b87e6a955b3adb213d308c4f 100644
--- a/lib/libc/musl/arch/mips/reloc.h
+++ b/lib/libc/musl/arch/mips/reloc.h
@@ -1,5 +1,3 @@
-#include
-
#if __mips_isa_rev >= 6
#define ISA_SUFFIX "r6"
#else
diff --git a/lib/libc/musl/arch/mips/syscall_arch.h b/lib/libc/musl/arch/mips/syscall_arch.h
index 6ea73437b52baf7e53b7dc218a36d6c3c7bbf85c..f821e73fcc574ac47f70931e37a3e4a809c69917 100644
--- a/lib/libc/musl/arch/mips/syscall_arch.h
+++ b/lib/libc/musl/arch/mips/syscall_arch.h
@@ -142,7 +142,9 @@ static inline long __syscall7(long n, long a, long b, long c, long d, long e, lo
}
#define VDSO_USEFUL
-#define VDSO_CGT_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_VER "LINUX_2.6"
+#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define SO_SNDTIMEO_OLD 0x1005
diff --git a/lib/libc/musl/arch/mips64/bits/alltypes.h.in b/lib/libc/musl/arch/mips64/bits/alltypes.h.in
index 2b2e34a831f15a98542fca50ea81b17765c75c12..fcd61ee853be9ee92037d316acbad041434668d6 100644
--- a/lib/libc/musl/arch/mips64/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/mips64/bits/alltypes.h.in
@@ -2,8 +2,13 @@
#define _Int64 long
#define _Reg long
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#if _MIPSEL || __MIPSEL || __MIPSEL__
+#define __BYTE_ORDER 1234
+#else
+#define __BYTE_ORDER 4321
+#endif
+
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -14,15 +19,4 @@ TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
TYPEDEF unsigned nlink_t;
-
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/mips64/bits/endian.h b/lib/libc/musl/arch/mips64/bits/endian.h
deleted file mode 100644
index 5399dcb54433380d7b10e2c0c011307e2656d273..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/mips64/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if _MIPSEL || __MIPSEL || __MIPSEL__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif
diff --git a/lib/libc/musl/arch/mips64/bits/limits.h b/lib/libc/musl/arch/mips64/bits/limits.h
deleted file mode 100644
index 58698c62dce289327a10146b6d8235e418768a3d..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/mips64/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/mips64/bits/socket.h b/lib/libc/musl/arch/mips64/bits/socket.h
index 5aff0d91c29c02bb33104fb1458e93d97a1addb3..519b9c8ead4f6ffd23868d7c2a9a9575c91d3425 100644
--- a/lib/libc/musl/arch/mips64/bits/socket.h
+++ b/lib/libc/musl/arch/mips64/bits/socket.h
@@ -1,37 +1,3 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1, msg_iovlen;
-#else
- int msg_iovlen, __pad1;
-#endif
- void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad2;
- socklen_t msg_controllen;
-#else
- socklen_t msg_controllen;
- int __pad2;
-#endif
- int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1;
- socklen_t cmsg_len;
-#else
- socklen_t cmsg_len;
- int __pad1;
-#endif
- int cmsg_level;
- int cmsg_type;
-};
-
#define SOCK_STREAM 2
#define SOCK_DGRAM 1
#define SOL_SOCKET 65535
diff --git a/lib/libc/musl/arch/mips64/bits/syscall.h.in b/lib/libc/musl/arch/mips64/bits/syscall.h.in
index 34b9752e6a695b98c6da52d6c4b25d3b0c6d604e..9b406e9a4d9e937a5cdc524df29695a93c6606ab 100644
--- a/lib/libc/musl/arch/mips64/bits/syscall.h.in
+++ b/lib/libc/musl/arch/mips64/bits/syscall.h.in
@@ -336,4 +336,6 @@
#define __NR_fsconfig 5431
#define __NR_fsmount 5432
#define __NR_fspick 5433
+#define __NR_pidfd_open 5434
+#define __NR_clone3 5435
diff --git a/lib/libc/musl/arch/mips64/reloc.h b/lib/libc/musl/arch/mips64/reloc.h
index bbd9bd9d2d6e07a9c65f1ffdab20e3eb2fe19d73..fdb5edc9ca52fa13ed3ef84d6ffa63f74749b390 100644
--- a/lib/libc/musl/arch/mips64/reloc.h
+++ b/lib/libc/musl/arch/mips64/reloc.h
@@ -1,9 +1,3 @@
-#ifndef __RELOC_H__
-#define __RELOC_H__
-
-#define _GNU_SOURCE
-#include
-
#if __mips_isa_rev >= 6
#define ISA_SUFFIX "r6"
#else
@@ -33,6 +27,8 @@
#define REL_DTPOFF R_MIPS_TLS_DTPREL64
#define REL_TPOFF R_MIPS_TLS_TPREL64
+#include
+
#undef R_TYPE
#undef R_SYM
#undef R_INFO
@@ -62,5 +58,3 @@
" daddu %0, %0, $ra \n" \
".set pop \n" \
: "=r"(*(fp)) : : "memory", "ra" )
-
-#endif
diff --git a/lib/libc/musl/arch/powerpc/bits/alltypes.h.in b/lib/libc/musl/arch/powerpc/bits/alltypes.h.in
index 8e687ef16dd3d24d64f4e7fd7ba91cee2b4677c7..b48df6a6254d0042fe47ed869c2363ad4436f678 100644
--- a/lib/libc/musl/arch/powerpc/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/powerpc/bits/alltypes.h.in
@@ -1,9 +1,10 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#define __BYTE_ORDER 4321
+#define __LONG_MAX 0x7fffffffL
#ifndef __cplusplus
#ifdef __WCHAR_TYPE__
@@ -17,14 +18,3 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/powerpc/bits/endian.h b/lib/libc/musl/arch/powerpc/bits/endian.h
deleted file mode 100644
index 4442abf4eb95f66e6f6770559a5ad98c711f92ce..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/powerpc/bits/endian.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifdef __BIG_ENDIAN__
- #if __BIG_ENDIAN__
- #define __BYTE_ORDER __BIG_ENDIAN
- #endif
-#endif /* __BIG_ENDIAN__ */
-
-#ifdef __LITTLE_ENDIAN__
- #if __LITTLE_ENDIAN__
- #define __BYTE_ORDER __LITTLE_ENDIAN
- #endif
-#endif /* __LITTLE_ENDIAN__ */
-
-#ifndef __BYTE_ORDER
- #define __BYTE_ORDER __BIG_ENDIAN
-#endif
diff --git a/lib/libc/musl/arch/powerpc/bits/ioctl.h b/lib/libc/musl/arch/powerpc/bits/ioctl.h
index b6cbb18f4776521d0ad07c6f1ffa97c3513db87e..ac9bfd204a84006e8d871600aae3f0e9d10ec1b0 100644
--- a/lib/libc/musl/arch/powerpc/bits/ioctl.h
+++ b/lib/libc/musl/arch/powerpc/bits/ioctl.h
@@ -116,5 +116,5 @@
#define FIOGETOWN 0x8903
#define SIOCGPGRP 0x8904
#define SIOCATMARK 0x8905
-#define SIOCGSTAMP 0x8906
-#define SIOCGSTAMPNS 0x8907
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
diff --git a/lib/libc/musl/arch/powerpc/bits/ipcstat.h b/lib/libc/musl/arch/powerpc/bits/ipcstat.h
index 0018ad1e20f62a4bb426908c9397ee1253954cd5..4f4fcb0c5b74d7142e781f232b7615f9c86ef2ce 100644
--- a/lib/libc/musl/arch/powerpc/bits/ipcstat.h
+++ b/lib/libc/musl/arch/powerpc/bits/ipcstat.h
@@ -1 +1 @@
-#define IPC_STAT 2
+#define IPC_STAT 0x102
diff --git a/lib/libc/musl/arch/powerpc/bits/limits.h b/lib/libc/musl/arch/powerpc/bits/limits.h
deleted file mode 100644
index fbc6d238dc89b91dbe94af93ea60e862c67ac154..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/powerpc/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 32
-#endif
-
-#define LONG_MAX 0x7fffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/powerpc/bits/msg.h b/lib/libc/musl/arch/powerpc/bits/msg.h
index 171c11a34f8f0db180362a1ed32e8969a516ff76..9fb15dccb2e0d6e91cd5fccfb75d3f93bd955019 100644
--- a/lib/libc/musl/arch/powerpc/bits/msg.h
+++ b/lib/libc/musl/arch/powerpc/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- int __unused1;
- time_t msg_stime;
- int __unused2;
- time_t msg_rtime;
- int __unused3;
- time_t msg_ctime;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_ctime_hi;
+ unsigned long __msg_ctime_lo;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
diff --git a/lib/libc/musl/arch/powerpc/bits/sem.h b/lib/libc/musl/arch/powerpc/bits/sem.h
index bc2d6d1f514dffc7eafddd5c34adee8c86a34a09..28be484528574b2fa87c038818b947d393048b0f 100644
--- a/lib/libc/musl/arch/powerpc/bits/sem.h
+++ b/lib/libc/musl/arch/powerpc/bits/sem.h
@@ -1,10 +1,12 @@
struct semid_ds {
struct ipc_perm sem_perm;
- int __unused1;
- time_t sem_otime;
- int __unused2;
- time_t sem_ctime;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_ctime_hi;
+ unsigned long __sem_ctime_lo;
unsigned short __sem_nsems_pad, sem_nsems;
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/lib/libc/musl/arch/powerpc/bits/shm.h b/lib/libc/musl/arch/powerpc/bits/shm.h
index b19801d51a067d8211b1b211dd395ebfaff7ce1f..fb1d4020f683cc22885195ac63a384ecd9880dba 100644
--- a/lib/libc/musl/arch/powerpc/bits/shm.h
+++ b/lib/libc/musl/arch/powerpc/bits/shm.h
@@ -2,19 +2,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
- int __unused1;
- time_t shm_atime;
- int __unused2;
- time_t shm_dtime;
- int __unused3;
- time_t shm_ctime;
- int __unused4;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_ctime_hi;
+ unsigned long __shm_ctime_lo;
size_t shm_segsz;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/lib/libc/musl/arch/powerpc/bits/signal.h b/lib/libc/musl/arch/powerpc/bits/signal.h
index 06efb11cf271326301b90156ada7afa4a9912430..c1bf3caf34e27b51edd0267957f0eda583ec7416 100644
--- a/lib/libc/musl/arch/powerpc/bits/signal.h
+++ b/lib/libc/musl/arch/powerpc/bits/signal.h
@@ -28,7 +28,7 @@ struct sigcontext {
int signal;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
};
typedef struct {
diff --git a/lib/libc/musl/arch/powerpc/bits/socket.h b/lib/libc/musl/arch/powerpc/bits/socket.h
index a94b8bdb8c5ebbb84ffa49c9f5f180db989b03c6..b19ed42bfa9013cea272f2b85fa720ab4c7bb14b 100644
--- a/lib/libc/musl/arch/powerpc/bits/socket.h
+++ b/lib/libc/musl/arch/powerpc/bits/socket.h
@@ -1,19 +1,3 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen;
- void *msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
-
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
@@ -31,8 +15,6 @@ struct cmsghdr {
#define SO_REUSEPORT 15
#define SO_RCVLOWAT 16
#define SO_SNDLOWAT 17
-#define SO_RCVTIMEO 18
-#define SO_SNDTIMEO 19
#define SO_PASSCRED 20
#define SO_PEERCRED 21
#define SO_ACCEPTCONN 30
diff --git a/lib/libc/musl/arch/powerpc/bits/stat.h b/lib/libc/musl/arch/powerpc/bits/stat.h
index dcb896fd5fba811fa190c7cc1e6246f76ec4de76..585d98e908081eb1e6c1b19b8812d1b017fe7f07 100644
--- a/lib/libc/musl/arch/powerpc/bits/stat.h
+++ b/lib/libc/musl/arch/powerpc/bits/stat.h
@@ -13,8 +13,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ unsigned __unused[2];
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- unsigned __unused[2];
};
diff --git a/lib/libc/musl/arch/powerpc/bits/syscall.h.in b/lib/libc/musl/arch/powerpc/bits/syscall.h.in
index adcf63dbbc8d3038654e22a4b4028d1f2a095756..8d4f79b524c22cf9e8f13e7dceb77a84b1205e64 100644
--- a/lib/libc/musl/arch/powerpc/bits/syscall.h.in
+++ b/lib/libc/musl/arch/powerpc/bits/syscall.h.in
@@ -76,8 +76,8 @@
#define __NR_setrlimit 75
#define __NR_getrlimit 76
#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
+#define __NR_gettimeofday_time32 78
+#define __NR_settimeofday_time32 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
@@ -238,14 +238,14 @@
#define __NR_epoll_wait 238
#define __NR_remap_file_pages 239
#define __NR_timer_create 240
-#define __NR_timer_settime 241
-#define __NR_timer_gettime 242
+#define __NR_timer_settime32 241
+#define __NR_timer_gettime32 242
#define __NR_timer_getoverrun 243
#define __NR_timer_delete 244
-#define __NR_clock_settime 245
-#define __NR_clock_gettime 246
-#define __NR_clock_getres 247
-#define __NR_clock_nanosleep 248
+#define __NR_clock_settime32 245
+#define __NR_clock_gettime32 246
+#define __NR_clock_getres_time32 247
+#define __NR_clock_nanosleep_time32 248
#define __NR_swapcontext 249
#define __NR_tgkill 250
#define __NR_utimes 251
@@ -307,8 +307,8 @@
#define __NR_sync_file_range2 308
#define __NR_fallocate 309
#define __NR_subpage_prot 310
-#define __NR_timerfd_settime 311
-#define __NR_timerfd_gettime 312
+#define __NR_timerfd_settime32 311
+#define __NR_timerfd_gettime32 312
#define __NR_signalfd4 313
#define __NR_eventfd2 314
#define __NR_epoll_create1 315
@@ -413,4 +413,6 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
diff --git a/lib/libc/musl/arch/powerpc64/bits/alltypes.h.in b/lib/libc/musl/arch/powerpc64/bits/alltypes.h.in
index 5b205851f1e312b5076e98a6fe27942650f6e5fe..143ffa8d25b97c2ba6961289fd77e3d0c5e10c43 100644
--- a/lib/libc/musl/arch/powerpc64/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/powerpc64/bits/alltypes.h.in
@@ -2,8 +2,13 @@
#define _Int64 long
#define _Reg long
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#if __BIG_ENDIAN__
+#define __BYTE_ORDER 4321
+#else
+#define __BYTE_ORDER 1234
+#endif
+
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -13,14 +18,3 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/powerpc64/bits/endian.h b/lib/libc/musl/arch/powerpc64/bits/endian.h
deleted file mode 100644
index 2016cb2074191be20ad57193416a9d5118d53fb6..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/powerpc64/bits/endian.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __BIG_ENDIAN__
-#define __BYTE_ORDER __BIG_ENDIAN
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
diff --git a/lib/libc/musl/arch/powerpc64/bits/limits.h b/lib/libc/musl/arch/powerpc64/bits/limits.h
deleted file mode 100644
index 0226588c3df9730c5eebcf6dad106f6202237978..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/powerpc64/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/powerpc64/bits/signal.h b/lib/libc/musl/arch/powerpc64/bits/signal.h
index 2cc0604c5e4b279a4d89aae2b094010a053bfe0a..d5493b185623413bd71622f6cfb470724d25ff4e 100644
--- a/lib/libc/musl/arch/powerpc64/bits/signal.h
+++ b/lib/libc/musl/arch/powerpc64/bits/signal.h
@@ -9,11 +9,7 @@
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned long greg_t, gregset_t[48];
-
-typedef struct {
- double fpregs[32];
- double fpscr;
-} fpregset_t;
+typedef double fpregset_t[33];
typedef struct {
#ifdef __GNUC__
@@ -36,7 +32,7 @@ typedef struct sigcontext {
int _pad0;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
gregset_t gp_regs;
fpregset_t fp_regs;
vrregset_t *v_regs;
diff --git a/lib/libc/musl/arch/powerpc64/bits/socket.h b/lib/libc/musl/arch/powerpc64/bits/socket.h
index 0f3c9aac90fb24d280c7a9416b3c28b13c825536..557e324fde9d7eb5415943c33b3cda7912f739f3 100644
--- a/lib/libc/musl/arch/powerpc64/bits/socket.h
+++ b/lib/libc/musl/arch/powerpc64/bits/socket.h
@@ -1,37 +1,3 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1, msg_iovlen;
-#else
- int msg_iovlen, __pad1;
-#endif
- void *msg_control;
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad2;
- socklen_t msg_controllen;
-#else
- socklen_t msg_controllen;
- int __pad2;
-#endif
- int msg_flags;
-};
-
-struct cmsghdr {
-#if __BYTE_ORDER == __BIG_ENDIAN
- int __pad1;
- socklen_t cmsg_len;
-#else
- socklen_t cmsg_len;
- int __pad1;
-#endif
- int cmsg_level;
- int cmsg_type;
-};
-
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
diff --git a/lib/libc/musl/arch/powerpc64/bits/syscall.h.in b/lib/libc/musl/arch/powerpc64/bits/syscall.h.in
index 32545b3940f14152d4960acf1c2f22a223ab62ef..b935864c41526a96aedd14af21d54e8998cc6d0b 100644
--- a/lib/libc/musl/arch/powerpc64/bits/syscall.h.in
+++ b/lib/libc/musl/arch/powerpc64/bits/syscall.h.in
@@ -385,4 +385,6 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
diff --git a/lib/libc/musl/arch/powerpc64/reloc.h b/lib/libc/musl/arch/powerpc64/reloc.h
index 5bdaeede5437bbc99b5f47bd1271e5ef87c55d3d..2f1bba059fd416cd0e16fc53d98957e6cfe9d1ed 100644
--- a/lib/libc/musl/arch/powerpc64/reloc.h
+++ b/lib/libc/musl/arch/powerpc64/reloc.h
@@ -1,5 +1,3 @@
-#include
-
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define ENDIAN_SUFFIX "le"
#else
diff --git a/lib/libc/musl/arch/riscv64/atomic_arch.h b/lib/libc/musl/arch/riscv64/atomic_arch.h
index 41ad4d04907cb2627c484da9eb756a9f635134a5..0c382588686c48ed5af2b8dcf9f816c0aacbea9e 100644
--- a/lib/libc/musl/arch/riscv64/atomic_arch.h
+++ b/lib/libc/musl/arch/riscv64/atomic_arch.h
@@ -15,7 +15,7 @@ static inline int a_cas(volatile int *p, int t, int s)
" bnez %1, 1b\n"
"1:"
: "=&r"(old), "=&r"(tmp)
- : "r"(p), "r"(t), "r"(s)
+ : "r"(p), "r"((long)t), "r"((long)s)
: "memory");
return old;
}
diff --git a/lib/libc/musl/arch/riscv64/bits/alltypes.h.in b/lib/libc/musl/arch/riscv64/bits/alltypes.h.in
index ae9ba41daf54ae90e88960bc3bcb65a6b598b7a3..4579d1740b689b16fdf91868b483ba0de07635da 100644
--- a/lib/libc/musl/arch/riscv64/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/riscv64/bits/alltypes.h.in
@@ -2,8 +2,8 @@
#define _Int64 long
#define _Reg long
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#define __BYTE_ORDER 1234
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -16,14 +16,3 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/riscv64/bits/endian.h b/lib/libc/musl/arch/riscv64/bits/endian.h
deleted file mode 100644
index 172c338f5080a09c1f776237e761ea3001ebf1bf..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/riscv64/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/lib/libc/musl/arch/riscv64/bits/limits.h b/lib/libc/musl/arch/riscv64/bits/limits.h
deleted file mode 100644
index 0226588c3df9730c5eebcf6dad106f6202237978..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/riscv64/bits/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/riscv64/bits/reg.h b/lib/libc/musl/arch/riscv64/bits/reg.h
index c800788c3fffe5bb5c511c0f387dc1669ec6964e..2633f39d77739ffd4a9100508c3bbfd6286ffa43 100644
--- a/lib/libc/musl/arch/riscv64/bits/reg.h
+++ b/lib/libc/musl/arch/riscv64/bits/reg.h
@@ -1,8 +1,2 @@
#undef __WORDSIZE
#define __WORDSIZE 64
-#define REG_PC 0
-#define REG_RA 1
-#define REG_SP 2
-#define REG_TP 4
-#define REG_S0 8
-#define REG_A0 10
diff --git a/lib/libc/musl/arch/riscv64/bits/signal.h b/lib/libc/musl/arch/riscv64/bits/signal.h
index 2ff4be302c62130d69c0733ed51067faec2675be..b006334f78d7bbc971b195d7b51e108b1a36780b 100644
--- a/lib/libc/musl/arch/riscv64/bits/signal.h
+++ b/lib/libc/musl/arch/riscv64/bits/signal.h
@@ -35,6 +35,15 @@ typedef struct mcontext_t {
union __riscv_mc_fp_state __fpregs;
} mcontext_t;
+#if defined(_GNU_SOURCE)
+#define REG_PC 0
+#define REG_RA 1
+#define REG_SP 2
+#define REG_TP 4
+#define REG_S0 8
+#define REG_A0 10
+#endif
+
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned long greg_t;
typedef unsigned long gregset_t[32];
diff --git a/lib/libc/musl/arch/riscv64/bits/socket.h b/lib/libc/musl/arch/riscv64/bits/socket.h
deleted file mode 100644
index aae537d3434e76af0a0f56ea98cd1795e85ad30b..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/riscv64/bits/socket.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include
-
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen, __pad1;
- void *msg_control;
- socklen_t msg_controllen;
- int __pad2;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int __pad1;
- int cmsg_level;
- int cmsg_type;
-};
diff --git a/lib/libc/musl/arch/riscv64/bits/syscall.h.in b/lib/libc/musl/arch/riscv64/bits/syscall.h.in
index 1db70cfbf562a02d67f310ae631104753f7694b5..0043eeba3c1c29b63e8b55631a2309789173cfc9 100644
--- a/lib/libc/musl/arch/riscv64/bits/syscall.h.in
+++ b/lib/libc/musl/arch/riscv64/bits/syscall.h.in
@@ -287,6 +287,8 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
#define __NR_sysriscv __NR_arch_specific_syscall
#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/lib/libc/musl/arch/s390x/bits/alltypes.h.in b/lib/libc/musl/arch/s390x/bits/alltypes.h.in
index 1a838462091f5d46a09acb19dbf2df0f081ba6a1..15d18c8f4a9c906f0f5c1a848de787b9bdf6f0ad 100644
--- a/lib/libc/musl/arch/s390x/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/s390x/bits/alltypes.h.in
@@ -2,8 +2,8 @@
#define _Int64 long
#define _Reg long
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#define __BYTE_ORDER 4321
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -13,14 +13,3 @@ TYPEDEF double float_t;
TYPEDEF double double_t;
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/s390x/bits/endian.h b/lib/libc/musl/arch/s390x/bits/endian.h
deleted file mode 100644
index ef074b776ed9e094c468854670fc1a2bc635d7e3..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/s390x/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/lib/libc/musl/arch/s390x/bits/limits.h b/lib/libc/musl/arch/s390x/bits/limits.h
index 86ef7663fd0cb06ab4ddc0f8670a88c3121a4d73..07743b6fd61fe0c71d78ba15dca10f2488c1061f 100644
--- a/lib/libc/musl/arch/s390x/bits/limits.h
+++ b/lib/libc/musl/arch/s390x/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGESIZE 4096
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/s390x/bits/socket.h b/lib/libc/musl/arch/s390x/bits/socket.h
deleted file mode 100644
index bd4b20c4298ac1c0a22e2650a636ea2009bf229e..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/s390x/bits/socket.h
+++ /dev/null
@@ -1,17 +0,0 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int __pad1, msg_iovlen;
- void *msg_control;
- int __pad2;
- socklen_t msg_controllen;
- int msg_flags;
-};
-
-struct cmsghdr {
- int __pad1;
- socklen_t cmsg_len;
- int cmsg_level;
- int cmsg_type;
-};
diff --git a/lib/libc/musl/arch/s390x/bits/syscall.h.in b/lib/libc/musl/arch/s390x/bits/syscall.h.in
index c4c70474efe273c64b8ac5ff491534dd07d0b778..e89f3782992769503f579fef1ec4cec3768b2a13 100644
--- a/lib/libc/musl/arch/s390x/bits/syscall.h.in
+++ b/lib/libc/musl/arch/s390x/bits/syscall.h.in
@@ -350,4 +350,6 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
diff --git a/lib/libc/musl/arch/s390x/reloc.h b/lib/libc/musl/arch/s390x/reloc.h
index a238dc654c06297c0a2609d3493cf11c8a37f49e..6e5c1fb87666075a138f8e1c740cd0296293c8d9 100644
--- a/lib/libc/musl/arch/s390x/reloc.h
+++ b/lib/libc/musl/arch/s390x/reloc.h
@@ -1,5 +1,3 @@
-#include
-
#define LDSO_ARCH "s390x"
#define REL_SYMBOLIC R_390_64
diff --git a/lib/libc/musl/arch/x86_64/bits/alltypes.h.in b/lib/libc/musl/arch/x86_64/bits/alltypes.h.in
index dc551d4720bad294334e4747d722756fc4f2cc23..5cd8a2997f626fe743518fadc3a9c59991c0ddff 100644
--- a/lib/libc/musl/arch/x86_64/bits/alltypes.h.in
+++ b/lib/libc/musl/arch/x86_64/bits/alltypes.h.in
@@ -2,8 +2,8 @@
#define _Int64 long
#define _Reg long
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
+#define __BYTE_ORDER 1234
+#define __LONG_MAX 0x7fffffffffffffffL
#ifndef __cplusplus
TYPEDEF int wchar_t;
@@ -18,14 +18,3 @@ TYPEDEF double double_t;
#endif
TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t;
-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t;
diff --git a/lib/libc/musl/arch/x86_64/bits/endian.h b/lib/libc/musl/arch/x86_64/bits/endian.h
deleted file mode 100644
index 172c338f5080a09c1f776237e761ea3001ebf1bf..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/x86_64/bits/endian.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/lib/libc/musl/arch/x86_64/bits/limits.h b/lib/libc/musl/arch/x86_64/bits/limits.h
index 86ef7663fd0cb06ab4ddc0f8670a88c3121a4d73..07743b6fd61fe0c71d78ba15dca10f2488c1061f 100644
--- a/lib/libc/musl/arch/x86_64/bits/limits.h
+++ b/lib/libc/musl/arch/x86_64/bits/limits.h
@@ -1,8 +1 @@
-#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGESIZE 4096
-#define LONG_BIT 64
-#endif
-
-#define LONG_MAX 0x7fffffffffffffffL
-#define LLONG_MAX 0x7fffffffffffffffLL
diff --git a/lib/libc/musl/arch/x86_64/bits/socket.h b/lib/libc/musl/arch/x86_64/bits/socket.h
deleted file mode 100644
index a4c89f3d7a97353a979944918a30136753fadac0..0000000000000000000000000000000000000000
--- a/lib/libc/musl/arch/x86_64/bits/socket.h
+++ /dev/null
@@ -1,16 +0,0 @@
-struct msghdr {
- void *msg_name;
- socklen_t msg_namelen;
- struct iovec *msg_iov;
- int msg_iovlen, __pad1;
- void *msg_control;
- socklen_t msg_controllen, __pad2;
- int msg_flags;
-};
-
-struct cmsghdr {
- socklen_t cmsg_len;
- int __pad1;
- int cmsg_level;
- int cmsg_type;
-};
diff --git a/lib/libc/musl/arch/x86_64/bits/syscall.h.in b/lib/libc/musl/arch/x86_64/bits/syscall.h.in
index 2d4634f68359d5514e0e762ad834cf65fe7926cd..6a646ad3462322aaafe42a076f4bf3b4df048c19 100644
--- a/lib/libc/musl/arch/x86_64/bits/syscall.h.in
+++ b/lib/libc/musl/arch/x86_64/bits/syscall.h.in
@@ -343,4 +343,6 @@
#define __NR_fsconfig 431
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_pidfd_open 434
+#define __NR_clone3 435
diff --git a/lib/libc/musl/compat/time32/__xstat.c b/lib/libc/musl/compat/time32/__xstat.c
new file mode 100644
index 0000000000000000000000000000000000000000..acfbd3cc522a2fbea6fc448b7f9fe1a9ff2cc13e
--- /dev/null
+++ b/lib/libc/musl/compat/time32/__xstat.c
@@ -0,0 +1,24 @@
+#include "time32.h"
+#include
+
+struct stat32;
+
+int __fxstat64(int ver, int fd, struct stat32 *buf)
+{
+ return __fstat_time32(fd, buf);
+}
+
+int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf, int flag)
+{
+ return __fstatat_time32(fd, path, buf, flag);
+}
+
+int __lxstat64(int ver, const char *path, struct stat32 *buf)
+{
+ return __lstat_time32(path, buf);
+}
+
+int __xstat64(int ver, const char *path, struct stat32 *buf)
+{
+ return __stat_time32(path, buf);
+}
diff --git a/lib/libc/musl/compat/time32/adjtime32.c b/lib/libc/musl/compat/time32/adjtime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..b0042c631736bbfb8e5e6495b919025937d0afc0
--- /dev/null
+++ b/lib/libc/musl/compat/time32/adjtime32.c
@@ -0,0 +1,21 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+int __adjtime32(const struct timeval32 *in32, struct timeval32 *out32)
+{
+ struct timeval out;
+ int r = adjtime((&(struct timeval){
+ .tv_sec = in32->tv_sec,
+ .tv_usec = in32->tv_usec}), &out);
+ if (r) return r;
+ /* We can't range-check the result because success was already
+ * committed by the above call. */
+ if (out32) {
+ out32->tv_sec = out.tv_sec;
+ out32->tv_usec = out.tv_usec;
+ }
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/adjtimex_time32.c b/lib/libc/musl/compat/time32/adjtimex_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..9c6f190abe030a03a9bfed298ecc9b6364960865
--- /dev/null
+++ b/lib/libc/musl/compat/time32/adjtimex_time32.c
@@ -0,0 +1,10 @@
+#include "time32.h"
+#include
+#include
+
+struct timex32;
+
+int __adjtimex_time32(struct timex32 *tx32)
+{
+ return __clock_adjtime32(CLOCK_REALTIME, tx32);
+}
diff --git a/lib/libc/musl/compat/time32/aio_suspend_time32.c b/lib/libc/musl/compat/time32/aio_suspend_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..ed5119bd7df791da94e6230395cfd459ce4a5eb3
--- /dev/null
+++ b/lib/libc/musl/compat/time32/aio_suspend_time32.c
@@ -0,0 +1,11 @@
+#include "time32.h"
+#include
+#include
+
+int __aio_suspend_time32(const struct aiocb *const cbs[], int cnt, const struct timespec32 *ts32)
+{
+ return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
+}
+
+weak_alias(aio_suspend, aio_suspend64);
diff --git a/lib/libc/musl/compat/time32/clock_adjtime32.c b/lib/libc/musl/compat/time32/clock_adjtime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..5a25b8ac02a5acc84a50ac1ed6ac336b9d2c28ba
--- /dev/null
+++ b/lib/libc/musl/compat/time32/clock_adjtime32.c
@@ -0,0 +1,70 @@
+#include "time32.h"
+#include
+#include
+#include
+#include
+#include
+
+struct timex32 {
+ unsigned modes;
+ long offset, freq, maxerror, esterror;
+ int status;
+ long constant, precision, tolerance;
+ struct timeval32 time;
+ long tick, ppsfreq, jitter;
+ int shift;
+ long stabil, jitcnt, calcnt, errcnt, stbcnt;
+ int tai;
+ int __padding[11];
+};
+
+int __clock_adjtime32(clockid_t clock_id, struct timex32 *tx32)
+{
+ struct timex utx = {
+ .modes = tx32->modes,
+ .offset = tx32->offset,
+ .freq = tx32->freq,
+ .maxerror = tx32->maxerror,
+ .esterror = tx32->esterror,
+ .status = tx32->status,
+ .constant = tx32->constant,
+ .precision = tx32->precision,
+ .tolerance = tx32->tolerance,
+ .time.tv_sec = tx32->time.tv_sec,
+ .time.tv_usec = tx32->time.tv_usec,
+ .tick = tx32->tick,
+ .ppsfreq = tx32->ppsfreq,
+ .jitter = tx32->jitter,
+ .shift = tx32->shift,
+ .stabil = tx32->stabil,
+ .jitcnt = tx32->jitcnt,
+ .calcnt = tx32->calcnt,
+ .errcnt = tx32->errcnt,
+ .stbcnt = tx32->stbcnt,
+ .tai = tx32->tai,
+ };
+ int r = clock_adjtime(clock_id, &utx);
+ if (r<0) return r;
+ tx32->modes = utx.modes;
+ tx32->offset = utx.offset;
+ tx32->freq = utx.freq;
+ tx32->maxerror = utx.maxerror;
+ tx32->esterror = utx.esterror;
+ tx32->status = utx.status;
+ tx32->constant = utx.constant;
+ tx32->precision = utx.precision;
+ tx32->tolerance = utx.tolerance;
+ tx32->time.tv_sec = utx.time.tv_sec;
+ tx32->time.tv_usec = utx.time.tv_usec;
+ tx32->tick = utx.tick;
+ tx32->ppsfreq = utx.ppsfreq;
+ tx32->jitter = utx.jitter;
+ tx32->shift = utx.shift;
+ tx32->stabil = utx.stabil;
+ tx32->jitcnt = utx.jitcnt;
+ tx32->calcnt = utx.calcnt;
+ tx32->errcnt = utx.errcnt;
+ tx32->stbcnt = utx.stbcnt;
+ tx32->tai = utx.tai;
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/clock_getres_time32.c b/lib/libc/musl/compat/time32/clock_getres_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..47a24c1350893504a1e143fad3f6192b1e880f56
--- /dev/null
+++ b/lib/libc/musl/compat/time32/clock_getres_time32.c
@@ -0,0 +1,13 @@
+#include "time32.h"
+#include
+
+int __clock_getres_time32(clockid_t clk, struct timespec32 *ts32)
+{
+ struct timespec ts;
+ int r = clock_getres(clk, &ts);
+ if (!r && ts32) {
+ ts32->tv_sec = ts.tv_sec;
+ ts32->tv_nsec = ts.tv_nsec;
+ }
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/clock_gettime32.c b/lib/libc/musl/compat/time32/clock_gettime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..0cac7bbdf6dc1f2963e25ea0a592820eb3193ea6
--- /dev/null
+++ b/lib/libc/musl/compat/time32/clock_gettime32.c
@@ -0,0 +1,18 @@
+#include "time32.h"
+#include
+#include
+#include
+
+int __clock_gettime32(clockid_t clk, struct timespec32 *ts32)
+{
+ struct timespec ts;
+ int r = clock_gettime(clk, &ts);
+ if (r) return r;
+ if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ ts32->tv_sec = ts.tv_sec;
+ ts32->tv_nsec = ts.tv_nsec;
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/clock_nanosleep_time32.c b/lib/libc/musl/compat/time32/clock_nanosleep_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..91ef067d0294a9b9ad3f06858354ae5151f5e225
--- /dev/null
+++ b/lib/libc/musl/compat/time32/clock_nanosleep_time32.c
@@ -0,0 +1,15 @@
+#include "time32.h"
+#include
+#include
+
+int __clock_nanosleep_time32(clockid_t clk, int flags, const struct timespec32 *req32, struct timespec32 *rem32)
+{
+ struct timespec rem;
+ int ret = clock_nanosleep(clk, flags, (&(struct timespec){
+ .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
+ if (ret==EINTR && rem32 && !(flags & TIMER_ABSTIME)) {
+ rem32->tv_sec = rem.tv_sec;
+ rem32->tv_nsec = rem.tv_nsec;
+ }
+ return ret;
+}
diff --git a/lib/libc/musl/compat/time32/clock_settime32.c b/lib/libc/musl/compat/time32/clock_settime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..7ca4f0e9c79d2776fa76c1abb780c2255ed147ec
--- /dev/null
+++ b/lib/libc/musl/compat/time32/clock_settime32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+
+int __clock_settime32(clockid_t clk, const struct timespec32 *ts32)
+{
+ return clock_settime(clk, (&(struct timespec){
+ .tv_sec = ts32->tv_sec,
+ .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/cnd_timedwait_time32.c b/lib/libc/musl/compat/time32/cnd_timedwait_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..314251d1c16374f7d8f3c6a59b2b39158aae19d9
--- /dev/null
+++ b/lib/libc/musl/compat/time32/cnd_timedwait_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __cnd_timedwait_time32(cnd_t *restrict c, mtx_t *restrict m, const struct timespec32 *restrict ts32)
+{
+ return cnd_timedwait(c, m, ts32 ? (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
+}
diff --git a/lib/libc/musl/compat/time32/ctime32.c b/lib/libc/musl/compat/time32/ctime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..a057274e155ab7affe3b8e8a015603eb96f707cc
--- /dev/null
+++ b/lib/libc/musl/compat/time32/ctime32.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+char *__ctime32(time32_t *t)
+{
+ return ctime(&(time_t){*t});
+}
diff --git a/lib/libc/musl/compat/time32/ctime32_r.c b/lib/libc/musl/compat/time32/ctime32_r.c
new file mode 100644
index 0000000000000000000000000000000000000000..e1ad2e283aedff676e8c516deb982f2f7f833c4d
--- /dev/null
+++ b/lib/libc/musl/compat/time32/ctime32_r.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+char *__ctime32_r(time32_t *t, char *buf)
+{
+ return ctime_r(&(time_t){*t}, buf);
+}
diff --git a/lib/libc/musl/compat/time32/difftime32.c b/lib/libc/musl/compat/time32/difftime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..5950943a00345e02284eca55bae522781acca35a
--- /dev/null
+++ b/lib/libc/musl/compat/time32/difftime32.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+double __difftime32(time32_t t1, time32_t t2)
+{
+ return difftime(t1, t2);
+}
diff --git a/lib/libc/musl/compat/time32/fstat_time32.c b/lib/libc/musl/compat/time32/fstat_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..3e084398879b6e62327bbdc6f724c9f5e310e3fc
--- /dev/null
+++ b/lib/libc/musl/compat/time32/fstat_time32.c
@@ -0,0 +1,17 @@
+#include "time32.h"
+#include
+#include
+#include
+#include
+
+struct stat32;
+
+int __fstat_time32(int fd, struct stat32 *restrict st32)
+{
+ struct stat st;
+ int r = fstat(fd, &st);
+ if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
+ return r;
+}
+
+weak_alias(fstat, fstat64);
diff --git a/lib/libc/musl/compat/time32/fstatat_time32.c b/lib/libc/musl/compat/time32/fstatat_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..85dcb008edf621076800d6d2dbed4afae7cb7250
--- /dev/null
+++ b/lib/libc/musl/compat/time32/fstatat_time32.c
@@ -0,0 +1,17 @@
+#include "time32.h"
+#include
+#include
+#include
+#include
+
+struct stat32;
+
+int __fstatat_time32(int fd, const char *restrict path, struct stat32 *restrict st32, int flag)
+{
+ struct stat st;
+ int r = fstatat(fd, path, &st, flag);
+ if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
+ return r;
+}
+
+weak_alias(fstatat, fstatat64);
diff --git a/lib/libc/musl/compat/time32/ftime32.c b/lib/libc/musl/compat/time32/ftime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..166a6daeb6b5c17ae0ac5c685dad9678e54c0049
--- /dev/null
+++ b/lib/libc/musl/compat/time32/ftime32.c
@@ -0,0 +1,25 @@
+#include "time32.h"
+#include
+#include
+#include
+
+struct timeb32 {
+ int32_t time;
+ unsigned short millitm;
+ short timezone, dstflag;
+};
+
+int __ftime32(struct timeb32 *tp)
+{
+ struct timeb tb;
+ if (ftime(&tb) < 0) return -1;
+ if (tb.time < INT32_MIN || tb.time > INT32_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ tp->time = tb.time;
+ tp->millitm = tb.millitm;
+ tp->timezone = tb.timezone;
+ tp->dstflag = tb.dstflag;
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/futimens_time32.c b/lib/libc/musl/compat/time32/futimens_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..7856f176e68d5481319d1cde16c4345bf0b0d02f
--- /dev/null
+++ b/lib/libc/musl/compat/time32/futimens_time32.c
@@ -0,0 +1,10 @@
+#include "time32.h"
+#include
+#include
+
+int __futimens_time32(int fd, const struct timespec32 *times32)
+{
+ return futimens(fd, !times32 ? 0 : ((struct timespec[2]){
+ {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec},
+ {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}));
+}
diff --git a/lib/libc/musl/compat/time32/futimes_time32.c b/lib/libc/musl/compat/time32/futimes_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..f29533f12fb1fcdc561048057652b39ee7116c01
--- /dev/null
+++ b/lib/libc/musl/compat/time32/futimes_time32.c
@@ -0,0 +1,12 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+int __futimes_time32(int fd, const struct timeval32 times32[2])
+{
+ return futimes(fd, !times32 ? 0 : ((struct timeval[2]){
+ {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
+ {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
+}
diff --git a/lib/libc/musl/compat/time32/futimesat_time32.c b/lib/libc/musl/compat/time32/futimesat_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..5a1295bde9d7b4dd8b84f1482abbfc7a836c5164
--- /dev/null
+++ b/lib/libc/musl/compat/time32/futimesat_time32.c
@@ -0,0 +1,12 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+int __futimesat_time32(int dirfd, const char *pathname, const struct timeval32 times32[2])
+{
+ return futimesat(dirfd, pathname, !times32 ? 0 : ((struct timeval[2]){
+ {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
+ {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
+}
diff --git a/lib/libc/musl/compat/time32/getitimer_time32.c b/lib/libc/musl/compat/time32/getitimer_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..4bac4bf5265704249e81424ece91f308471d7feb
--- /dev/null
+++ b/lib/libc/musl/compat/time32/getitimer_time32.c
@@ -0,0 +1,15 @@
+#include "time32.h"
+#include
+#include
+
+int __getitimer_time32(int which, struct itimerval32 *old32)
+{
+ struct itimerval old;
+ int r = getitimer(which, &old);
+ if (r) return r;
+ old32->it_interval.tv_sec = old.it_interval.tv_sec;
+ old32->it_interval.tv_usec = old.it_interval.tv_usec;
+ old32->it_value.tv_sec = old.it_value.tv_sec;
+ old32->it_value.tv_usec = old.it_value.tv_usec;
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/getrusage_time32.c b/lib/libc/musl/compat/time32/getrusage_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..d7487dee6eab09dddbb8bd8bdc444b051ab91926
--- /dev/null
+++ b/lib/libc/musl/compat/time32/getrusage_time32.c
@@ -0,0 +1,39 @@
+#include "time32.h"
+#include
+#include
+#include
+
+struct compat_rusage {
+ struct timeval32 ru_utime;
+ struct timeval32 ru_stime;
+ long ru_maxrss;
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+};
+
+int __getrusage_time32(int who, struct compat_rusage *usage)
+{
+ struct rusage ru;
+ int r = getrusage(who, &ru);
+ if (!r) {
+ usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
+ usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
+ usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
+ usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
+ memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
+ sizeof(struct compat_rusage) -
+ offsetof(struct compat_rusage, ru_maxrss));
+ }
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/gettimeofday_time32.c b/lib/libc/musl/compat/time32/gettimeofday_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..1f3ce68e3e66535f2f92654d85007b709501a87a
--- /dev/null
+++ b/lib/libc/musl/compat/time32/gettimeofday_time32.c
@@ -0,0 +1,19 @@
+#include "time32.h"
+#include
+#include
+#include
+
+int __gettimeofday_time32(struct timeval32 *tv32, void *tz)
+{
+ struct timeval tv;
+ if (!tv32) return 0;
+ int r = gettimeofday(&tv, 0);
+ if (r) return r;
+ if (tv.tv_sec < INT32_MIN || tv.tv_sec > INT32_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ tv32->tv_sec = tv.tv_sec;
+ tv32->tv_usec = tv.tv_usec;
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/gmtime32.c b/lib/libc/musl/compat/time32/gmtime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..963f0e0525983be3a31e8493511bbadf1afcd0aa
--- /dev/null
+++ b/lib/libc/musl/compat/time32/gmtime32.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+struct tm *__gmtime32(time32_t *t)
+{
+ return gmtime(&(time_t){*t});
+}
diff --git a/lib/libc/musl/compat/time32/gmtime32_r.c b/lib/libc/musl/compat/time32/gmtime32_r.c
new file mode 100644
index 0000000000000000000000000000000000000000..7d72bfb3205ebdfaf985413eab2b73ca4dbe3a1d
--- /dev/null
+++ b/lib/libc/musl/compat/time32/gmtime32_r.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+struct tm *__gmtime32_r(time32_t *t, struct tm *tm)
+{
+ return gmtime_r(&(time_t){*t}, tm);
+}
diff --git a/lib/libc/musl/compat/time32/localtime32.c b/lib/libc/musl/compat/time32/localtime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..96bc303490106191ec6547d2f907da6720cb6f9c
--- /dev/null
+++ b/lib/libc/musl/compat/time32/localtime32.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+struct tm *__localtime32(time32_t *t)
+{
+ return localtime(&(time_t){*t});
+}
diff --git a/lib/libc/musl/compat/time32/localtime32_r.c b/lib/libc/musl/compat/time32/localtime32_r.c
new file mode 100644
index 0000000000000000000000000000000000000000..633ec8293f1fd630b53b988b8cde85f9c8b05679
--- /dev/null
+++ b/lib/libc/musl/compat/time32/localtime32_r.c
@@ -0,0 +1,7 @@
+#include "time32.h"
+#include
+
+struct tm *__localtime32_r(time32_t *t, struct tm *tm)
+{
+ return localtime_r(&(time_t){*t}, tm);
+}
diff --git a/lib/libc/musl/compat/time32/lstat_time32.c b/lib/libc/musl/compat/time32/lstat_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..c1257a1449a69baa03638070c81d900b8d629c9f
--- /dev/null
+++ b/lib/libc/musl/compat/time32/lstat_time32.c
@@ -0,0 +1,17 @@
+#include "time32.h"
+#include
+#include
+#include
+#include
+
+struct stat32;
+
+int __lstat_time32(const char *restrict path, struct stat32 *restrict st32)
+{
+ struct stat st;
+ int r = lstat(path, &st);
+ if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
+ return r;
+}
+
+weak_alias(lstat, lstat64);
diff --git a/lib/libc/musl/compat/time32/lutimes_time32.c b/lib/libc/musl/compat/time32/lutimes_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..7f75cd4a185ad1b3655adacea049b317b3c014f5
--- /dev/null
+++ b/lib/libc/musl/compat/time32/lutimes_time32.c
@@ -0,0 +1,12 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+int __lutimes_time32(const char *path, const struct timeval32 times32[2])
+{
+ return lutimes(path, !times32 ? 0 : ((struct timeval[2]){
+ {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
+ {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
+}
diff --git a/lib/libc/musl/compat/time32/mktime32.c b/lib/libc/musl/compat/time32/mktime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..e6f15d513a4dc3a40b57bbe2c93482f593a43ef8
--- /dev/null
+++ b/lib/libc/musl/compat/time32/mktime32.c
@@ -0,0 +1,16 @@
+#include "time32.h"
+#include
+#include
+#include
+
+time32_t __mktime32(struct tm *tm)
+{
+ struct tm tmp = *tm;
+ time_t t = mktime(&tmp);
+ if (t < INT32_MIN || t > INT32_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ *tm = tmp;
+ return t;
+}
diff --git a/lib/libc/musl/compat/time32/mq_timedreceive_time32.c b/lib/libc/musl/compat/time32/mq_timedreceive_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..211cea4ba4ed6fe91c8f35ebf41e05dd7c4b04e1
--- /dev/null
+++ b/lib/libc/musl/compat/time32/mq_timedreceive_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+ssize_t __mq_timedreceive_time32(mqd_t mqd, char *restrict msg, size_t len, unsigned *restrict prio, const struct timespec32 *restrict ts32)
+{
+ return mq_timedreceive(mqd, msg, len, prio, ts32 ? (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
+}
diff --git a/lib/libc/musl/compat/time32/mq_timedsend_time32.c b/lib/libc/musl/compat/time32/mq_timedsend_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..93b697a7e1206f00311fe5666eb11cb4030536ac
--- /dev/null
+++ b/lib/libc/musl/compat/time32/mq_timedsend_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __mq_timedsend_time32(mqd_t mqd, const char *msg, size_t len, unsigned prio, const struct timespec32 *ts32)
+{
+ return mq_timedsend(mqd, msg, len, prio, ts32 ? (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
+}
diff --git a/lib/libc/musl/compat/time32/mtx_timedlock_time32.c b/lib/libc/musl/compat/time32/mtx_timedlock_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..a01f09b89dfbcf1ca7582b81b57447fb81aabc83
--- /dev/null
+++ b/lib/libc/musl/compat/time32/mtx_timedlock_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __mtx_timedlock_time32(mtx_t *restrict m, const struct timespec32 *restrict ts32)
+{
+ return mtx_timedlock(m, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/nanosleep_time32.c b/lib/libc/musl/compat/time32/nanosleep_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..ea6bdd81b14add4838dd94ba8985294a5d2fd006
--- /dev/null
+++ b/lib/libc/musl/compat/time32/nanosleep_time32.c
@@ -0,0 +1,15 @@
+#include "time32.h"
+#include
+#include
+
+int __nanosleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
+{
+ struct timespec rem;
+ int ret = nanosleep((&(struct timespec){
+ .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
+ if (ret<0 && errno==EINTR && rem32) {
+ rem32->tv_sec = rem.tv_sec;
+ rem32->tv_nsec = rem.tv_nsec;
+ }
+ return ret;
+}
diff --git a/lib/libc/musl/compat/time32/ppoll_time32.c b/lib/libc/musl/compat/time32/ppoll_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..43b4b0df6f8e99cf3301e229aa65777878056055
--- /dev/null
+++ b/lib/libc/musl/compat/time32/ppoll_time32.c
@@ -0,0 +1,10 @@
+#include "time32.h"
+#define _GNU_SOURCE
+#include
+#include
+
+int __ppoll_time32(struct pollfd *fds, nfds_t n, const struct timespec32 *ts32, const sigset_t *mask)
+{
+ return ppoll(fds, n, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
+}
diff --git a/lib/libc/musl/compat/time32/pselect_time32.c b/lib/libc/musl/compat/time32/pselect_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..ecaa8f868dbf49315c00ad0951642e74cd4d83f1
--- /dev/null
+++ b/lib/libc/musl/compat/time32/pselect_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __pselect_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, const struct timespec32 *restrict ts32, const sigset_t *restrict mask)
+{
+ return pselect(n, rfds, wfds, efds, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
+}
diff --git a/lib/libc/musl/compat/time32/pthread_cond_timedwait_time32.c b/lib/libc/musl/compat/time32/pthread_cond_timedwait_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..fba1f2a9140655e69245852fa2283d82f019e8a7
--- /dev/null
+++ b/lib/libc/musl/compat/time32/pthread_cond_timedwait_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __pthread_cond_timedwait_time32(pthread_cond_t *restrict c, pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32)
+{
+ return pthread_cond_timedwait(c, m, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/pthread_mutex_timedlock_time32.c b/lib/libc/musl/compat/time32/pthread_mutex_timedlock_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..2d29602cb7c804a6fc8d301931162949aa51426c
--- /dev/null
+++ b/lib/libc/musl/compat/time32/pthread_mutex_timedlock_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __pthread_mutex_timedlock_time32(pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32)
+{
+ return pthread_mutex_timedlock(m, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c b/lib/libc/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..33df27a4ad62b0bab5f2bd00d067b5fe4c7f6eb6
--- /dev/null
+++ b/lib/libc/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __pthread_rwlock_timedrdlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32)
+{
+ return pthread_rwlock_timedrdlock(rw, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c b/lib/libc/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..99f24f734dcc1d1c0c5962795e64945a7ea08848
--- /dev/null
+++ b/lib/libc/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __pthread_rwlock_timedwrlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32)
+{
+ return pthread_rwlock_timedwrlock(rw, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/pthread_timedjoin_np_time32.c b/lib/libc/musl/compat/time32/pthread_timedjoin_np_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..3ec2995115345144d0d3e1b45e2c9638c21bfb6a
--- /dev/null
+++ b/lib/libc/musl/compat/time32/pthread_timedjoin_np_time32.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+#include
+
+int __pthread_timedjoin_np_time32(pthread_t t, void **res, const struct timespec32 *at32)
+{
+ return pthread_timedjoin_np(t, res, !at32 ? 0 : (&(struct timespec){
+ .tv_sec = at32->tv_sec, .tv_nsec = at32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/recvmmsg_time32.c b/lib/libc/musl/compat/time32/recvmmsg_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..acf1cfb8c0a55b5f857080d0de51877727060f68
--- /dev/null
+++ b/lib/libc/musl/compat/time32/recvmmsg_time32.c
@@ -0,0 +1,10 @@
+#include "time32.h"
+#define _GNU_SOURCE
+#include
+#include
+
+int __recvmmsg_time32(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec32 *ts32)
+{
+ return recvmmsg(fd, msgvec, vlen, flags, ts32 ? (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
+}
diff --git a/lib/libc/musl/compat/time32/sched_rr_get_interval_time32.c b/lib/libc/musl/compat/time32/sched_rr_get_interval_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..36cbbaca02f9105a33268c18739fce842500b236
--- /dev/null
+++ b/lib/libc/musl/compat/time32/sched_rr_get_interval_time32.c
@@ -0,0 +1,13 @@
+#include "time32.h"
+#include
+#include
+
+int __sched_rr_get_interval_time32(pid_t pid, struct timespec32 *ts32)
+{
+ struct timespec ts;
+ int r = sched_rr_get_interval(pid, &ts);
+ if (r) return r;
+ ts32->tv_sec = ts.tv_sec;
+ ts32->tv_nsec = ts.tv_nsec;
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/select_time32.c b/lib/libc/musl/compat/time32/select_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..2d8df9acaf4e8f00b8836448afb49b1902a79059
--- /dev/null
+++ b/lib/libc/musl/compat/time32/select_time32.c
@@ -0,0 +1,10 @@
+#include "time32.h"
+#include
+#include
+#include
+
+int __select_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, struct timeval32 *restrict tv32)
+{
+ return select(n, rfds, wfds, efds, !tv32 ? 0 : (&(struct timeval){
+ .tv_sec = tv32->tv_sec, .tv_usec = tv32->tv_usec}));
+}
diff --git a/lib/libc/musl/compat/time32/sem_timedwait_time32.c b/lib/libc/musl/compat/time32/sem_timedwait_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..c3469f9bc3c81328823d745fd59de72ffa79e993
--- /dev/null
+++ b/lib/libc/musl/compat/time32/sem_timedwait_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __sem_timedwait_time32(sem_t *sem, const struct timespec32 *restrict ts32)
+{
+ return sem_timedwait(sem, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/semtimedop_time32.c b/lib/libc/musl/compat/time32/semtimedop_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..34ec528199aafc57f76bcfb173a6c315dc82f6df
--- /dev/null
+++ b/lib/libc/musl/compat/time32/semtimedop_time32.c
@@ -0,0 +1,10 @@
+#include "time32.h"
+#define _GNU_SOURCE
+#include
+#include
+
+int __semtimedop_time32(int id, struct sembuf *buf, size_t n, const struct timespec32 *ts32)
+{
+ return semtimedop(id, buf, n, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/setitimer_time32.c b/lib/libc/musl/compat/time32/setitimer_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..2475fd8c1110c78b21f15baf2e8a979e6861bc26
--- /dev/null
+++ b/lib/libc/musl/compat/time32/setitimer_time32.c
@@ -0,0 +1,25 @@
+#include "time32.h"
+#include
+#include
+
+int __setitimer_time32(int which, const struct itimerval32 *restrict new32, struct itimerval32 *restrict old32)
+{
+ struct itimerval old;
+ int r = setitimer(which, (&(struct itimerval){
+ .it_interval.tv_sec = new32->it_interval.tv_sec,
+ .it_interval.tv_usec = new32->it_interval.tv_usec,
+ .it_value.tv_sec = new32->it_value.tv_sec,
+ .it_value.tv_usec = new32->it_value.tv_usec}), &old);
+ if (r) return r;
+ /* The above call has already committed to success by changing the
+ * timer setting, so we can't fail on out-of-range old value.
+ * Since these are relative times, values large enough to overflow
+ * don't make sense anyway. */
+ if (old32) {
+ old32->it_interval.tv_sec = old.it_interval.tv_sec;
+ old32->it_interval.tv_usec = old.it_interval.tv_usec;
+ old32->it_value.tv_sec = old.it_value.tv_sec;
+ old32->it_value.tv_usec = old.it_value.tv_usec;
+ }
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/settimeofday_time32.c b/lib/libc/musl/compat/time32/settimeofday_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..09e625cba3fe9c86eb952339bfb190c2517cc42a
--- /dev/null
+++ b/lib/libc/musl/compat/time32/settimeofday_time32.c
@@ -0,0 +1,10 @@
+#define _BSD_SOURCE
+#include "time32.h"
+#include
+
+int __settimeofday_time32(const struct timeval32 *tv32, const void *tz)
+{
+ return settimeofday(!tv32 ? 0 : (&(struct timeval){
+ .tv_sec = tv32->tv_sec,
+ .tv_usec = tv32->tv_usec}), 0);
+}
diff --git a/lib/libc/musl/compat/time32/sigtimedwait_time32.c b/lib/libc/musl/compat/time32/sigtimedwait_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..6b3aa39c72fb6d2fb65dfcbf293511869d0e2774
--- /dev/null
+++ b/lib/libc/musl/compat/time32/sigtimedwait_time32.c
@@ -0,0 +1,9 @@
+#include "time32.h"
+#include
+#include
+
+int __sigtimedwait_time32(const sigset_t *restrict set, siginfo_t *restrict si, const struct timespec32 *restrict ts32)
+{
+ return sigtimedwait(set, si, !ts32 ? 0 : (&(struct timespec){
+ .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
+}
diff --git a/lib/libc/musl/compat/time32/stat_time32.c b/lib/libc/musl/compat/time32/stat_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..8c6121dadd2ba197906ec1728790ee216071442e
--- /dev/null
+++ b/lib/libc/musl/compat/time32/stat_time32.c
@@ -0,0 +1,17 @@
+#include "time32.h"
+#include
+#include
+#include
+#include
+
+struct stat32;
+
+int __stat_time32(const char *restrict path, struct stat32 *restrict st32)
+{
+ struct stat st;
+ int r = stat(path, &st);
+ if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
+ return r;
+}
+
+weak_alias(stat, stat64);
diff --git a/lib/libc/musl/compat/time32/stime32.c b/lib/libc/musl/compat/time32/stime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..cc76364d3b91e1e8c6f9718a6a90667c3d4934a9
--- /dev/null
+++ b/lib/libc/musl/compat/time32/stime32.c
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+
+int __stime32(const time32_t *t)
+{
+ return stime(&(time_t){*t});
+}
diff --git a/lib/libc/musl/compat/time32/thrd_sleep_time32.c b/lib/libc/musl/compat/time32/thrd_sleep_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..59088001b22039bafc5a637669816f2dd3357a67
--- /dev/null
+++ b/lib/libc/musl/compat/time32/thrd_sleep_time32.c
@@ -0,0 +1,16 @@
+#include "time32.h"
+#include
+#include
+#include
+
+int __thrd_sleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
+{
+ struct timespec rem;
+ int ret = thrd_sleep((&(struct timespec){
+ .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
+ if (ret<0 && errno==EINTR && rem32) {
+ rem32->tv_sec = rem.tv_sec;
+ rem32->tv_nsec = rem.tv_nsec;
+ }
+ return ret;
+}
diff --git a/lib/libc/musl/compat/time32/time32.c b/lib/libc/musl/compat/time32/time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..4b8fac1c291eb941dd531d0f450656a6cf1cb82e
--- /dev/null
+++ b/lib/libc/musl/compat/time32/time32.c
@@ -0,0 +1,15 @@
+#include "time32.h"
+#include
+#include
+#include
+
+time32_t __time32(time32_t *p)
+{
+ time_t t = time(0);
+ if (t < INT32_MIN || t > INT32_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ if (p) *p = t;
+ return t;
+}
diff --git a/lib/libc/musl/compat/time32/time32.h b/lib/libc/musl/compat/time32/time32.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdec17c345d0e489034c956cd7454c61d971e8f2
--- /dev/null
+++ b/lib/libc/musl/compat/time32/time32.h
@@ -0,0 +1,91 @@
+#ifndef TIME32_H
+#define TIME32_H
+
+#include
+
+typedef long time32_t;
+
+struct timeval32 {
+ long tv_sec;
+ long tv_usec;
+};
+
+struct itimerval32 {
+ struct timeval32 it_interval;
+ struct timeval32 it_value;
+};
+
+struct timespec32 {
+ long tv_sec;
+ long tv_nsec;
+};
+
+struct itimerspec32 {
+ struct timespec32 it_interval;
+ struct timespec32 it_value;
+};
+
+int __adjtime32() __asm__("adjtime");
+int __adjtimex_time32() __asm__("adjtimex");
+int __aio_suspend_time32() __asm__("aio_suspend");
+int __clock_adjtime32() __asm__("clock_adjtime");
+int __clock_getres_time32() __asm__("clock_getres");
+int __clock_gettime32() __asm__("clock_gettime");
+int __clock_nanosleep_time32() __asm__("clock_nanosleep");
+int __clock_settime32() __asm__("clock_settime");
+int __cnd_timedwait_time32() __asm__("cnd_timedwait");
+char *__ctime32() __asm__("ctime");
+char *__ctime32_r() __asm__("ctime_r");
+double __difftime32() __asm__("difftime");
+int __fstat_time32() __asm__("fstat");
+int __fstatat_time32() __asm__("fstatat");
+int __ftime32() __asm__("ftime");
+int __futimens_time32() __asm__("futimens");
+int __futimes_time32() __asm__("futimes");
+int __futimesat_time32() __asm__("futimesat");
+int __getitimer_time32() __asm__("getitimer");
+int __getrusage_time32() __asm__("getrusage");
+int __gettimeofday_time32() __asm__("gettimeofday");
+struct tm *__gmtime32() __asm__("gmtime");
+struct tm *__gmtime32_r() __asm__("gmtime_r");
+struct tm *__localtime32() __asm__("localtime");
+struct tm *__localtime32_r() __asm__("localtime_r");
+int __lstat_time32() __asm__("lstat");
+int __lutimes_time32() __asm__("lutimes");
+time32_t __mktime32() __asm__("mktime");
+ssize_t __mq_timedreceive_time32() __asm__("mq_timedreceive");
+int __mq_timedsend_time32() __asm__("mq_timedsend");
+int __mtx_timedlock_time32() __asm__("mtx_timedlock");
+int __nanosleep_time32() __asm__("nanosleep");
+int __ppoll_time32() __asm__("ppoll");
+int __pselect_time32() __asm__("pselect");
+int __pthread_cond_timedwait_time32() __asm__("pthread_cond_timedwait");
+int __pthread_mutex_timedlock_time32() __asm__("pthread_mutex_timedlock");
+int __pthread_rwlock_timedrdlock_time32() __asm__("pthread_rwlock_timedrdlock");
+int __pthread_rwlock_timedwrlock_time32() __asm__("pthread_rwlock_timedwrlock");
+int __pthread_timedjoin_np_time32() __asm__("pthread_timedjoin_np");
+int __recvmmsg_time32() __asm__("recvmmsg");
+int __sched_rr_get_interval_time32() __asm__("sched_rr_get_interval");
+int __select_time32() __asm__("select");
+int __sem_timedwait_time32() __asm__("sem_timedwait");
+int __semtimedop_time32() __asm__("semtimedop");
+int __setitimer_time32() __asm__("setitimer");
+int __settimeofday_time32() __asm__("settimeofday");
+int __sigtimedwait_time32() __asm__("sigtimedwait");
+int __stat_time32() __asm__("stat");
+int __stime32() __asm__("stime");
+int __thrd_sleep_time32() __asm__("thrd_sleep");
+time32_t __time32() __asm__("time");
+time32_t __time32gm() __asm__("timegm");
+int __timer_gettime32() __asm__("timer_gettime");
+int __timer_settime32() __asm__("timer_settime");
+int __timerfd_gettime32() __asm__("timerfd_gettime");
+int __timerfd_settime32() __asm__("timerfd_settime");
+int __timespec_get_time32() __asm__("timespec_get");
+int __utime_time32() __asm__("utime");
+int __utimensat_time32() __asm__("utimensat");
+int __utimes_time32() __asm__("utimes");
+pid_t __wait3_time32() __asm__("wait3");
+pid_t __wait4_time32() __asm__("wait4");
+
+#endif
diff --git a/lib/libc/musl/compat/time32/time32gm.c b/lib/libc/musl/compat/time32/time32gm.c
new file mode 100644
index 0000000000000000000000000000000000000000..60d68fbf84922e4b2fea41a25c9aa4860cf7fed4
--- /dev/null
+++ b/lib/libc/musl/compat/time32/time32gm.c
@@ -0,0 +1,15 @@
+#define _GNU_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+time32_t __time32gm(struct tm *tm)
+{
+ time_t t = timegm(tm);
+ if (t < INT32_MIN || t > INT32_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ return t;
+}
diff --git a/lib/libc/musl/compat/time32/timer_gettime32.c b/lib/libc/musl/compat/time32/timer_gettime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..b4184cc28374c984b406cb54829f9c4f62c6d61e
--- /dev/null
+++ b/lib/libc/musl/compat/time32/timer_gettime32.c
@@ -0,0 +1,15 @@
+#include "time32.h"
+#include
+
+int __timer_gettime32(timer_t t, struct itimerspec32 *val32)
+{
+ struct itimerspec old;
+ int r = timer_gettime(t, &old);
+ if (r) return r;
+ /* No range checking for consistency with settime */
+ val32->it_interval.tv_sec = old.it_interval.tv_sec;
+ val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
+ val32->it_value.tv_sec = old.it_value.tv_sec;
+ val32->it_value.tv_nsec = old.it_value.tv_nsec;
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/timer_settime32.c b/lib/libc/musl/compat/time32/timer_settime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..a447e7d41aa79081b106e396e52822923d85d334
--- /dev/null
+++ b/lib/libc/musl/compat/time32/timer_settime32.c
@@ -0,0 +1,25 @@
+#include "time32.h"
+#include
+
+int __timer_settime32(timer_t t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32)
+{
+ struct itimerspec old;
+ int r = timer_settime(t, flags, (&(struct itimerspec){
+ .it_interval.tv_sec = val32->it_interval.tv_sec,
+ .it_interval.tv_nsec = val32->it_interval.tv_nsec,
+ .it_value.tv_sec = val32->it_value.tv_sec,
+ .it_value.tv_nsec = val32->it_value.tv_nsec}),
+ old32 ? &old : 0);
+ if (r) return r;
+ /* The above call has already committed to success by changing the
+ * timer setting, so we can't fail on out-of-range old value.
+ * Since these are relative times, values large enough to overflow
+ * don't make sense anyway. */
+ if (old32) {
+ old32->it_interval.tv_sec = old.it_interval.tv_sec;
+ old32->it_interval.tv_nsec = old.it_interval.tv_nsec;
+ old32->it_value.tv_sec = old.it_value.tv_sec;
+ old32->it_value.tv_nsec = old.it_value.tv_nsec;
+ }
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/timerfd_gettime32.c b/lib/libc/musl/compat/time32/timerfd_gettime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..75e5435f18b06455fa3b1d47a32017e823b35ea4
--- /dev/null
+++ b/lib/libc/musl/compat/time32/timerfd_gettime32.c
@@ -0,0 +1,16 @@
+#include "time32.h"
+#include
+#include
+
+int __timerfd_gettime32(int t, struct itimerspec32 *val32)
+{
+ struct itimerspec old;
+ int r = timerfd_gettime(t, &old);
+ if (r) return r;
+ /* No range checking for consistency with settime */
+ val32->it_interval.tv_sec = old.it_interval.tv_sec;
+ val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
+ val32->it_value.tv_sec = old.it_value.tv_sec;
+ val32->it_value.tv_nsec = old.it_value.tv_nsec;
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/timerfd_settime32.c b/lib/libc/musl/compat/time32/timerfd_settime32.c
new file mode 100644
index 0000000000000000000000000000000000000000..67830d34189e30318e077125705ecd246c725d3b
--- /dev/null
+++ b/lib/libc/musl/compat/time32/timerfd_settime32.c
@@ -0,0 +1,26 @@
+#include "time32.h"
+#include
+#include
+
+int __timerfd_settime32(int t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32)
+{
+ struct itimerspec old;
+ int r = timerfd_settime(t, flags, (&(struct itimerspec){
+ .it_interval.tv_sec = val32->it_interval.tv_sec,
+ .it_interval.tv_nsec = val32->it_interval.tv_nsec,
+ .it_value.tv_sec = val32->it_value.tv_sec,
+ .it_value.tv_nsec = val32->it_value.tv_nsec}),
+ old32 ? &old : 0);
+ if (r) return r;
+ /* The above call has already committed to success by changing the
+ * timer setting, so we can't fail on out-of-range old value.
+ * Since these are relative times, values large enough to overflow
+ * don't make sense anyway. */
+ if (old32) {
+ old32->it_interval.tv_sec = old.it_interval.tv_sec;
+ old32->it_interval.tv_nsec = old.it_interval.tv_nsec;
+ old32->it_value.tv_sec = old.it_value.tv_sec;
+ old32->it_value.tv_nsec = old.it_value.tv_nsec;
+ }
+ return 0;
+}
diff --git a/lib/libc/musl/compat/time32/timespec_get_time32.c b/lib/libc/musl/compat/time32/timespec_get_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..e9ca94cb42a58ccb142676f0cce1776e8bed8585
--- /dev/null
+++ b/lib/libc/musl/compat/time32/timespec_get_time32.c
@@ -0,0 +1,18 @@
+#include "time32.h"
+#include
+#include
+#include
+
+int __timespec_get_time32(struct timespec32 *ts32, int base)
+{
+ struct timespec ts;
+ int r = timespec_get(&ts, base);
+ if (!r) return r;
+ if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) {
+ errno = EOVERFLOW;
+ return 0;
+ }
+ ts32->tv_sec = ts.tv_sec;
+ ts32->tv_nsec = ts.tv_nsec;
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/utime_time32.c b/lib/libc/musl/compat/time32/utime_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..65f11d463413f78b37b7e0511918ffa9569408cb
--- /dev/null
+++ b/lib/libc/musl/compat/time32/utime_time32.c
@@ -0,0 +1,14 @@
+#include "time32.h"
+#include
+#include
+
+struct utimbuf32 {
+ time32_t actime;
+ time32_t modtime;
+};
+
+int __utime_time32(const char *path, const struct utimbuf32 *times32)
+{
+ return utime(path, !times32 ? 0 : (&(struct utimbuf){
+ .actime = times32->actime, .modtime = times32->modtime}));
+}
diff --git a/lib/libc/musl/compat/time32/utimensat_time32.c b/lib/libc/musl/compat/time32/utimensat_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..c687b8d1b4fb8d0cc579fb3fbb36fea37c669724
--- /dev/null
+++ b/lib/libc/musl/compat/time32/utimensat_time32.c
@@ -0,0 +1,11 @@
+#include "time32.h"
+#include
+#include
+
+int __utimensat_time32(int fd, const char *path, const struct timespec32 times32[2], int flags)
+{
+ return utimensat(fd, path, !times32 ? 0 : ((struct timespec[2]){
+ {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec},
+ {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}),
+ flags);
+}
diff --git a/lib/libc/musl/compat/time32/utimes_time32.c b/lib/libc/musl/compat/time32/utimes_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..59248f623bec7766171301ce45776e41fbb298a8
--- /dev/null
+++ b/lib/libc/musl/compat/time32/utimes_time32.c
@@ -0,0 +1,11 @@
+#include "time32.h"
+#include
+#include
+#include
+
+int __utimes_time32(const char *path, const struct timeval32 times32[2])
+{
+ return utimes(path, !times32 ? 0 : ((struct timeval[2]){
+ {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
+ {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
+}
diff --git a/lib/libc/musl/compat/time32/wait3_time32.c b/lib/libc/musl/compat/time32/wait3_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..8fe128edbfae0b12bb5001d48ce9c4940a5e9979
--- /dev/null
+++ b/lib/libc/musl/compat/time32/wait3_time32.c
@@ -0,0 +1,40 @@
+#define _BSD_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+struct compat_rusage {
+ struct timeval32 ru_utime;
+ struct timeval32 ru_stime;
+ long ru_maxrss;
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+};
+
+pid_t __wait3_time32(int *status, int options, struct compat_rusage *usage)
+{
+ struct rusage ru;
+ int r = wait3(status, options, usage ? &ru : 0);
+ if (!r && usage) {
+ usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
+ usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
+ usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
+ usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
+ memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
+ sizeof(struct compat_rusage) -
+ offsetof(struct compat_rusage, ru_maxrss));
+ }
+ return r;
+}
diff --git a/lib/libc/musl/compat/time32/wait4_time32.c b/lib/libc/musl/compat/time32/wait4_time32.c
new file mode 100644
index 0000000000000000000000000000000000000000..918548e74f9add2e88d97e7846043b47de6a5df6
--- /dev/null
+++ b/lib/libc/musl/compat/time32/wait4_time32.c
@@ -0,0 +1,40 @@
+#define _BSD_SOURCE
+#include "time32.h"
+#include
+#include
+#include
+
+struct compat_rusage {
+ struct timeval32 ru_utime;
+ struct timeval32 ru_stime;
+ long ru_maxrss;
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+};
+
+pid_t __wait4_time32(pid_t pid, int *status, int options, struct compat_rusage *usage)
+{
+ struct rusage ru;
+ int r = wait4(pid, status, options, usage ? &ru : 0);
+ if (!r && usage) {
+ usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
+ usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
+ usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
+ usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
+ memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
+ sizeof(struct compat_rusage) -
+ offsetof(struct compat_rusage, ru_maxrss));
+ }
+ return r;
+}
diff --git a/lib/libc/musl/include/aio.h b/lib/libc/musl/include/aio.h
index 19bc28a9b19e0d5c3aa90fcf1aa8a36745dcf259..453c41b7489f3d2f27a545db8a9ab072e9ea75d0 100644
--- a/lib/libc/musl/include/aio.h
+++ b/lib/libc/musl/include/aio.h
@@ -62,6 +62,10 @@ int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sige
#define off64_t off_t
#endif
+#if _REDIR_TIME64
+__REDIR(aio_suspend, __aio_suspend_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/alloca.h b/lib/libc/musl/include/alloca.h
index d2e6f1c681eebba9b016df23d2e2fb7a54f5942a..b8d183d144efad9bbe6aa94516bfe6ee6c5aa098 100644
--- a/lib/libc/musl/include/alloca.h
+++ b/lib/libc/musl/include/alloca.h
@@ -10,9 +10,7 @@ extern "C" {
void *alloca(size_t);
-#ifdef __GNUC__
#define alloca __builtin_alloca
-#endif
#ifdef __cplusplus
}
diff --git a/lib/libc/musl/include/alltypes.h.in b/lib/libc/musl/include/alltypes.h.in
index 4cc879b1d70c66343a25cd7481a1ee9f9e86c1fa..d9ff462e1eb4efc877111e2553282c4958c97eca 100644
--- a/lib/libc/musl/include/alltypes.h.in
+++ b/lib/libc/musl/include/alltypes.h.in
@@ -1,3 +1,7 @@
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __USE_TIME_BITS64 1
+
TYPEDEF unsigned _Addr size_t;
TYPEDEF unsigned _Addr uintptr_t;
TYPEDEF _Addr ptrdiff_t;
@@ -5,6 +9,8 @@ TYPEDEF _Addr ssize_t;
TYPEDEF _Addr intptr_t;
TYPEDEF _Addr regoff_t;
TYPEDEF _Reg register_t;
+TYPEDEF _Int64 time_t;
+TYPEDEF _Int64 suseconds_t;
TYPEDEF signed char int8_t;
TYPEDEF signed short int16_t;
@@ -35,7 +41,7 @@ TYPEDEF void * timer_t;
TYPEDEF int clockid_t;
TYPEDEF long clock_t;
STRUCT timeval { time_t tv_sec; suseconds_t tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
+STRUCT timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
TYPEDEF int pid_t;
TYPEDEF unsigned id_t;
@@ -60,6 +66,9 @@ TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
STRUCT _IO_FILE { char __x; };
TYPEDEF struct _IO_FILE FILE;
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+
TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
TYPEDEF struct __locale_struct * locale_t;
@@ -71,6 +80,14 @@ STRUCT iovec { void *iov_base; size_t iov_len; };
TYPEDEF unsigned socklen_t;
TYPEDEF unsigned short sa_family_t;
+TYPEDEF struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
+TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
+TYPEDEF struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
+
#undef _Addr
#undef _Int64
#undef _Reg
diff --git a/lib/libc/musl/include/arpa/nameser.h b/lib/libc/musl/include/arpa/nameser.h
index b315e0f357007cbc0e467cf58574e043c7e06223..581925a43367ae19bfa9cff25bcc022b098f37b6 100644
--- a/lib/libc/musl/include/arpa/nameser.h
+++ b/lib/libc/musl/include/arpa/nameser.h
@@ -7,7 +7,6 @@ extern "C" {
#include
#include
-#include
#define __NAMESER 19991006
#define NS_PACKETSZ 512
diff --git a/lib/libc/musl/include/dirent.h b/lib/libc/musl/include/dirent.h
index e0a8fe6a2f47666ec46755060d38a4a4867ff353..650ecf646ad71c6baf127e328e66ec199ad99ee2 100644
--- a/lib/libc/musl/include/dirent.h
+++ b/lib/libc/musl/include/dirent.h
@@ -15,20 +15,10 @@ extern "C" {
#include
+#include
+
typedef struct __dirstream DIR;
-#define _DIRENT_HAVE_D_RECLEN
-#define _DIRENT_HAVE_D_OFF
-#define _DIRENT_HAVE_D_TYPE
-
-struct dirent {
- ino_t d_ino;
- off_t d_off;
- unsigned short d_reclen;
- unsigned char d_type;
- char d_name[256];
-};
-
#define d_fileno d_ino
int closedir(DIR *);
diff --git a/lib/libc/musl/include/dlfcn.h b/lib/libc/musl/include/dlfcn.h
index 78fb0733b2eb82be221e2e26fb5df369be7bb715..13ab71dd071eb5cdfe0d6cc593d906bf8e6b819d 100644
--- a/lib/libc/musl/include/dlfcn.h
+++ b/lib/libc/musl/include/dlfcn.h
@@ -35,6 +35,10 @@ int dladdr(const void *, Dl_info *);
int dlinfo(void *, int, void *);
#endif
+#if _REDIR_TIME64
+__REDIR(dlsym, __dlsym_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/endian.h b/lib/libc/musl/include/endian.h
index 1bd444518ab5febecb6cec6e2e7693c29359d082..172c43203af12bde8a5cbb6f300fe2a11d2d6663 100644
--- a/lib/libc/musl/include/endian.h
+++ b/lib/libc/musl/include/endian.h
@@ -3,25 +3,19 @@
#include
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
+#define __NEED_uint16_t
+#define __NEED_uint32_t
+#define __NEED_uint64_t
+
+#include
+
#define __PDP_ENDIAN 3412
-#if defined(__GNUC__) && defined(__BYTE_ORDER__)
-#define __BYTE_ORDER __BYTE_ORDER__
-#else
-#include
-#endif
-
-#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-
#define BIG_ENDIAN __BIG_ENDIAN
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define PDP_ENDIAN __PDP_ENDIAN
#define BYTE_ORDER __BYTE_ORDER
-#include
-
static __inline uint16_t __bswap16(uint16_t __x)
{
return __x<<8 | __x>>8;
@@ -40,43 +34,47 @@ static __inline uint64_t __bswap64(uint64_t __x)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htobe16(x) __bswap16(x)
#define be16toh(x) __bswap16(x)
-#define betoh16(x) __bswap16(x)
#define htobe32(x) __bswap32(x)
#define be32toh(x) __bswap32(x)
-#define betoh32(x) __bswap32(x)
#define htobe64(x) __bswap64(x)
#define be64toh(x) __bswap64(x)
-#define betoh64(x) __bswap64(x)
#define htole16(x) (uint16_t)(x)
#define le16toh(x) (uint16_t)(x)
-#define letoh16(x) (uint16_t)(x)
#define htole32(x) (uint32_t)(x)
#define le32toh(x) (uint32_t)(x)
-#define letoh32(x) (uint32_t)(x)
#define htole64(x) (uint64_t)(x)
#define le64toh(x) (uint64_t)(x)
-#define letoh64(x) (uint64_t)(x)
#else
#define htobe16(x) (uint16_t)(x)
#define be16toh(x) (uint16_t)(x)
-#define betoh16(x) (uint16_t)(x)
#define htobe32(x) (uint32_t)(x)
#define be32toh(x) (uint32_t)(x)
-#define betoh32(x) (uint32_t)(x)
#define htobe64(x) (uint64_t)(x)
#define be64toh(x) (uint64_t)(x)
-#define betoh64(x) (uint64_t)(x)
#define htole16(x) __bswap16(x)
#define le16toh(x) __bswap16(x)
-#define letoh16(x) __bswap16(x)
#define htole32(x) __bswap32(x)
#define le32toh(x) __bswap32(x)
-#define letoh32(x) __bswap32(x)
#define htole64(x) __bswap64(x)
#define le64toh(x) __bswap64(x)
+#endif
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define betoh16(x) __bswap16(x)
+#define betoh32(x) __bswap32(x)
+#define betoh64(x) __bswap64(x)
+#define letoh16(x) (uint16_t)(x)
+#define letoh32(x) (uint32_t)(x)
+#define letoh64(x) (uint64_t)(x)
+#else
+#define betoh16(x) (uint16_t)(x)
+#define betoh32(x) (uint32_t)(x)
+#define betoh64(x) (uint64_t)(x)
+#define letoh16(x) __bswap16(x)
+#define letoh32(x) __bswap32(x)
#define letoh64(x) __bswap64(x)
#endif
-
#endif
#endif
diff --git a/lib/libc/musl/include/features.h b/lib/libc/musl/include/features.h
index f4d651efcd0a39b021fec66cdf1469b941654a5a..85cfb72a0d427de18f5732c7fd320310cbe8843d 100644
--- a/lib/libc/musl/include/features.h
+++ b/lib/libc/musl/include/features.h
@@ -35,4 +35,6 @@
#define _Noreturn
#endif
+#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
+
#endif
diff --git a/lib/libc/musl/include/limits.h b/lib/libc/musl/include/limits.h
index 02c2139d27d6e1f80446f0d7d1c2642ac317d71a..53a27b9de43fa0caada15899a5849d717df572ac 100644
--- a/lib/libc/musl/include/limits.h
+++ b/lib/libc/musl/include/limits.h
@@ -3,9 +3,7 @@
#include
-/* Most limits are system-specific */
-
-#include
+#include /* __LONG_MAX */
/* Support signed or unsigned plain-char */
@@ -17,8 +15,6 @@
#define CHAR_MAX 127
#endif
-/* Some universal constants... */
-
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
@@ -30,8 +26,10 @@
#define INT_MAX 0x7fffffff
#define UINT_MAX 0xffffffffU
#define LONG_MIN (-LONG_MAX-1)
+#define LONG_MAX __LONG_MAX
#define ULONG_MAX (2UL*LONG_MAX+1)
#define LLONG_MIN (-LLONG_MAX-1)
+#define LLONG_MAX 0x7fffffffffffffffLL
#define ULLONG_MAX (2ULL*LLONG_MAX+1)
#define MB_LEN_MAX 4
@@ -39,9 +37,13 @@
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#include
+
#define PIPE_BUF 4096
#define FILESIZEBITS 64
+#ifndef NAME_MAX
#define NAME_MAX 255
+#endif
#define PATH_MAX 4096
#define NGROUPS_MAX 32
#define ARG_MAX 131072
@@ -53,6 +55,12 @@
#define TTY_NAME_MAX 32
#define HOST_NAME_MAX 255
+#if LONG_MAX == 0x7fffffffL
+#define LONG_BIT 32
+#else
+#define LONG_BIT 64
+#endif
+
/* Implementation choices... */
#define PTHREAD_KEYS_MAX 128
diff --git a/lib/libc/musl/include/mqueue.h b/lib/libc/musl/include/mqueue.h
index f5cbe79656b3ab2fdcfc18c91229649e77a2c82e..0c807ea0cbb26e6a5d46df5cdb0be6bb8c84ba42 100644
--- a/lib/libc/musl/include/mqueue.h
+++ b/lib/libc/musl/include/mqueue.h
@@ -30,6 +30,11 @@ ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, c
int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *);
int mq_unlink(const char *);
+#if _REDIR_TIME64
+__REDIR(mq_timedreceive, __mq_timedreceive_time64);
+__REDIR(mq_timedsend, __mq_timedsend_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/netinet/icmp6.h b/lib/libc/musl/include/netinet/icmp6.h
index cf951d9133439d2efc11007c70f9b692d4bb1bab..01269e7d4adc44e3f301fe48310066dba5fca478 100644
--- a/lib/libc/musl/include/netinet/icmp6.h
+++ b/lib/libc/musl/include/netinet/icmp6.h
@@ -9,7 +9,6 @@ extern "C" {
#include
#include
#include
-#include
#define ICMP6_FILTER 1
diff --git a/lib/libc/musl/include/netinet/if_ether.h b/lib/libc/musl/include/netinet/if_ether.h
index 8af47dbef55cafb100c830b978165a2d7c028b7c..a08485e7f7cd2ef6da6b184d7d290e42a30f1da9 100644
--- a/lib/libc/musl/include/netinet/if_ether.h
+++ b/lib/libc/musl/include/netinet/if_ether.h
@@ -58,6 +58,7 @@
#define ETH_P_ERSPAN 0x88BE
#define ETH_P_PREAUTH 0x88C7
#define ETH_P_TIPC 0x88CA
+#define ETH_P_LLDP 0x88CC
#define ETH_P_MACSEC 0x88E5
#define ETH_P_8021AH 0x88E7
#define ETH_P_MVRP 0x88F5
diff --git a/lib/libc/musl/include/netinet/ip.h b/lib/libc/musl/include/netinet/ip.h
index d7fa8d5e4e9b228d0542c3607c29a43589566f6b..0ae132a58584b6916e13c9c72015def387c35442 100644
--- a/lib/libc/musl/include/netinet/ip.h
+++ b/lib/libc/musl/include/netinet/ip.h
@@ -7,7 +7,6 @@ extern "C" {
#include
#include
-#include
struct timestamp {
uint8_t len;
@@ -191,6 +190,8 @@ struct ip_timestamp {
#define IP_MSS 576
+#define __UAPI_DEF_IPHDR 0
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/netinet/ip6.h b/lib/libc/musl/include/netinet/ip6.h
index a4347a53fd7dd364a6c2c3b71ee053128ead1412..50c626a69c646639cf7313ef138bc38c3e82e999 100644
--- a/lib/libc/musl/include/netinet/ip6.h
+++ b/lib/libc/musl/include/netinet/ip6.h
@@ -7,7 +7,6 @@ extern "C" {
#include
#include
-#include
struct ip6_hdr {
union {
diff --git a/lib/libc/musl/include/netinet/tcp.h b/lib/libc/musl/include/netinet/tcp.h
index c7a86480d301a3dc864994ef2d75bd276bdff007..44a007aaf5a252f21f5e5c76ec5fafd69267cf69 100644
--- a/lib/libc/musl/include/netinet/tcp.h
+++ b/lib/libc/musl/include/netinet/tcp.h
@@ -38,6 +38,7 @@
#define TCP_FASTOPEN_NO_COOKIE 34
#define TCP_ZEROCOPY_RECEIVE 35
#define TCP_INQ 36
+#define TCP_TX_DELAY 37
#define TCP_CM_INQ TCP_INQ
@@ -97,7 +98,6 @@ enum {
#include
#include
#include
-#include
typedef uint32_t tcp_seq;
@@ -234,6 +234,8 @@ struct tcp_info {
uint64_t tcpi_bytes_retrans;
uint32_t tcpi_dsack_dups;
uint32_t tcpi_reord_seen;
+ uint32_t tcpi_rcv_ooopack;
+ uint32_t tcpi_snd_wnd;
};
#define TCP_MD5SIG_MAXKEYLEN 80
diff --git a/lib/libc/musl/include/poll.h b/lib/libc/musl/include/poll.h
index daccc760bb26a821ce00424cb1d61f8764cc83c3..472e4b8470bae3904100963200ac3dcfb7e34879 100644
--- a/lib/libc/musl/include/poll.h
+++ b/lib/libc/musl/include/poll.h
@@ -44,6 +44,12 @@ int poll (struct pollfd *, nfds_t, int);
int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
#endif
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(ppoll, __ppoll_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/pthread.h b/lib/libc/musl/include/pthread.h
index e238321b9caf14af72d7f216a1e7c82bbc830471..984db68064185aafc2620843fbea21aea2e36b2f 100644
--- a/lib/libc/musl/include/pthread.h
+++ b/lib/libc/musl/include/pthread.h
@@ -224,6 +224,16 @@ int pthread_tryjoin_np(pthread_t, void **);
int pthread_timedjoin_np(pthread_t, void **, const struct timespec *);
#endif
+#if _REDIR_TIME64
+__REDIR(pthread_mutex_timedlock, __pthread_mutex_timedlock_time64);
+__REDIR(pthread_cond_timedwait, __pthread_cond_timedwait_time64);
+__REDIR(pthread_rwlock_timedrdlock, __pthread_rwlock_timedrdlock_time64);
+__REDIR(pthread_rwlock_timedwrlock, __pthread_rwlock_timedwrlock_time64);
+#ifdef _GNU_SOURCE
+__REDIR(pthread_timedjoin_np, __pthread_timedjoin_np_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sched.h b/lib/libc/musl/include/sched.h
index 7e470d3a133ffdb19e0f05cb48627acbda345f08..822f464efd20d5cef3abb1488eac2b458fa7c1be 100644
--- a/lib/libc/musl/include/sched.h
+++ b/lib/libc/musl/include/sched.h
@@ -19,10 +19,14 @@ extern "C" {
struct sched_param {
int sched_priority;
int __reserved1;
+#if _REDIR_TIME64
+ long __reserved2[4];
+#else
struct {
time_t __reserved1;
long __reserved2;
} __reserved2[2];
+#endif
int __reserved3;
};
@@ -133,6 +137,10 @@ __CPU_op_func_S(XOR, ^)
#endif
+#if _REDIR_TIME64
+__REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/semaphore.h b/lib/libc/musl/include/semaphore.h
index 277c47d6f7425b9a8dc5578b3850c5b7c4847a9f..3690f49609d16026db882032ec7d7e2363e5eaa0 100644
--- a/lib/libc/musl/include/semaphore.h
+++ b/lib/libc/musl/include/semaphore.h
@@ -29,6 +29,10 @@ int sem_trywait(sem_t *);
int sem_unlink(const char *);
int sem_wait(sem_t *);
+#if _REDIR_TIME64
+__REDIR(sem_timedwait, __sem_timedwait_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/signal.h b/lib/libc/musl/include/signal.h
index 5c48cb838fab75faea60d2433d47be2088d786d9..fbdf667b2f202ab2f1375952ce9d4cf636ef1ce0 100644
--- a/lib/libc/musl/include/signal.h
+++ b/lib/libc/musl/include/signal.h
@@ -271,6 +271,14 @@ typedef int sig_atomic_t;
void (*signal(int, void (*)(int)))(int);
int raise(int);
+#if _REDIR_TIME64
+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+__REDIR(sigtimedwait, __sigtimedwait_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/acct.h b/lib/libc/musl/include/sys/acct.h
index 9b0ba36fbe93a56a49e678386495406f0218674b..fae9d0508f9c839d149ed80cba9f89e12013c7c7 100644
--- a/lib/libc/musl/include/sys/acct.h
+++ b/lib/libc/musl/include/sys/acct.h
@@ -6,7 +6,6 @@ extern "C" {
#endif
#include
-#include
#include
#include
diff --git a/lib/libc/musl/include/sys/ioctl.h b/lib/libc/musl/include/sys/ioctl.h
index 372e3ddc1ca9d37740dd85ca5435bef7e7d01b27..c2ce3b4840b0a5d0232304ed79cafb815b7a71e2 100644
--- a/lib/libc/musl/include/sys/ioctl.h
+++ b/lib/libc/musl/include/sys/ioctl.h
@@ -4,6 +4,7 @@
extern "C" {
#endif
+#include
#include
#define N_TTY 0
diff --git a/lib/libc/musl/include/sys/mman.h b/lib/libc/musl/include/sys/mman.h
index d0761b1832de7fd2791897a34e0e0748f64af832..3bade72720d76ecae573254584b824207fbb4b52 100644
--- a/lib/libc/musl/include/sys/mman.h
+++ b/lib/libc/musl/include/sys/mman.h
@@ -92,6 +92,8 @@ extern "C" {
#define MADV_DODUMP 17
#define MADV_WIPEONFORK 18
#define MADV_KEEPONFORK 19
+#define MADV_COLD 20
+#define MADV_PAGEOUT 21
#define MADV_HWPOISON 100
#define MADV_SOFT_OFFLINE 101
#endif
diff --git a/lib/libc/musl/include/sys/prctl.h b/lib/libc/musl/include/sys/prctl.h
index 07f0d73dc78a5c0e38d1afa94eaf6698178165a1..d9c846e9c2eaec7103f71b9894d76a0b0345c1e2 100644
--- a/lib/libc/musl/include/sys/prctl.h
+++ b/lib/libc/musl/include/sys/prctl.h
@@ -154,6 +154,10 @@ struct prctl_mm_map {
#define PR_PAC_APDBKEY (1UL << 3)
#define PR_PAC_APGAKEY (1UL << 4)
+#define PR_SET_TAGGED_ADDR_CTRL 55
+#define PR_GET_TAGGED_ADDR_CTRL 56
+#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
+
int prctl (int, ...);
#ifdef __cplusplus
diff --git a/lib/libc/musl/include/sys/procfs.h b/lib/libc/musl/include/sys/procfs.h
index e23bf1ad6b9f6058cfd1fe593ee149ed0e178e08..38e58c168b416a2e2452b06f9196e748f3e8a46a 100644
--- a/lib/libc/musl/include/sys/procfs.h
+++ b/lib/libc/musl/include/sys/procfs.h
@@ -23,10 +23,9 @@ struct elf_prstatus {
pid_t pr_ppid;
pid_t pr_pgrp;
pid_t pr_sid;
- struct timeval pr_utime;
- struct timeval pr_stime;
- struct timeval pr_cutime;
- struct timeval pr_cstime;
+ struct {
+ long tv_sec, tv_usec;
+ } pr_utime, pr_stime, pr_cutime, pr_cstime;
elf_gregset_t pr_reg;
int pr_fpvalid;
};
diff --git a/lib/libc/musl/include/sys/ptrace.h b/lib/libc/musl/include/sys/ptrace.h
index 229e1f3d996376f061148f6d6240156dafe412a7..5d62a9859aac6016e89e0134bce25ec270673da3 100644
--- a/lib/libc/musl/include/sys/ptrace.h
+++ b/lib/libc/musl/include/sys/ptrace.h
@@ -41,6 +41,7 @@ extern "C" {
#define PTRACE_SETSIGMASK 0x420b
#define PTRACE_SECCOMP_GET_FILTER 0x420c
#define PTRACE_SECCOMP_GET_METADATA 0x420d
+#define PTRACE_GET_SYSCALL_INFO 0x420e
#define PT_READ_I PTRACE_PEEKTEXT
#define PT_READ_D PTRACE_PEEKDATA
@@ -88,6 +89,11 @@ extern "C" {
#define PTRACE_PEEKSIGINFO_SHARED 1
+#define PTRACE_SYSCALL_INFO_NONE 0
+#define PTRACE_SYSCALL_INFO_ENTRY 1
+#define PTRACE_SYSCALL_INFO_EXIT 2
+#define PTRACE_SYSCALL_INFO_SECCOMP 3
+
#include
struct __ptrace_peeksiginfo_args {
@@ -101,6 +107,29 @@ struct __ptrace_seccomp_metadata {
uint64_t flags;
};
+struct __ptrace_syscall_info {
+ uint8_t op;
+ uint8_t __pad[3];
+ uint32_t arch;
+ uint64_t instruction_pointer;
+ uint64_t stack_pointer;
+ union {
+ struct {
+ uint64_t nr;
+ uint64_t args[6];
+ } entry;
+ struct {
+ int64_t rval;
+ uint8_t is_error;
+ } exit;
+ struct {
+ uint64_t nr;
+ uint64_t args[6];
+ uint32_t ret_data;
+ } seccomp;
+ };
+};
+
long ptrace(int, ...);
#ifdef __cplusplus
diff --git a/lib/libc/musl/include/sys/resource.h b/lib/libc/musl/include/sys/resource.h
index 70d793d563f588469f74e670ac6a993aa528a407..3068328d09612b8b9d58f2874ea17b0afeef0fef 100644
--- a/lib/libc/musl/include/sys/resource.h
+++ b/lib/libc/musl/include/sys/resource.h
@@ -90,7 +90,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
#define RLIMIT_MSGQUEUE 12
#define RLIMIT_NICE 13
#define RLIMIT_RTPRIO 14
-#define RLIMIT_NLIMITS 15
+#define RLIMIT_RTTIME 15
+#define RLIMIT_NLIMITS 16
#define RLIM_NLIMITS RLIMIT_NLIMITS
@@ -104,6 +105,10 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
#define rlim64_t rlim_t
#endif
+#if _REDIR_TIME64
+__REDIR(getrusage, __getrusage_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/select.h b/lib/libc/musl/include/sys/select.h
index d34cbf10d9cc9cbdee6534611726fb93d002a40d..b3bab1d57b492700b27ed27eba96407baa1bdf74 100644
--- a/lib/libc/musl/include/sys/select.h
+++ b/lib/libc/musl/include/sys/select.h
@@ -35,6 +35,11 @@ int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, co
#define NFDBITS (8*(int)sizeof(long))
#endif
+#if _REDIR_TIME64
+__REDIR(select, __select_time64);
+__REDIR(pselect, __pselect_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/sem.h b/lib/libc/musl/include/sys/sem.h
index 410c877446b929b6b1c4f0eaaccfe71a7c0a036e..a747784ede9e0d0a04d96b80c29bc8f847e3b3c7 100644
--- a/lib/libc/musl/include/sys/sem.h
+++ b/lib/libc/musl/include/sys/sem.h
@@ -25,8 +25,6 @@ extern "C" {
#define SETVAL 16
#define SETALL 17
-#include
-
#include
#define _SEM_SEMUN_UNDEFINED 1
@@ -62,6 +60,12 @@ int semop(int, struct sembuf *, size_t);
int semtimedop(int, struct sembuf *, size_t, const struct timespec *);
#endif
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(semtimedop, __semtimedop_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/socket.h b/lib/libc/musl/include/sys/socket.h
index 8692efa7ad6474a7ce6dc1dc850f2e1097a2300d..38f5bb17b3b8d1fa9eeedff4b90fd6b919e383f6 100644
--- a/lib/libc/musl/include/sys/socket.h
+++ b/lib/libc/musl/include/sys/socket.h
@@ -19,6 +19,40 @@ extern "C" {
#include
+struct msghdr {
+ void *msg_name;
+ socklen_t msg_namelen;
+ struct iovec *msg_iov;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+ int __pad1;
+#endif
+ int msg_iovlen;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+ int __pad1;
+#endif
+ void *msg_control;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+ int __pad2;
+#endif
+ socklen_t msg_controllen;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+ int __pad2;
+#endif
+ int msg_flags;
+};
+
+struct cmsghdr {
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
+ int __pad1;
+#endif
+ socklen_t cmsg_len;
+#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
+ int __pad1;
+#endif
+ int cmsg_level;
+ int cmsg_type;
+};
+
#ifdef _GNU_SOURCE
struct ucred {
pid_t pid;
@@ -182,8 +216,6 @@ struct linger {
#define SO_PEERCRED 17
#define SO_RCVLOWAT 18
#define SO_SNDLOWAT 19
-#define SO_RCVTIMEO 20
-#define SO_SNDTIMEO 21
#define SO_ACCEPTCONN 30
#define SO_PEERSEC 31
#define SO_SNDBUFFORCE 32
@@ -192,6 +224,28 @@ struct linger {
#define SO_DOMAIN 39
#endif
+#ifndef SO_RCVTIMEO
+#if __LONG_MAX == 0x7fffffff
+#define SO_RCVTIMEO 66
+#define SO_SNDTIMEO 67
+#else
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+#endif
+#endif
+
+#ifndef SO_TIMESTAMP
+#if __LONG_MAX == 0x7fffffff
+#define SO_TIMESTAMP 63
+#define SO_TIMESTAMPNS 64
+#define SO_TIMESTAMPING 65
+#else
+#define SO_TIMESTAMP 29
+#define SO_TIMESTAMPNS 35
+#define SO_TIMESTAMPING 37
+#endif
+#endif
+
#define SO_SECURITY_AUTHENTICATION 22
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
@@ -203,14 +257,10 @@ struct linger {
#define SO_GET_FILTER SO_ATTACH_FILTER
#define SO_PEERNAME 28
-#define SO_TIMESTAMP 29
#define SCM_TIMESTAMP SO_TIMESTAMP
-
#define SO_PASSSEC 34
-#define SO_TIMESTAMPNS 35
#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
#define SO_MARK 36
-#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
#define SO_RXQ_OVFL 40
#define SO_WIFI_STATUS 41
@@ -238,6 +288,7 @@ struct linger {
#define SO_TXTIME 61
#define SCM_TXTIME SO_TXTIME
#define SO_BINDTOIFINDEX 62
+#define SO_DETACH_REUSEPORT_BPF 68
#ifndef SOL_SOCKET
#define SOL_SOCKET 1
@@ -350,6 +401,12 @@ int setsockopt (int, int, int, const void *, socklen_t);
int sockatmark (int);
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(recvmmsg, __recvmmsg_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/stat.h b/lib/libc/musl/include/sys/stat.h
index 9d096624bcfa44594c71d47591944adae0d9e742..10d446c463eca4862b6bb8d394d52c13d27c4cf9 100644
--- a/lib/libc/musl/include/sys/stat.h
+++ b/lib/libc/musl/include/sys/stat.h
@@ -110,6 +110,15 @@ int lchmod(const char *, mode_t);
#define off64_t off_t
#endif
+#if _REDIR_TIME64
+__REDIR(stat, __stat_time64);
+__REDIR(fstat, __fstat_time64);
+__REDIR(lstat, __lstat_time64);
+__REDIR(fstatat, __fstatat_time64);
+__REDIR(futimens, __futimens_time64);
+__REDIR(utimensat, __utimensat_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/statvfs.h b/lib/libc/musl/include/sys/statvfs.h
index ef07d6846a120513f60e6a1ac88092f2a07de0bb..793490b6dc8c171f00809bbf0412bb48e7e220fa 100644
--- a/lib/libc/musl/include/sys/statvfs.h
+++ b/lib/libc/musl/include/sys/statvfs.h
@@ -11,8 +11,6 @@ extern "C" {
#define __NEED_fsfilcnt_t
#include
-#include
-
struct statvfs {
unsigned long f_bsize, f_frsize;
fsblkcnt_t f_blocks, f_bfree, f_bavail;
diff --git a/lib/libc/musl/include/sys/time.h b/lib/libc/musl/include/sys/time.h
index c5cab814c0d112d493d75d1a35c98bb338195687..cdc67ef650fe3cd758b579052df907f8b56baab6 100644
--- a/lib/libc/musl/include/sys/time.h
+++ b/lib/libc/musl/include/sys/time.h
@@ -56,6 +56,20 @@ int adjtime (const struct timeval *, struct timeval *);
(void)0 )
#endif
+#if _REDIR_TIME64
+__REDIR(gettimeofday, __gettimeofday_time64);
+__REDIR(getitimer, __getitimer_time64);
+__REDIR(setitimer, __setitimer_time64);
+__REDIR(utimes, __utimes_time64);
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+__REDIR(futimes, __futimes_time64);
+__REDIR(futimesat, __futimesat_time64);
+__REDIR(lutimes, __lutimes_time64);
+__REDIR(settimeofday, __settimeofday_time64);
+__REDIR(adjtime, __adjtime64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/timeb.h b/lib/libc/musl/include/sys/timeb.h
index 108c1f5ccbbd45d484ac79062cbc5104c01b02cc..628239b7ed9342ad8f19a655c290b4be2c6ba213 100644
--- a/lib/libc/musl/include/sys/timeb.h
+++ b/lib/libc/musl/include/sys/timeb.h
@@ -4,6 +4,8 @@
extern "C" {
#endif
+#include
+
#define __NEED_time_t
#include
@@ -16,6 +18,10 @@ struct timeb {
int ftime(struct timeb *);
+#if _REDIR_TIME64
+__REDIR(ftime, __ftime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/timerfd.h b/lib/libc/musl/include/sys/timerfd.h
index 2794d36a6c2b2b37e8f7f2d4f28c02e85223de06..1b832cdd8f8faed5423cdc7d33060ed1f1cd73e3 100644
--- a/lib/libc/musl/include/sys/timerfd.h
+++ b/lib/libc/musl/include/sys/timerfd.h
@@ -20,6 +20,11 @@ int timerfd_create(int, int);
int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *);
int timerfd_gettime(int, struct itimerspec *);
+#if _REDIR_TIME64
+__REDIR(timerfd_settime, __timerfd_settime64);
+__REDIR(timerfd_gettime, __timerfd_gettime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/timex.h b/lib/libc/musl/include/sys/timex.h
index 2e688880a8b2d71e905091161efa63a32601d53e..8b417e1be258c3a342646c3ba4528c1b6f8a7e10 100644
--- a/lib/libc/musl/include/sys/timex.h
+++ b/lib/libc/musl/include/sys/timex.h
@@ -91,6 +91,11 @@ struct timex {
int adjtimex(struct timex *);
int clock_adjtime(clockid_t, struct timex *);
+#if _REDIR_TIME64
+__REDIR(adjtimex, __adjtimex_time64);
+__REDIR(clock_adjtime, __clock_adjtime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/sys/ttydefaults.h b/lib/libc/musl/include/sys/ttydefaults.h
index d251b715c6757b5afe8825bc07c078f62ed9a439..edb55bc4d68a5229bb23996c30a10878d0d430fd 100644
--- a/lib/libc/musl/include/sys/ttydefaults.h
+++ b/lib/libc/musl/include/sys/ttydefaults.h
@@ -6,16 +6,11 @@
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
#define TTYDEF_SPEED (B9600)
-#define CTRL(x) (x&037)
+#define CTRL(x) ((x)&037)
#define CEOF CTRL('d')
-#ifdef _POSIX_VDISABLE
-#define CEOL _POSIX_VDISABLE
-#define CSTATUS _POSIX_VDISABLE
-#else
#define CEOL '\0'
#define CSTATUS '\0'
-#endif
#define CERASE 0177
#define CINTR CTRL('c')
diff --git a/lib/libc/musl/include/sys/wait.h b/lib/libc/musl/include/sys/wait.h
index 50c5c709a6beaa5575f9ab56e24bd115abf77c5d..d4b1f2e185c66384e7901e4ca4370f7768eb3bb7 100644
--- a/lib/libc/musl/include/sys/wait.h
+++ b/lib/libc/musl/include/sys/wait.h
@@ -13,7 +13,8 @@ extern "C" {
typedef enum {
P_ALL = 0,
P_PID = 1,
- P_PGID = 2
+ P_PGID = 2,
+ P_PIDFD = 3
} idtype_t;
pid_t wait (int *);
@@ -53,6 +54,13 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#define WIFCONTINUED(s) ((s) == 0xffff)
+#if _REDIR_TIME64
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+__REDIR(wait3, __wait3_time64);
+__REDIR(wait4, __wait4_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/threads.h b/lib/libc/musl/include/threads.h
index 8122b3b1df5e5a931b98eb688d227800934a126b..52ec3100eb9e2ebf3523123ba51021582361b855 100644
--- a/lib/libc/musl/include/threads.h
+++ b/lib/libc/musl/include/threads.h
@@ -80,6 +80,12 @@ void tss_delete(tss_t);
int tss_set(tss_t, void *);
void *tss_get(tss_t);
+#if _REDIR_TIME64
+__REDIR(thrd_sleep, __thrd_sleep_time64);
+__REDIR(mtx_timedlock, __mtx_timedlock_time64);
+__REDIR(cnd_timedwait, __cnd_timedwait_time64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/time.h b/lib/libc/musl/include/time.h
index 672b3fc3ee23d144ef3f605e7c20533db97cd1a8..5494df183673388e64e8305182131a58022530b5 100644
--- a/lib/libc/musl/include/time.h
+++ b/lib/libc/musl/include/time.h
@@ -130,6 +130,34 @@ int stime(const time_t *);
time_t timegm(struct tm *);
#endif
+#if _REDIR_TIME64
+__REDIR(time, __time64);
+__REDIR(difftime, __difftime64);
+__REDIR(mktime, __mktime64);
+__REDIR(gmtime, __gmtime64);
+__REDIR(localtime, __localtime64);
+__REDIR(ctime, __ctime64);
+__REDIR(timespec_get, __timespec_get_time64);
+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+__REDIR(gmtime_r, __gmtime64_r);
+__REDIR(localtime_r, __localtime64_r);
+__REDIR(ctime_r, __ctime64_r);
+__REDIR(nanosleep, __nanosleep_time64);
+__REDIR(clock_getres, __clock_getres_time64);
+__REDIR(clock_gettime, __clock_gettime64);
+__REDIR(clock_settime, __clock_settime64);
+__REDIR(clock_nanosleep, __clock_nanosleep_time64);
+__REDIR(timer_settime, __timer_settime64);
+__REDIR(timer_gettime, __timer_gettime64);
+#endif
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+__REDIR(stime, __stime64);
+__REDIR(timegm, __timegm_time64);
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/utime.h b/lib/libc/musl/include/utime.h
index dd5ff927c25d1ec82475c569a0d4c09f3c1fce29..5755bd53ee866ebf7a1b73768bad7837a2de5f70 100644
--- a/lib/libc/musl/include/utime.h
+++ b/lib/libc/musl/include/utime.h
@@ -5,6 +5,8 @@
extern "C" {
#endif
+#include
+
#define __NEED_time_t
#include
@@ -16,6 +18,10 @@ struct utimbuf {
int utime (const char *, const struct utimbuf *);
+#if _REDIR_TIME64
+__REDIR(utime, __utime64);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/libc/musl/include/utmpx.h b/lib/libc/musl/include/utmpx.h
index 0429014d854fc32d0355d4fe5a18db45c2c530fb..b293f427e6b0d5acbf0f870110e326b2f7ff8d2f 100644
--- a/lib/libc/musl/include/utmpx.h
+++ b/lib/libc/musl/include/utmpx.h
@@ -16,6 +16,7 @@ extern "C" {
struct utmpx {
short ut_type;
+ short __ut_pad1;
pid_t ut_pid;
char ut_line[32];
char ut_id[4];
@@ -25,7 +26,11 @@ struct utmpx {
short __e_termination;
short __e_exit;
} ut_exit;
- long ut_session;
+#if __BYTE_ORDER == 1234
+ int ut_session, __ut_pad2;
+#else
+ int __ut_pad2, ut_session;
+#endif
struct timeval ut_tv;
unsigned ut_addr_v6[4];
char __unused[20];
diff --git a/lib/libc/musl/src/aio/aio_suspend.c b/lib/libc/musl/src/aio/aio_suspend.c
index 9b24b6af2487a199591530fec4b2d7e13a7ba4c0..34b66f8787a49fb97c264b962285a413c34b50dc 100644
--- a/lib/libc/musl/src/aio/aio_suspend.c
+++ b/lib/libc/musl/src/aio/aio_suspend.c
@@ -73,4 +73,6 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
}
}
+#if !_REDIR_TIME64
weak_alias(aio_suspend, aio_suspend64);
+#endif
diff --git a/lib/libc/musl/src/complex/cacosh.c b/lib/libc/musl/src/complex/cacosh.c
index 8e42f1ae86ed5556933a3f0dca8b7a6b9130ffcc..76127f75f4bb1b4369bf98d209c0089e2ff86bca 100644
--- a/lib/libc/musl/src/complex/cacosh.c
+++ b/lib/libc/musl/src/complex/cacosh.c
@@ -4,6 +4,9 @@
double complex cacosh(double complex z)
{
+ int zineg = signbit(cimag(z));
+
z = cacos(z);
- return CMPLX(-cimag(z), creal(z));
+ if (zineg) return CMPLX(cimag(z), -creal(z));
+ else return CMPLX(-cimag(z), creal(z));
}
diff --git a/lib/libc/musl/src/complex/cacoshf.c b/lib/libc/musl/src/complex/cacoshf.c
index d7e6b545474dd299bea83bf8a06e73fab49f6413..8bd80581ae0d7d2ad42ceed52332570078f50943 100644
--- a/lib/libc/musl/src/complex/cacoshf.c
+++ b/lib/libc/musl/src/complex/cacoshf.c
@@ -2,6 +2,9 @@
float complex cacoshf(float complex z)
{
+ int zineg = signbit(cimagf(z));
+
z = cacosf(z);
- return CMPLXF(-cimagf(z), crealf(z));
+ if (zineg) return CMPLXF(cimagf(z), -crealf(z));
+ else return CMPLXF(-cimagf(z), crealf(z));
}
diff --git a/lib/libc/musl/src/complex/cacoshl.c b/lib/libc/musl/src/complex/cacoshl.c
index d3eaee204f6d51a13c8932e0e2e68fe708536b78..3a284be9c68c2e01819449e48e5116bedfbbf24d 100644
--- a/lib/libc/musl/src/complex/cacoshl.c
+++ b/lib/libc/musl/src/complex/cacoshl.c
@@ -8,7 +8,10 @@ long double complex cacoshl(long double complex z)
#else
long double complex cacoshl(long double complex z)
{
+ int zineg = signbit(cimagl(z));
+
z = cacosl(z);
- return CMPLXL(-cimagl(z), creall(z));
+ if (zineg) return CMPLXL(cimagl(z), -creall(z));
+ else return CMPLXL(-cimagl(z), creall(z));
}
#endif
diff --git a/lib/libc/musl/src/complex/catanf.c b/lib/libc/musl/src/complex/catanf.c
index e10d9c09343282a30cb3b63770e126dba3e30615..ef3907a5069e245d52b11078f072ab113828ce19 100644
--- a/lib/libc/musl/src/complex/catanf.c
+++ b/lib/libc/musl/src/complex/catanf.c
@@ -87,29 +87,17 @@ float complex catanf(float complex z)
x = crealf(z);
y = cimagf(z);
- if ((x == 0.0f) && (y > 1.0f))
- goto ovrf;
-
x2 = x * x;
a = 1.0f - x2 - (y * y);
- if (a == 0.0f)
- goto ovrf;
t = 0.5f * atan2f(2.0f * x, a);
w = _redupif(t);
t = y - 1.0f;
a = x2 + (t * t);
- if (a == 0.0f)
- goto ovrf;
t = y + 1.0f;
a = (x2 + (t * t))/a;
- w = w + (0.25f * logf (a)) * I;
- return w;
-
-ovrf:
- // FIXME
- w = MAXNUMF + MAXNUMF * I;
+ w = CMPLXF(w, 0.25f * logf(a));
return w;
}
diff --git a/lib/libc/musl/src/complex/catanl.c b/lib/libc/musl/src/complex/catanl.c
index a9fc02db03012604488c7c867cb3618b9212f177..e62526c00672b42b91592334b2f113326c40e9a7 100644
--- a/lib/libc/musl/src/complex/catanl.c
+++ b/lib/libc/musl/src/complex/catanl.c
@@ -97,30 +97,18 @@ long double complex catanl(long double complex z)
x = creall(z);
y = cimagl(z);
- if ((x == 0.0L) && (y > 1.0L))
- goto ovrf;
-
x2 = x * x;
a = 1.0L - x2 - (y * y);
- if (a == 0.0L)
- goto ovrf;
t = atan2l(2.0L * x, a) * 0.5L;
w = redupil(t);
t = y - 1.0L;
a = x2 + (t * t);
- if (a == 0.0L)
- goto ovrf;
t = y + 1.0L;
a = (x2 + (t * t)) / a;
- w = w + (0.25L * logl(a)) * I;
- return w;
-
-ovrf:
- // FIXME
- w = LDBL_MAX + LDBL_MAX * I;
+ w = CMPLXF(w, 0.25L * logl(a));
return w;
}
#endif
diff --git a/lib/libc/musl/src/ctype/alpha.h b/lib/libc/musl/src/ctype/alpha.h
index 299277c71c6763130ff42ea1355127920b9c3ffb..4167f3876c6cc291ba36c75dbb92ea5d31f98e8e 100644
--- a/lib/libc/musl/src/ctype/alpha.h
+++ b/lib/libc/musl/src/ctype/alpha.h
@@ -8,17 +8,17 @@
17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,
-68,69,70,71,72,73,74,17,75,76,77,78,79,80,16,16,16,81,82,83,84,85,86,87,88,89,
-16,90,16,91,92,16,16,17,17,17,93,94,95,16,16,16,16,16,16,16,16,16,16,17,17,17,
-17,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,97,16,16,16,16,16,16,
+68,69,70,71,72,73,74,17,75,76,77,78,79,80,81,16,82,83,84,85,86,87,88,89,90,91,
+92,93,16,94,95,96,16,17,17,17,97,98,99,16,16,16,16,16,16,16,16,16,16,17,17,17,
+17,100,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,101,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,17,17,98,99,16,16,16,100,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
-17,17,17,17,17,17,17,101,17,17,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,103,
-104,16,16,16,16,16,16,16,16,16,105,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,16,16,106,107,108,109,16,16,16,16,16,16,16,16,110,16,16,
-16,16,16,16,16,111,112,16,16,16,16,113,16,16,114,16,16,16,16,16,16,16,16,16,
-16,16,16,16,
+16,16,17,17,102,103,16,16,104,105,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,106,17,17,107,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,
+108,109,16,16,16,16,16,16,16,16,16,110,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,111,112,113,114,16,16,16,16,16,16,16,16,115,116,
+117,16,16,16,16,16,118,119,16,16,16,16,120,16,16,121,16,16,16,16,16,16,16,16,
+16,16,16,16,16,
16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,
@@ -27,8 +27,8 @@
255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,188,64,215,255,255,
251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,254,255,255,
-255,255,0,0,0,0,0,255,191,182,0,255,255,255,7,7,0,0,0,255,7,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,255,255,255,
+255,255,1,0,0,0,0,255,191,182,0,255,255,255,135,7,0,0,0,255,7,255,255,255,255,
255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,
31,254,225,255,
159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,
@@ -42,54 +42,55 @@
255,0,0,239,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,239,223,253,
255,255,255,255,231,223,93,240,128,207,255,0,252,236,255,127,252,255,255,251,
47,127,128,95,255,192,255,12,0,254,255,255,255,255,127,255,7,63,32,255,3,0,0,
-0,0,150,37,240,254,174,236,255,59,95,32,255,243,0,0,0,
+0,0,214,247,255,255,175,255,255,59,95,32,255,243,0,0,0,
0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,
-31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,231,193,255,
-255,127,64,255,51,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,
+31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,255,255,255,
+255,255,255,255,63,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,
255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,
127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,
-135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255,
+7,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,
255,199,255,1,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,
255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,
-255,255,255,255,255,0,255,255,255,255,255,7,255,255,255,255,255,255,255,255,
+255,255,255,255,255,1,255,255,255,255,255,7,255,255,255,255,255,255,255,255,
63,
0,255,255,255,127,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,
255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,
127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,
255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,
-255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,255,255,255,255,255,63,
-255,1,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,31,0,
-255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,255,255,255,
-255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,
-0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,224,67,0,0,
-255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+255,191,255,3,0,255,255,255,255,255,255,127,0,255,227,255,255,255,255,255,63,
+255,1,255,255,255,255,255,231,0,0,0,0,0,222,111,4,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,
+128,255,31,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,
+255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,
+224,67,0,0,255,255,255,255,255,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,0,0,0,0,0,192,255,255,255,255,255,255,3,0,
0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,
255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,
255,255,255,255,0,0,0,0,0,128,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,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,
-255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,127,254,255,
+255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,255,254,255,
255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,
0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,
0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,
255,127,240,143,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,
0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,249,255,255,255,
-127,255,0,0,0,0,0,0,0,128,255,187,247,255,255,255,0,0,0,255,255,255,255,255,
-255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,40,255,255,255,
-255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,255,
-0,128,255,3,223,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,255,
-255,127,196,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,126,
-0,127,127,255,255,255,255,255,247,63,0,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,255,
+255,255,255,124,0,0,0,0,0,128,255,191,255,255,255,255,0,0,0,255,255,255,255,
+255,255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,232,255,255,
+255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,
+255,0,128,255,3,255,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,
+255,255,127,252,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,
+126,0,127,127,255,255,255,255,255,247,255,0,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,
+255,
15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,
255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,
255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,
@@ -109,55 +110,63 @@
0,0,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,255,255,
127,0,255,255,255,127,0,0,0,0,0,0,0,0,255,255,55,0,255,255,63,0,255,255,255,3,
0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,
-254,255,255,15,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255,
+254,255,255,63,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255,
255,31,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,255,255,3,
0,0,0,0,0,0,0,0,0,0,0,0,
0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,255,255,255,255,255,255,7,
-0,255,255,255,255,255,255,7,0,255,255,255,255,255,255,255,255,63,0,0,0,192,
-255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255,
-255,255,199,255,0,0,255,255,255,255,71,0,255,255,255,255,255,255,255,255,30,0,
-255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,127,189,255,191,
-255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,253,237,227,159,
-25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
-255,255,187,7,255,3,0,0,0,0,255,255,255,255,255,255,255,255,179,0,255,3,0,0,0,
+0,255,255,255,255,255,255,7,0,255,255,255,255,255,0,255,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,255,255,255,31,128,0,255,255,63,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,255,255,127,0,255,255,255,255,255,255,255,255,63,0,0,0,
+192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,
+255,255,255,199,255,112,0,255,255,255,255,71,0,255,255,255,255,255,255,255,
+255,30,0,255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,127,
+189,255,191,255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,253,
+237,227,159,25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,
+255,255,255,255,255,187,7,255,131,0,0,0,0,255,255,255,255,255,255,255,255,179,
+0,255,3,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,127,0,0,0,63,0,0,
0,0,255,255,255,255,255,255,255,127,17,0,255,3,0,0,0,0,255,255,255,255,255,
-255,63,0,255,3,0,0,0,0,0,
-0,255,255,255,227,255,7,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,3,
-0,128,255,255,255,255,255,255,231,127,0,0,255,255,255,255,255,255,207,255,255,
-0,0,0,0,0,255,255,255,255,255,255,255,1,255,253,255,255,255,255,127,127,1,0,
-255,3,0,0,252,255,255,255,252,255,255,254,127,0,0,0,0,0,0,0,0,0,127,251,255,
-255,255,255,127,180,203,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
+255,63,1,255,3,0,0,0,0,0,0,255,255,255,231,255,7,255,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,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,
+0,255,255,255,255,255,255,255,255,255,3,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,255,252,255,255,255,255,255,252,26,0,0,0,255,255,255,255,255,255,231,
+127,0,0,255,255,255,255,255,255,255,255,255,32,0,0,0,0,255,255,255,255,255,
+255,255,1,255,253,255,255,255,255,127,127,1,0,255,3,0,0,252,255,255,255,252,
+255,255,254,127,0,0,0,0,0,0,0,0,0,127,251,255,255,255,255,127,180,203,0,255,3,
+191,253,255,255,255,127,123,1,255,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,0,0,0,0,0,0,0,255,255,127,0,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,
0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,
0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,255,255,255,255,255,127,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,
-255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,255,255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,
-0,255,255,255,63,0,0,255,255,255,255,255,255,127,0,15,0,255,3,248,255,255,224,
-255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255,
-255,255,255,255,127,0,0,248,255,0,0,0,0,0,0,0,0,3,0,0,0,255,255,255,255,255,
+255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
+255,255,255,127,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,255,255,
+255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
+255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,0,255,
+255,255,63,0,0,255,255,255,255,255,255,0,0,15,0,255,3,248,255,255,224,255,255,
+0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,255,255,255,255,255,255,255,255,255,135,255,255,255,255,255,255,255,128,
+255,255,0,0,0,0,0,0,0,0,11,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,31,0,0,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,
-255,255,255,127,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,
+255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,
+0,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,255,
-255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,0,0,
-255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,
-223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,
-255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,
+255,255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,
+0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,
+255,223,100,222,255,235,239,255,255,255,255,255,255,
+255,191,231,223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,
-247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,
-255,255,255,253,255,255,247,207,255,255,255,255,255,255,127,255,255,249,219,7,
-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,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,
-0,0,0,0,0,
-0,255,255,255,255,255,255,255,255,143,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,
-255,15,238,251,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,255,3,
-255,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,
+253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,
+255,255,127,255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255,
+255,255,127,255,255,249,219,7,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,255,255,255,255,255,31,128,63,255,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,
+15,255,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
+143,8,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255,
+15,238,251,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,255,3,255,
+255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/lib/libc/musl/src/ctype/casemap.h b/lib/libc/musl/src/ctype/casemap.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ee1209b9698884b0fd24e88bd157b1355878b68
--- /dev/null
+++ b/lib/libc/musl/src/ctype/casemap.h
@@ -0,0 +1,297 @@
+static const unsigned char tab[] = {
+ 7, 8, 9, 10, 11, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 13, 6, 6, 14, 6, 6, 6, 6, 6, 6, 6, 6, 15, 16, 17, 18,
+ 6, 19, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 20, 21, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 22, 23, 6, 6, 6, 24, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 25,
+ 6, 6, 6, 6, 26, 6, 6, 6, 6, 6, 6, 6, 27, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 28, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 29, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 30, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36,
+ 43, 43, 43, 43, 43, 43, 43, 43, 1, 0, 84, 86, 86, 86, 86, 86,
+ 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 43, 43, 43, 43, 43, 43,
+ 43, 7, 43, 43, 91, 86, 86, 86, 86, 86, 86, 86, 74, 86, 86, 5,
+ 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
+ 36, 80, 121, 49, 80, 49, 80, 49, 56, 80, 49, 80, 49, 80, 49, 80,
+ 49, 80, 49, 80, 49, 80, 49, 80, 78, 49, 2, 78, 13, 13, 78, 3,
+ 78, 0, 36, 110, 0, 78, 49, 38, 110, 81, 78, 36, 80, 78, 57, 20,
+ 129, 27, 29, 29, 83, 49, 80, 49, 80, 13, 49, 80, 49, 80, 49, 80,
+ 27, 83, 36, 80, 49, 2, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123,
+ 20, 121, 92, 123, 92, 123, 92, 45, 43, 73, 3, 72, 3, 120, 92, 123,
+ 20, 0, 150, 10, 1, 43, 40, 6, 6, 0, 42, 6, 42, 42, 43, 7,
+ 187, 181, 43, 30, 0, 43, 7, 43, 43, 43, 1, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 205, 70, 205, 43, 0, 37, 43, 7, 1, 6, 1, 85, 86, 86, 86,
+ 86, 86, 85, 86, 86, 2, 36, 129, 129, 129, 129, 129, 21, 129, 129, 129,
+ 0, 0, 43, 0, 178, 209, 178, 209, 178, 209, 178, 209, 0, 0, 205, 204,
+ 1, 0, 215, 215, 215, 215, 215, 131, 129, 129, 129, 129, 129, 129, 129, 129,
+ 129, 129, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 28, 0, 0, 0,
+ 0, 0, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 2, 0, 0,
+ 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
+ 49, 80, 78, 49, 80, 49, 80, 78, 49, 80, 49, 80, 49, 80, 49, 80,
+ 49, 80, 49, 80, 49, 80, 49, 2, 135, 166, 135, 166, 135, 166, 135, 166,
+ 135, 166, 135, 166, 135, 166, 135, 166, 42, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 0, 0, 0, 84, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 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, 84, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 12, 0, 12, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 7, 42, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 86, 86, 108, 129, 21, 0, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 7, 108, 3, 65, 43, 43, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 44, 86, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 12, 108, 0, 0, 0, 0, 0, 6,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
+ 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
+ 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
+ 6, 37, 6, 37, 6, 37, 6, 37, 86, 122, 158, 38, 6, 37, 6, 37,
+ 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37,
+ 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 1, 43, 43, 79, 86,
+ 86, 44, 43, 127, 86, 86, 57, 43, 43, 85, 86, 86, 43, 43, 79, 86,
+ 86, 44, 43, 127, 86, 86, 129, 55, 117, 91, 123, 92, 43, 43, 79, 86,
+ 86, 2, 172, 4, 0, 0, 57, 43, 43, 85, 86, 86, 43, 43, 79, 86,
+ 86, 44, 43, 43, 86, 86, 50, 19, 129, 87, 0, 111, 129, 126, 201, 215,
+ 126, 45, 129, 129, 14, 126, 57, 127, 111, 87, 0, 129, 129, 126, 21, 0,
+ 126, 3, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 43,
+ 36, 43, 151, 43, 43, 43, 43, 43, 43, 43, 43, 43, 42, 43, 43, 43,
+ 43, 43, 86, 86, 86, 86, 86, 128, 129, 129, 129, 129, 57, 187, 42, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 1, 129, 129, 129, 129, 129, 129, 129, 129,
+ 129, 129, 129, 129, 129, 129, 129, 201, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 208, 13, 0, 78, 49, 2, 180, 193, 193,
+ 215, 215, 36, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
+ 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80,
+ 49, 80, 49, 80, 215, 215, 83, 193, 71, 212, 215, 215, 215, 5, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 1, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 78, 49, 80, 49, 80, 49, 80,
+ 49, 80, 49, 80, 49, 80, 49, 80, 13, 0, 0, 0, 0, 0, 36, 80,
+ 49, 80, 49, 80, 49, 80, 49, 80, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 121, 92, 123, 92, 123, 79, 123, 92, 123, 92, 123,
+ 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 45,
+ 43, 43, 121, 20, 92, 123, 92, 45, 121, 42, 92, 39, 92, 123, 92, 123,
+ 92, 123, 164, 0, 10, 180, 92, 123, 92, 123, 79, 3, 42, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 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, 72, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 43, 43, 43, 43, 43, 43, 43, 43, 7, 0, 72, 86, 86, 86, 86,
+ 86, 86, 86, 86, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 85, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 14, 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, 36, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 7, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 0, 0,
+ 0, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 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, 42, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 85,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+};
+static const int rules[] = {
+ 0x0, 0x2001, -0x2000, 0x1dbf00, 0x2e700, 0x7900,
+ 0x2402, 0x101, -0x100, 0x0, 0x201, -0x200,
+ -0xc6ff, -0xe800, -0x78ff, -0x12c00, 0xc300, 0xd201,
+ 0xce01, 0xcd01, 0x4f01, 0xca01, 0xcb01, 0xcf01,
+ 0x6100, 0xd301, 0xd101, 0xa300, 0xd501, 0x8200,
+ 0xd601, 0xda01, 0xd901, 0xdb01, 0x3800, 0x3,
+ -0x4f00, -0x60ff, -0x37ff, 0x242802, 0x0, 0x101,
+ -0x100, -0xcd00, -0xda00, -0x81ff, 0x2a2b01, -0xa2ff,
+ 0x2a2801, 0x2a3f00, -0xc2ff, 0x4501, 0x4701, 0x2a1f00,
+ 0x2a1c00, 0x2a1e00, -0xd200, -0xce00, -0xca00, -0xcb00,
+ 0xa54f00, 0xa54b00, -0xcf00, 0xa52800, 0xa54400, -0xd100,
+ -0xd300, 0x29f700, 0xa54100, 0x29fd00, -0xd500, -0xd600,
+ 0x29e700, 0xa54300, 0xa52a00, -0x4500, -0xd900, -0x4700,
+ -0xdb00, 0xa51500, 0xa51200, 0x4c2402, 0x0, 0x2001,
+ -0x2000, 0x101, -0x100, 0x5400, 0x7401, 0x2601,
+ 0x2501, 0x4001, 0x3f01, -0x2600, -0x2500, -0x1f00,
+ -0x4000, -0x3f00, 0x801, -0x3e00, -0x3900, -0x2f00,
+ -0x3600, -0x800, -0x5600, -0x5000, 0x700, -0x7400,
+ -0x3bff, -0x6000, -0x6ff, 0x701a02, 0x101, -0x100,
+ 0x2001, -0x2000, 0x5001, 0xf01, -0xf00, 0x0,
+ 0x3001, -0x3000, 0x101, -0x100, 0x0, 0xbc000,
+ 0x1c6001, 0x0, 0x97d001, 0x801, -0x800, 0x8a0502,
+ 0x0, -0xbbfff, -0x186200, 0x89c200, -0x182500, -0x186e00,
+ -0x186d00, -0x186400, -0x186300, -0x185c00, 0x0, 0x8a3800,
+ 0x8a0400, 0xee600, 0x101, -0x100, 0x0, -0x3b00,
+ -0x1dbeff, 0x8f1d02, 0x800, -0x7ff, 0x0, 0x5600,
+ -0x55ff, 0x4a00, 0x6400, 0x8000, 0x7000, 0x7e00,
+ 0x900, -0x49ff, -0x8ff, -0x1c2500, -0x63ff, -0x6fff,
+ -0x7fff, -0x7dff, 0xac0502, 0x0, 0x1001, -0x1000,
+ 0x1c01, 0x101, -0x1d5cff, -0x20beff, -0x2045ff, -0x1c00,
+ 0xb10b02, 0x101, -0x100, 0x3001, -0x3000, 0x0,
+ -0x29f6ff, -0xee5ff, -0x29e6ff, -0x2a2b00, -0x2a2800, -0x2a1bff,
+ -0x29fcff, -0x2a1eff, -0x2a1dff, -0x2a3eff, 0x0, -0x1c6000,
+ 0x0, 0x101, -0x100, 0xbc0c02, 0x0, 0x101,
+ -0x100, -0xa543ff, 0x3a001, -0x8a03ff, -0xa527ff, 0x3000,
+ -0xa54eff, -0xa54aff, -0xa540ff, -0xa511ff, -0xa529ff, -0xa514ff,
+ -0x2fff, -0xa542ff, -0x8a37ff, 0x0, -0x97d000, -0x3a000,
+ 0x0, 0x2001, -0x2000, 0x0, 0x2801, -0x2800,
+ 0x0, 0x4001, -0x4000, 0x0, 0x2001, -0x2000,
+ 0x0, 0x2001, -0x2000, 0x0, 0x2201, -0x2200,
+};
+static const unsigned char rulebases[] = {
+ 0, 6, 39, 81, 111, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 124, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 131, 142, 146, 151,
+ 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 196, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 198, 201, 0, 0, 0, 219, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222,
+ 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned char exceptions[][2] = {
+ { 48, 12 }, { 49, 13 }, { 120, 14 }, { 127, 15 },
+ { 128, 16 }, { 129, 17 }, { 134, 18 }, { 137, 19 },
+ { 138, 19 }, { 142, 20 }, { 143, 21 }, { 144, 22 },
+ { 147, 19 }, { 148, 23 }, { 149, 24 }, { 150, 25 },
+ { 151, 26 }, { 154, 27 }, { 156, 25 }, { 157, 28 },
+ { 158, 29 }, { 159, 30 }, { 166, 31 }, { 169, 31 },
+ { 174, 31 }, { 177, 32 }, { 178, 32 }, { 183, 33 },
+ { 191, 34 }, { 197, 35 }, { 200, 35 }, { 203, 35 },
+ { 221, 36 }, { 242, 35 }, { 246, 37 }, { 247, 38 },
+ { 32, 45 }, { 58, 46 }, { 61, 47 }, { 62, 48 },
+ { 63, 49 }, { 64, 49 }, { 67, 50 }, { 68, 51 },
+ { 69, 52 }, { 80, 53 }, { 81, 54 }, { 82, 55 },
+ { 83, 56 }, { 84, 57 }, { 89, 58 }, { 91, 59 },
+ { 92, 60 }, { 97, 61 }, { 99, 62 }, { 101, 63 },
+ { 102, 64 }, { 104, 65 }, { 105, 66 }, { 106, 64 },
+ { 107, 67 }, { 108, 68 }, { 111, 66 }, { 113, 69 },
+ { 114, 70 }, { 117, 71 }, { 125, 72 }, { 130, 73 },
+ { 135, 74 }, { 137, 75 }, { 138, 76 }, { 139, 76 },
+ { 140, 77 }, { 146, 78 }, { 157, 79 }, { 158, 80 },
+ { 69, 87 }, { 123, 29 }, { 124, 29 }, { 125, 29 },
+ { 127, 88 }, { 134, 89 }, { 136, 90 }, { 137, 90 },
+ { 138, 90 }, { 140, 91 }, { 142, 92 }, { 143, 92 },
+ { 172, 93 }, { 173, 94 }, { 174, 94 }, { 175, 94 },
+ { 194, 95 }, { 204, 96 }, { 205, 97 }, { 206, 97 },
+ { 207, 98 }, { 208, 99 }, { 209, 100 }, { 213, 101 },
+ { 214, 102 }, { 215, 103 }, { 240, 104 }, { 241, 105 },
+ { 242, 106 }, { 243, 107 }, { 244, 108 }, { 245, 109 },
+ { 249, 110 }, { 253, 45 }, { 254, 45 }, { 255, 45 },
+ { 80, 105 }, { 81, 105 }, { 82, 105 }, { 83, 105 },
+ { 84, 105 }, { 85, 105 }, { 86, 105 }, { 87, 105 },
+ { 88, 105 }, { 89, 105 }, { 90, 105 }, { 91, 105 },
+ { 92, 105 }, { 93, 105 }, { 94, 105 }, { 95, 105 },
+ { 130, 0 }, { 131, 0 }, { 132, 0 }, { 133, 0 },
+ { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 },
+ { 192, 117 }, { 207, 118 }, { 128, 137 }, { 129, 138 },
+ { 130, 139 }, { 133, 140 }, { 134, 141 }, { 112, 157 },
+ { 113, 157 }, { 118, 158 }, { 119, 158 }, { 120, 159 },
+ { 121, 159 }, { 122, 160 }, { 123, 160 }, { 124, 161 },
+ { 125, 161 }, { 179, 162 }, { 186, 163 }, { 187, 163 },
+ { 188, 164 }, { 190, 165 }, { 195, 162 }, { 204, 164 },
+ { 218, 166 }, { 219, 166 }, { 229, 106 }, { 234, 167 },
+ { 235, 167 }, { 236, 110 }, { 243, 162 }, { 248, 168 },
+ { 249, 168 }, { 250, 169 }, { 251, 169 }, { 252, 164 },
+ { 38, 176 }, { 42, 177 }, { 43, 178 }, { 78, 179 },
+ { 132, 8 }, { 98, 186 }, { 99, 187 }, { 100, 188 },
+ { 101, 189 }, { 102, 190 }, { 109, 191 }, { 110, 192 },
+ { 111, 193 }, { 112, 194 }, { 126, 195 }, { 127, 195 },
+ { 125, 207 }, { 141, 208 }, { 148, 209 }, { 171, 210 },
+ { 172, 211 }, { 173, 212 }, { 176, 213 }, { 177, 214 },
+ { 178, 215 }, { 196, 216 }, { 197, 217 }, { 198, 218 },
+};
diff --git a/lib/libc/musl/src/ctype/nonspacing.h b/lib/libc/musl/src/ctype/nonspacing.h
index 48231e73fb063a55729229573a2dbf43716d32c6..5d05a3d1a064737b3a8357f2d0084f34b4d5c7ba 100644
--- a/lib/libc/musl/src/ctype/nonspacing.h
+++ b/lib/libc/musl/src/ctype/nonspacing.h
@@ -8,16 +8,16 @@
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50,
-51,16,52,53,54,16,16,16,16,16,16,55,16,16,16,16,16,56,57,58,59,60,61,62,63,16,
-16,64,16,65,66,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+51,16,52,53,54,16,16,16,16,16,16,55,16,16,56,16,57,58,59,60,61,62,63,64,65,66,
+67,68,16,69,70,71,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,73,74,16,16,16,75,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,67,68,16,16,16,69,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,70,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,71,72,16,16,16,16,16,16,16,73,16,16,16,16,16,74,16,16,16,16,16,16,16,75,
-76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,77,78,16,16,16,16,16,16,16,79,16,16,16,16,16,80,81,82,16,16,16,16,16,83,
+84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
@@ -25,16 +25,16 @@
0,0,0,0,0,0,0,248,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,0,254,255,255,255,255,191,182,0,0,0,0,0,0,0,63,0,255,23,0,0,0,0,0,248,255,
255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,192,191,159,61,0,0,0,128,2,0,0,0,255,255,255,
-7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,0,0,0,192,251,239,62,0,0,0,
-0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,255,255,255,255,
+7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,32,0,0,192,251,239,62,0,0,
+0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,
255,7,0,0,0,0,0,0,20,254,33,254,0,12,0,0,0,2,0,0,0,0,0,0,16,30,32,0,0,12,0,0,
-0,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0,252,
-2,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,1,0,0,
-0,0,0,0,192,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0,0,0,
-0,0,0,24,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0,242,
-7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,27,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160,2,0,
-0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0,0,
-224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0,
+64,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0,
+252,2,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,17,
+0,0,0,0,0,0,192,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0,
+0,0,0,0,0,24,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0,
+242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,31,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160,
+2,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0,
+0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,
0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,120,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0,
@@ -48,9 +48,9 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,
0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,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,128,247,63,0,0,0,192,0,0,0,0,0,0,0,0,0,0,3,0,68,8,0,0,96,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,0,0,0,0,0,192,63,0,0,128,255,3,0,0,
-0,0,0,7,0,0,0,0,0,200,19,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0,
-16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,
+0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,128,255,3,0,
+0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,
+0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,
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,32,33,0,0,0,0,0,64,
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,255,255,0,0,255,255,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,128,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -58,24 +58,32 @@
0,0,0,0,0,0,0,0,0,0,0,0,32,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,
-0,2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,0,0,0,0,0,0,0,7,
-0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,28,0,0,0,0,0,0,0,0,0,
-0,0,128,211,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,
-0,0,16,1,0,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
-92,0,0,0,0,0,0,0,0,0,0,0,0,0,248,133,13,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,60,176,1,0,0,48,0,0,0,0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,
-0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,0,224,188,15,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,126,6,0,0,0,0,248,121,128,0,126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,127,191,0,0,0,0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-96,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,
-0,60,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
-255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0,
-0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,
-0,0,0,0,0,0,0,240,7,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,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,192,255,1,0,0,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,255,
+127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,
+0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192,
+31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0,
+0,0,0,0,0,248,133,13,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,60,176,1,0,0,48,0,0,0,
+0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,
+0,224,188,15,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,
+128,255,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,
+126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0,
+0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,180,191,0,
+0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
+0,0,0,0,0,0,0,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,
+0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,
+254,255,0,0,0,0,0,0,0,0,0,
+0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,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,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/lib/libc/musl/src/ctype/punct.h b/lib/libc/musl/src/ctype/punct.h
index 7a6239405ae6a05e8f2a8407459ce367835a319f..67929470c9e0ec164895b65c1073a086cc94b279 100644
--- a/lib/libc/musl/src/ctype/punct.h
+++ b/lib/libc/musl/src/ctype/punct.h
@@ -8,17 +8,17 @@
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,64,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,65,16,16,66,16,67,68,
-69,16,70,71,72,16,73,16,16,74,75,76,77,78,16,79,16,80,81,82,83,84,85,86,87,88,
-16,89,16,90,91,16,16,16,16,16,16,92,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+69,16,70,71,72,16,73,16,16,74,75,76,77,78,16,79,80,81,82,83,84,85,86,87,88,89,
+90,91,16,92,93,94,95,16,16,16,16,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,97,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,98,99,16,16,100,101,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,93,94,16,16,16,95,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,97,98,99,100,16,16,101,102,17,17,103,16,16,16,16,16,16,16,16,16,16,16,16,
-16,104,105,16,16,16,16,106,16,107,108,109,17,17,17,110,111,112,113,16,16,16,
-16,16,
+16,16,16,16,16,16,16,16,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,103,104,105,106,16,16,107,108,17,17,109,16,16,16,16,16,16,110,111,16,
+16,16,16,16,112,113,16,16,114,115,116,16,117,118,119,17,17,17,120,121,122,123,
+124,16,16,16,16,
16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1,
@@ -28,25 +28,25 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,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,252,0,0,0,0,0,230,254,255,255,255,0,64,73,0,0,0,0,0,24,0,255,255,0,216,
0,0,0,0,0,0,0,1,0,60,0,0,0,0,0,0,0,0,0,0,0,0,16,224,1,30,0,
-96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,3,
-0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,252,0,0,0,0,0,
-0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,47,0,0,0,0,0,
-0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,224,0,0,0,0,0,0,0,16,
-0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,32,0,
-0,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,160,0,127,0,
-0,255,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,0,12,0,0,
-0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,
+96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,
+227,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,7,252,0,0,0,
+0,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,111,0,0,0,
+0,0,0,0,16,0,32,0,0,0,0,64,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,224,0,0,0,0,0,0,
+0,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,16,0,0,0,0,0,0,0,0,
+32,0,0,0,0,128,255,16,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,160,
+0,127,0,0,255,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,
+0,12,0,0,0,0,0,0,0,0,0,0,0,4,0,31,0,0,0,0,0,
0,254,255,255,255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223,
-255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0,
-0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,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,0,0,0,
-0,0,0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,196,255,255,255,
+255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,
+0,0,8,0,0,0,0,0,0,0,0,0,0,0,224,255,255,255,31,0,0,255,3,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,0,0,0,0,0,
+0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,196,255,255,255,
255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,127,63,255,127,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,0,12,0,0,0,0,0,0,64,0,
-12,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,
+12,240,0,0,0,0,0,0,128,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,
255,33,144,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,255,255,255,255,
127,0,224,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,3,224,0,224,0,
224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,223,255,241,127,255,
@@ -55,22 +55,23 @@
255,255,255,255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255,
255,63,0,0,0,0,0,0,252,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,207,255,255,255,
-63,255,255,255,255,227,255,253,7,0,0,240,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,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,128,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,255,255,3,0,0,0,0,0,0,
-255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,
+63,255,255,255,255,255,255,255,255,255,255,255,255,255,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,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,255,255,255,0,
+0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,0,0,0,0,0,0,
-0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
-0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,
+0,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
+255,255,255,
+255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,0,0,
0,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-68,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,23,
-0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,32,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,240,0,0,128,59,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,
+64,0,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,23,
+0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,240,0,0,128,3,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,
0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,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,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,128,0,0,0,0,0,2,0,0,0,0,0,0,
@@ -84,46 +85,57 @@
0,0,0,0,0,0,0,0,0,128,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,
128,255,0,0,128,255,0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,248,0,0,192,143,0,0,0,
128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,252,255,255,255,255,255,0,0,0,0,
-0,0,0,135,255,0,255,1,0,0,0,224,0,0,0,224,0,0,0,0,0,1,0,0,96,248,127,0,0,0,0,
+0,0,0,135,255,1,255,1,0,0,0,224,0,0,0,224,0,0,0,0,0,1,0,0,96,248,127,0,0,0,0,
0,0,0,0,254,0,0,0,255,0,0,0,255,0,0,0,30,0,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,0,0,
0,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,128,3,0,0,0,0,0,0,254,3,0,0,0,0,0,0,0,
-0,0,0,0,0,0,24,0,15,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,225,63,0,232,254,255,31,0,
-0,0,0,0,0,0,96,63,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,
-0,16,0,32,0,0,192,31,31,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,68,
-248,0,40,0,0,0,0,0,0,0,0,0,0,0,0,76,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,128,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,128,14,0,0,0,255,31,
-0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,252,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,224,127,0,0,0,192,255,255,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,192,63,252,255,63,0,0,128,3,0,0,0,0,0,0,254,3,32,0,0,0,0,0,0,0,
+0,0,0,0,0,24,0,15,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,225,63,0,232,254,255,31,0,0,
+0,0,0,0,0,96,63,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,
+24,0,32,0,0,192,31,31,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,68,
+248,0,104,0,0,0,0,0,0,0,0,0,0,0,0,76,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,128,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,128,14,0,0,0,255,
+31,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,8,0,252,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,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,7,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,5,0,0,0,0,0,0,0,0,0,24,128,255,0,0,0,0,0,
+0,0,0,0,0,223,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,252,255,31,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,52,0,0,0,0,0,0,0,0,0,128,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,128,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,255,255,255,255,255,
+255,3,
+128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,255,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,0,0,0,
+0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,255,255,48,0,0,248,
+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,0,0,0,0,255,
+255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,15,0,0,0,0,0,0,
+0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,63,
+0,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,1,0,0,255,255,255,255,255,255,255,255,
+63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,15,0,255,255,255,255,255,255,
+255,255,255,255,127,0,255,255,255,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,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,
+0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,15,0,248,254,255,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,127,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,
+128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,127,0,0,0,0,0,0,0,
+0,0,0,0,0,0,112,7,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,254,255,
+255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,
+15,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,255,254,
+255,254,255,255,255,63,0,255,31,255,255,255,255,0,0,0,252,0,0,0,28,0,0,0,252,
+255,255,255,31,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,15,255,1,3,
+0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,63,0,255,31,255,7,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,1,
+255,15,0,0,255,15,255,255,255,255,255,255,255,0,255,3,255,255,255,255,255,0,
+255,255,255,63,0,0,0,0,0,0,0,0,0,0,255,239,255,255,255,255,255,255,255,255,
+255,255,255,255,123,252,255,255,255,255,231,199,255,255,255,231,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,63,15,7,7,0,63,0,
0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,7,0,0,0,0,0,0,
-0,24,128,255,0,0,0,0,0,0,0,0,0,0,223,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-128,62,0,0,252,255,31,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,52,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,
-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,192,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,128,255,48,0,0,248,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,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,
-0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,15,0,0,0,0,0,0,0,0,0,0,0,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,1,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,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,0,0,0,0,0,0,0,0,0,0,2,0,
-0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,
-0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,
-248,254,255,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,127,0,0,0,0,0,0,0,0,
-0,0,0,0,0,112,7,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,15,255,
-255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,255,254,255,254,
-255,255,255,63,0,255,31,255,255,255,127,0,0,0,252,0,0,0,12,0,0,0,252,255,255,
-255,31,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,15,255,1,3,0,63,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,255,31,
-255,1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,
-255,255,255,255,255,255,255,255,31,0,0,0,0,
-0,255,15,255,255,255,255,255,255,255,0,255,3,255,255,255,255,255,0,255,255,
-255,63,0,0,0,0,0,0,0,0,0,0,255,15,255,255,255,255,255,127,255,31,255,255,255,
-15,0,0,255,255,255,0,0,0,0,0,1,0,255,255,127,0,0,0,
diff --git a/lib/libc/musl/src/ctype/towctrans.c b/lib/libc/musl/src/ctype/towctrans.c
index 8f6810184e08c1430aa9d652fbcf4c18fb037499..76d137696ee9eb9bfef6607f49ae24779f918dc0 100644
--- a/lib/libc/musl/src/ctype/towctrans.c
+++ b/lib/libc/musl/src/ctype/towctrans.c
@@ -1,307 +1,73 @@
-#include
-#include
#include
-#define CASEMAP(u1,u2,l) { (u1), (l)-(u1), (u2)-(u1)+1 }
-#define CASELACE(u1,u2) CASEMAP((u1),(u2),(u1)+1)
+static const unsigned char tab[];
-static const struct {
- unsigned short upper;
- signed char lower;
- unsigned char len;
-} casemaps[] = {
- CASEMAP(0xc0,0xde,0xe0),
+static const unsigned char rulebases[512];
+static const int rules[];
- CASELACE(0x0100,0x012e),
- CASELACE(0x0132,0x0136),
- CASELACE(0x0139,0x0147),
- CASELACE(0x014a,0x0176),
- CASELACE(0x0179,0x017d),
+static const unsigned char exceptions[][2];
- CASELACE(0x370,0x372),
- CASEMAP(0x391,0x3a1,0x3b1),
- CASEMAP(0x3a3,0x3ab,0x3c3),
- CASEMAP(0x400,0x40f,0x450),
- CASEMAP(0x410,0x42f,0x430),
+#include "casemap.h"
- CASELACE(0x460,0x480),
- CASELACE(0x48a,0x4be),
- CASELACE(0x4c1,0x4cd),
- CASELACE(0x4d0,0x50e),
-
- CASELACE(0x514,0x52e),
- CASEMAP(0x531,0x556,0x561),
-
- CASELACE(0x01a0,0x01a4),
- CASELACE(0x01b3,0x01b5),
- CASELACE(0x01cd,0x01db),
- CASELACE(0x01de,0x01ee),
- CASELACE(0x01f8,0x021e),
- CASELACE(0x0222,0x0232),
- CASELACE(0x03d8,0x03ee),
-
- CASELACE(0x1e00,0x1e94),
- CASELACE(0x1ea0,0x1efe),
-
- CASEMAP(0x1f08,0x1f0f,0x1f00),
- CASEMAP(0x1f18,0x1f1d,0x1f10),
- CASEMAP(0x1f28,0x1f2f,0x1f20),
- CASEMAP(0x1f38,0x1f3f,0x1f30),
- CASEMAP(0x1f48,0x1f4d,0x1f40),
-
- CASEMAP(0x1f68,0x1f6f,0x1f60),
- CASEMAP(0x1f88,0x1f8f,0x1f80),
- CASEMAP(0x1f98,0x1f9f,0x1f90),
- CASEMAP(0x1fa8,0x1faf,0x1fa0),
- CASEMAP(0x1fb8,0x1fb9,0x1fb0),
- CASEMAP(0x1fba,0x1fbb,0x1f70),
- CASEMAP(0x1fc8,0x1fcb,0x1f72),
- CASEMAP(0x1fd8,0x1fd9,0x1fd0),
- CASEMAP(0x1fda,0x1fdb,0x1f76),
- CASEMAP(0x1fe8,0x1fe9,0x1fe0),
- CASEMAP(0x1fea,0x1feb,0x1f7a),
- CASEMAP(0x1ff8,0x1ff9,0x1f78),
- CASEMAP(0x1ffa,0x1ffb,0x1f7c),
-
- CASEMAP(0x13f0,0x13f5,0x13f8),
- CASELACE(0xa698,0xa69a),
- CASELACE(0xa796,0xa79e),
-
- CASELACE(0x246,0x24e),
- CASELACE(0x510,0x512),
- CASEMAP(0x2160,0x216f,0x2170),
- CASEMAP(0x2c00,0x2c2e,0x2c30),
- CASELACE(0x2c67,0x2c6b),
- CASELACE(0x2c80,0x2ce2),
- CASELACE(0x2ceb,0x2ced),
-
- CASELACE(0xa640,0xa66c),
- CASELACE(0xa680,0xa696),
-
- CASELACE(0xa722,0xa72e),
- CASELACE(0xa732,0xa76e),
- CASELACE(0xa779,0xa77b),
- CASELACE(0xa77e,0xa786),
-
- CASELACE(0xa790,0xa792),
- CASELACE(0xa7a0,0xa7a8),
-
- CASELACE(0xa7b4,0xa7b6),
-
- CASEMAP(0xff21,0xff3a,0xff41),
- { 0,0,0 }
-};
-
-static const unsigned short pairs[][2] = {
- { 'I', 0x0131 },
- { 'S', 0x017f },
- { 0x0130, 'i' },
- { 0x0178, 0x00ff },
- { 0x0181, 0x0253 },
- { 0x0182, 0x0183 },
- { 0x0184, 0x0185 },
- { 0x0186, 0x0254 },
- { 0x0187, 0x0188 },
- { 0x0189, 0x0256 },
- { 0x018a, 0x0257 },
- { 0x018b, 0x018c },
- { 0x018e, 0x01dd },
- { 0x018f, 0x0259 },
- { 0x0190, 0x025b },
- { 0x0191, 0x0192 },
- { 0x0193, 0x0260 },
- { 0x0194, 0x0263 },
- { 0x0196, 0x0269 },
- { 0x0197, 0x0268 },
- { 0x0198, 0x0199 },
- { 0x019c, 0x026f },
- { 0x019d, 0x0272 },
- { 0x019f, 0x0275 },
- { 0x01a6, 0x0280 },
- { 0x01a7, 0x01a8 },
- { 0x01a9, 0x0283 },
- { 0x01ac, 0x01ad },
- { 0x01ae, 0x0288 },
- { 0x01af, 0x01b0 },
- { 0x01b1, 0x028a },
- { 0x01b2, 0x028b },
- { 0x01b7, 0x0292 },
- { 0x01b8, 0x01b9 },
- { 0x01bc, 0x01bd },
- { 0x01c4, 0x01c6 },
- { 0x01c4, 0x01c5 },
- { 0x01c5, 0x01c6 },
- { 0x01c7, 0x01c9 },
- { 0x01c7, 0x01c8 },
- { 0x01c8, 0x01c9 },
- { 0x01ca, 0x01cc },
- { 0x01ca, 0x01cb },
- { 0x01cb, 0x01cc },
- { 0x01f1, 0x01f3 },
- { 0x01f1, 0x01f2 },
- { 0x01f2, 0x01f3 },
- { 0x01f4, 0x01f5 },
- { 0x01f6, 0x0195 },
- { 0x01f7, 0x01bf },
- { 0x0220, 0x019e },
- { 0x0386, 0x03ac },
- { 0x0388, 0x03ad },
- { 0x0389, 0x03ae },
- { 0x038a, 0x03af },
- { 0x038c, 0x03cc },
- { 0x038e, 0x03cd },
- { 0x038f, 0x03ce },
- { 0x0399, 0x0345 },
- { 0x0399, 0x1fbe },
- { 0x03a3, 0x03c2 },
- { 0x03f7, 0x03f8 },
- { 0x03fa, 0x03fb },
- { 0x1e60, 0x1e9b },
- { 0x1e9e, 0xdf },
-
- { 0x1f59, 0x1f51 },
- { 0x1f5b, 0x1f53 },
- { 0x1f5d, 0x1f55 },
- { 0x1f5f, 0x1f57 },
- { 0x1fbc, 0x1fb3 },
- { 0x1fcc, 0x1fc3 },
- { 0x1fec, 0x1fe5 },
- { 0x1ffc, 0x1ff3 },
-
- { 0x23a, 0x2c65 },
- { 0x23b, 0x23c },
- { 0x23d, 0x19a },
- { 0x23e, 0x2c66 },
- { 0x241, 0x242 },
- { 0x243, 0x180 },
- { 0x244, 0x289 },
- { 0x245, 0x28c },
- { 0x3f4, 0x3b8 },
- { 0x3f9, 0x3f2 },
- { 0x3fd, 0x37b },
- { 0x3fe, 0x37c },
- { 0x3ff, 0x37d },
- { 0x4c0, 0x4cf },
-
- { 0x2126, 0x3c9 },
- { 0x212a, 'k' },
- { 0x212b, 0xe5 },
- { 0x2132, 0x214e },
- { 0x2183, 0x2184 },
- { 0x2c60, 0x2c61 },
- { 0x2c62, 0x26b },
- { 0x2c63, 0x1d7d },
- { 0x2c64, 0x27d },
- { 0x2c6d, 0x251 },
- { 0x2c6e, 0x271 },
- { 0x2c6f, 0x250 },
- { 0x2c70, 0x252 },
- { 0x2c72, 0x2c73 },
- { 0x2c75, 0x2c76 },
- { 0x2c7e, 0x23f },
- { 0x2c7f, 0x240 },
- { 0x2cf2, 0x2cf3 },
-
- { 0xa77d, 0x1d79 },
- { 0xa78b, 0xa78c },
- { 0xa78d, 0x265 },
- { 0xa7aa, 0x266 },
-
- { 0x10c7, 0x2d27 },
- { 0x10cd, 0x2d2d },
-
- /* bogus greek 'symbol' letters */
- { 0x376, 0x377 },
- { 0x39c, 0xb5 },
- { 0x392, 0x3d0 },
- { 0x398, 0x3d1 },
- { 0x3a6, 0x3d5 },
- { 0x3a0, 0x3d6 },
- { 0x39a, 0x3f0 },
- { 0x3a1, 0x3f1 },
- { 0x395, 0x3f5 },
- { 0x3cf, 0x3d7 },
-
- { 0xa7ab, 0x25c },
- { 0xa7ac, 0x261 },
- { 0xa7ad, 0x26c },
- { 0xa7ae, 0x26a },
- { 0xa7b0, 0x29e },
- { 0xa7b1, 0x287 },
- { 0xa7b2, 0x29d },
- { 0xa7b3, 0xab53 },
-
- /* special cyrillic lowercase forms */
- { 0x412, 0x1c80 },
- { 0x414, 0x1c81 },
- { 0x41e, 0x1c82 },
- { 0x421, 0x1c83 },
- { 0x422, 0x1c84 },
- { 0x422, 0x1c85 },
- { 0x42a, 0x1c86 },
- { 0x462, 0x1c87 },
- { 0xa64a, 0x1c88 },
-
- { 0,0 }
-};
-
-
-static wchar_t __towcase(wchar_t wc, int lower)
+static int casemap(unsigned c, int dir)
{
- int i;
- int lmul = 2*lower-1;
- int lmask = lower-1;
- /* no letters with case in these large ranges */
- if (!iswalpha(wc)
- || (unsigned)wc - 0x0600 <= 0x0fff-0x0600
- || (unsigned)wc - 0x2e00 <= 0xa63f-0x2e00
- || (unsigned)wc - 0xa800 <= 0xab52-0xa800
- || (unsigned)wc - 0xabc0 <= 0xfeff-0xabc0)
- return wc;
- /* special case because the diff between upper/lower is too big */
- if (lower && (unsigned)wc - 0x10a0 < 0x2e)
- if (wc>0x10c5 && wc != 0x10c7 && wc != 0x10cd) return wc;
- else return wc + 0x2d00 - 0x10a0;
- if (!lower && (unsigned)wc - 0x2d00 < 0x26)
- if (wc>0x2d25 && wc != 0x2d27 && wc != 0x2d2d) return wc;
- else return wc + 0x10a0 - 0x2d00;
- if (lower && (unsigned)wc - 0x13a0 < 0x50)
- return wc + 0xab70 - 0x13a0;
- if (!lower && (unsigned)wc - 0xab70 < 0x50)
- return wc + 0x13a0 - 0xab70;
- for (i=0; casemaps[i].len; i++) {
- int base = casemaps[i].upper + (lmask & casemaps[i].lower);
- if ((unsigned)wc-base < casemaps[i].len) {
- if (casemaps[i].lower == 1)
- return wc + lower - ((wc-casemaps[i].upper)&1);
- return wc + lmul*casemaps[i].lower;
+ unsigned b, x, y, v, rt, xb, xn;
+ int r, rd, c0 = c;
+
+ if (c >= 0x20000) return c;
+
+ b = c>>8;
+ c &= 255;
+ x = c/3;
+ y = c%3;
+
+ /* lookup entry in two-level base-6 table */
+ v = tab[tab[b]*86+x];
+ static const int mt[] = { 2048, 342, 57 };
+ v = (v*mt[y]>>11)%6;
+
+ /* use the bit vector out of the tables as an index into
+ * a block-specific set of rules and decode the rule into
+ * a type and a case-mapping delta. */
+ r = rules[rulebases[b]+v];
+ rt = r & 255;
+ rd = r >> 8;
+
+ /* rules 0/1 are simple lower/upper case with a delta.
+ * apply according to desired mapping direction. */
+ if (rt < 2) return c0 + (rd & -(rt^dir));
+
+ /* binary search. endpoints of the binary search for
+ * this block are stored in the rule delta field. */
+ xn = rd & 0xff;
+ xb = (unsigned)rd >> 8;
+ while (xn) {
+ unsigned try = exceptions[xb+xn/2][0];
+ if (try == c) {
+ r = rules[exceptions[xb+xn/2][1]];
+ rt = r & 255;
+ rd = r >> 8;
+ if (rt < 2) return c0 + (rd & -(rt^dir));
+ /* Hard-coded for the four exceptional titlecase */
+ return c0 + (dir ? -1 : 1);
+ } else if (try > c) {
+ xn /= 2;
+ } else {
+ xb += xn/2;
+ xn -= xn/2;
}
}
- for (i=0; pairs[i][1-lower]; i++) {
- if (pairs[i][1-lower] == wc)
- return pairs[i][lower];
- }
- if ((unsigned)wc - (0x10428 - 0x28*lower) < 0x28)
- return wc - 0x28 + 0x50*lower;
- if ((unsigned)wc - (0x104d8 - 0x28*lower) < 0x24)
- return wc - 0x28 + 0x50*lower;
- if ((unsigned)wc - (0x10cc0 - 0x40*lower) < 0x33)
- return wc - 0x40 + 0x80*lower;
- if ((unsigned)wc - (0x118c0 - 0x20*lower) < 0x20)
- return wc - 0x20 + 0x40*lower;
- if ((unsigned)wc - (0x1e922 - 0x22*lower) < 0x22)
- return wc - 0x22 + 0x44*lower;
- return wc;
-}
-
-wint_t towupper(wint_t wc)
-{
- return (unsigned)wc < 128 ? toupper(wc) : __towcase(wc, 0);
+ return c0;
}
wint_t towlower(wint_t wc)
{
- return (unsigned)wc < 128 ? tolower(wc) : __towcase(wc, 1);
+ return casemap(wc, 0);
+}
+
+wint_t towupper(wint_t wc)
+{
+ return casemap(wc, 1);
}
wint_t __towupper_l(wint_t c, locale_t l)
diff --git a/lib/libc/musl/src/ctype/wcwidth.c b/lib/libc/musl/src/ctype/wcwidth.c
index 49c40eea8cabfc6f1a0a30aafda9625e85b82611..36256a538551bca3b2c2e7d751f5f05dced856f9 100644
--- a/lib/libc/musl/src/ctype/wcwidth.c
+++ b/lib/libc/musl/src/ctype/wcwidth.c
@@ -23,7 +23,7 @@ int wcwidth(wchar_t wc)
return -1;
if (wc-0x20000U < 0x20000)
return 2;
- if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef)
+ if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100U < 0xef)
return 0;
return 1;
}
diff --git a/lib/libc/musl/src/ctype/wide.h b/lib/libc/musl/src/ctype/wide.h
index e4672b23cef0b37114ea51cb33dc524b1e9536f3..e403c9a5a2fab6de9066fdba63a8179496cc4022 100644
--- a/lib/libc/musl/src/ctype/wide.h
+++ b/lib/libc/musl/src/ctype/wide.h
@@ -17,7 +17,7 @@
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,38,39,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-16,16,16,16,16,16,16,40,41,42,43,44,45,46,16,16,47,16,16,16,16,16,
+16,16,16,16,16,16,16,40,41,42,43,44,45,46,47,16,48,49,16,16,16,16,
16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
@@ -31,10 +31,10 @@
255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,255,255,255,255,
255,255,255,127,254,255,255,255,255,255,255,255,255,255,127,254,255,255,255,
-255,255,255,255,255,255,255,255,255,224,255,255,255,255,127,254,255,255,255,
+255,255,255,255,255,255,255,255,255,224,255,255,255,255,255,254,255,255,255,
255,255,255,255,255,255,255,127,255,255,255,255,255,7,255,255,255,255,15,0,
255,255,255,255,255,127,255,255,255,255,255,0,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,
0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,31,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
@@ -43,13 +43,13 @@
255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,255,3,0,0,255,255,255,255,247,255,127,15,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,255,255,255,
255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,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,3,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,
-0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,0,0,
-0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,
+255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,
+0,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,
15,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,64,254,7,0,0,0,0,0,0,0,0,0,0,0,0,7,0,255,255,255,
255,255,15,255,1,3,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,
@@ -58,6 +58,8 @@
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
159,255,255,255,255,255,255,255,63,0,120,255,255,255,0,0,4,0,0,96,0,16,0,0,0,
0,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,255,255,
-255,255,255,255,255,255,63,16,7,0,0,24,240,1,0,0,255,255,255,255,255,127,255,
-31,255,255,255,15,0,0,255,255,255,0,0,0,0,0,1,0,255,255,127,0,0,
-0,
+255,255,255,255,255,255,63,16,39,0,0,24,240,7,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,255,15,0,
+0,0,224,255,255,255,255,255,255,255,255,255,255,255,255,123,252,255,255,255,
+255,231,199,255,255,255,231,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,15,7,7,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/lib/libc/musl/src/fenv/riscv64/fenv.S b/lib/libc/musl/src/fenv/riscv64/fenv.S
index f149003d2eeade71c05fd188d913d2256f918f43..0ea78bf9ac8da26706215e4696a5d865c830e2c1 100644
--- a/lib/libc/musl/src/fenv/riscv64/fenv.S
+++ b/lib/libc/musl/src/fenv/riscv64/fenv.S
@@ -45,8 +45,11 @@ fegetenv:
.global fesetenv
.type fesetenv, %function
fesetenv:
+ li t2, -1
+ li t1, 0
+ beq a0, t2, 1f
lw t1, 0(a0)
- fscsr t0, t1
+1: fscsr t1
li a0, 0
ret
diff --git a/lib/libc/musl/src/internal/dynlink.h b/lib/libc/musl/src/internal/dynlink.h
index ffd06b0471b9855691cc70c40486313c09d7da7c..764e3a1a8fa932ab613e854998055cff3e7e0638 100644
--- a/lib/libc/musl/src/internal/dynlink.h
+++ b/lib/libc/musl/src/internal/dynlink.h
@@ -96,7 +96,6 @@ struct fdpic_dummy_loadmap {
#define DYN_CNT 32
typedef void (*stage2_func)(unsigned char *, size_t *);
-typedef void (*stage3_func)(size_t *);
hidden void *__dlsym(void *restrict, const char *restrict, void *restrict);
diff --git a/lib/libc/musl/src/internal/floatscan.c b/lib/libc/musl/src/internal/floatscan.c
index 278bf25025d64e1b6375e1b2a57ab5e2b3306246..8c0828fcb39e6e0e742309913eef1aa955e582e5 100644
--- a/lib/libc/musl/src/internal/floatscan.c
+++ b/lib/libc/musl/src/internal/floatscan.c
@@ -33,9 +33,6 @@
#define MASK (KMAX-1)
-#define CONCAT2(x,y) x ## y
-#define CONCAT(x,y) CONCAT2(x,y)
-
static long long scanexp(FILE *f, int pok)
{
int c;
@@ -301,7 +298,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
y -= bias;
if ((e2+LDBL_MANT_DIG & INT_MAX) > emax-5) {
- if (fabs(y) >= CONCAT(0x1p, LDBL_MANT_DIG)) {
+ if (fabsl(y) >= 2/LDBL_EPSILON) {
if (denormal && bits==LDBL_MANT_DIG+e2-emin)
denormal = 0;
y *= 0.5;
diff --git a/lib/libc/musl/src/internal/syscall.h b/lib/libc/musl/src/internal/syscall.h
index 9f2784dbafea868dd3f4eb8a69b2ad81d32cc0c8..975a0031d4fb6ef46892ba5e97821bc5b09e2c80 100644
--- a/lib/libc/musl/src/internal/syscall.h
+++ b/lib/libc/musl/src/internal/syscall.h
@@ -193,6 +193,45 @@ hidden long __syscall_ret(unsigned long),
#define SYS_sendfile SYS_sendfile64
#endif
+#ifndef SYS_timer_settime
+#define SYS_timer_settime SYS_timer_settime32
+#endif
+
+#ifndef SYS_timer_gettime
+#define SYS_timer_gettime SYS_timer_gettime32
+#endif
+
+#ifndef SYS_timerfd_settime
+#define SYS_timerfd_settime SYS_timerfd_settime32
+#endif
+
+#ifndef SYS_timerfd_gettime
+#define SYS_timerfd_gettime SYS_timerfd_gettime32
+#endif
+
+#ifndef SYS_clock_settime
+#define SYS_clock_settime SYS_clock_settime32
+#endif
+
+#ifndef SYS_clock_gettime
+#define SYS_clock_gettime SYS_clock_gettime32
+#endif
+
+#ifndef SYS_clock_getres
+#define SYS_clock_getres SYS_clock_getres_time32
+#endif
+
+#ifndef SYS_clock_nanosleep
+#define SYS_clock_nanosleep SYS_clock_nanosleep_time32
+#endif
+
+#ifndef SYS_gettimeofday
+#define SYS_gettimeofday SYS_gettimeofday_time32
+#endif
+
+#ifndef SYS_settimeofday
+#define SYS_settimeofday SYS_settimeofday_time32
+#endif
/* Ensure that the plain syscall names are defined even for "time64-only"
* archs. These facilitate callers passing null time arguments, and make
@@ -306,6 +345,13 @@ hidden long __syscall_ret(unsigned long),
#define SO_SNDTIMEO_OLD 21
#endif
+#define SO_TIMESTAMP_OLD 29
+#define SO_TIMESTAMPNS_OLD 35
+#define SO_TIMESTAMPING_OLD 37
+#define SCM_TIMESTAMP_OLD SO_TIMESTAMP_OLD
+#define SCM_TIMESTAMPNS_OLD SO_TIMESTAMPNS_OLD
+#define SCM_TIMESTAMPING_OLD SO_TIMESTAMPING_OLD
+
#ifndef SIOCGSTAMP_OLD
#define SIOCGSTAMP_OLD 0x8906
#endif
diff --git a/lib/libc/musl/src/internal/version.h b/lib/libc/musl/src/internal/version.h
index 56294c973cc0ebde3df6fe480911683558d9afe5..fc7215c7b327ae0668d043b4329bf249fbe570bf 100644
--- a/lib/libc/musl/src/internal/version.h
+++ b/lib/libc/musl/src/internal/version.h
@@ -1 +1 @@
-#define VERSION "1.1.24"
+#define VERSION "1.2.0"
diff --git a/lib/libc/musl/src/ldso/__dlsym.c b/lib/libc/musl/src/ldso/__dlsym.c
index 8ac0a33491f6276227877fb8d2556fae3392e1e2..0384f97e96099259b918c2f9d52c618e41f37135 100644
--- a/lib/libc/musl/src/ldso/__dlsym.c
+++ b/lib/libc/musl/src/ldso/__dlsym.c
@@ -8,3 +8,7 @@ static void *stub_dlsym(void *restrict p, const char *restrict s, void *restrict
}
weak_alias(stub_dlsym, __dlsym);
+
+#if _REDIR_TIME64
+weak_alias(stub_dlsym, __dlsym_redir_time64);
+#endif
diff --git a/lib/libc/musl/src/ldso/arm/dlsym_time64.S b/lib/libc/musl/src/ldso/arm/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/arm/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/i386/dlsym_time64.S b/lib/libc/musl/src/ldso/i386/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/i386/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/m68k/dlsym_time64.S b/lib/libc/musl/src/ldso/m68k/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/m68k/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/microblaze/dlsym_time64.S b/lib/libc/musl/src/ldso/microblaze/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/microblaze/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/mips/dlsym_time64.S b/lib/libc/musl/src/ldso/mips/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/mips/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/mipsn32/dlsym_time64.S b/lib/libc/musl/src/ldso/mipsn32/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/mipsn32/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/or1k/dlsym_time64.S b/lib/libc/musl/src/ldso/or1k/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/or1k/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/powerpc/dlsym_time64.S b/lib/libc/musl/src/ldso/powerpc/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/powerpc/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/ldso/sh/dlsym_time64.S b/lib/libc/musl/src/ldso/sh/dlsym_time64.S
new file mode 100644
index 0000000000000000000000000000000000000000..bb2e70408f0e7e6d277d65996308f06f3dfb47b1
--- /dev/null
+++ b/lib/libc/musl/src/ldso/sh/dlsym_time64.S
@@ -0,0 +1,3 @@
+#define __dlsym __dlsym_redir_time64
+#define dlsym __dlsym_time64
+#include "dlsym.s"
diff --git a/lib/libc/musl/src/linux/clock_adjtime.c b/lib/libc/musl/src/linux/clock_adjtime.c
index 2f531397c3309618d28186fdfff3ba368559700b..23eb8729db0638aa680bcc840adc48ece77949dc 100644
--- a/lib/libc/musl/src/linux/clock_adjtime.c
+++ b/lib/libc/musl/src/linux/clock_adjtime.c
@@ -94,21 +94,56 @@ int clock_adjtime (clockid_t clock_id, struct timex *utx)
return __syscall_ret(-ENOTSUP);
#endif
if (sizeof(time_t) > sizeof(long)) {
- union {
- struct timex utx;
- struct ktimex ktx;
- } u = { *utx };
- u.ktx.time_sec = utx->time.tv_sec;
- u.ktx.time_usec = utx->time.tv_usec;
+ struct ktimex ktx = {
+ .modes = utx->modes,
+ .offset = utx->offset,
+ .freq = utx->freq,
+ .maxerror = utx->maxerror,
+ .esterror = utx->esterror,
+ .status = utx->status,
+ .constant = utx->constant,
+ .precision = utx->precision,
+ .tolerance = utx->tolerance,
+ .time_sec = utx->time.tv_sec,
+ .time_usec = utx->time.tv_usec,
+ .tick = utx->tick,
+ .ppsfreq = utx->ppsfreq,
+ .jitter = utx->jitter,
+ .shift = utx->shift,
+ .stabil = utx->stabil,
+ .jitcnt = utx->jitcnt,
+ .calcnt = utx->calcnt,
+ .errcnt = utx->errcnt,
+ .stbcnt = utx->stbcnt,
+ .tai = utx->tai,
+ };
#ifdef SYS_adjtimex
- if (clock_id==CLOCK_REALTIME) r = __syscall(SYS_adjtimex, &u);
+ if (clock_id==CLOCK_REALTIME) r = __syscall(SYS_adjtimex, &ktx);
else
#endif
- r = __syscall(SYS_clock_adjtime, clock_id, &u);
+ r = __syscall(SYS_clock_adjtime, clock_id, &ktx);
if (r>=0) {
- *utx = u.utx;
- utx->time.tv_sec = u.ktx.time_sec;
- utx->time.tv_usec = u.ktx.time_usec;
+ utx->modes = ktx.modes;
+ utx->offset = ktx.offset;
+ utx->freq = ktx.freq;
+ utx->maxerror = ktx.maxerror;
+ utx->esterror = ktx.esterror;
+ utx->status = ktx.status;
+ utx->constant = ktx.constant;
+ utx->precision = ktx.precision;
+ utx->tolerance = ktx.tolerance;
+ utx->time.tv_sec = ktx.time_sec;
+ utx->time.tv_usec = ktx.time_usec;
+ utx->tick = ktx.tick;
+ utx->ppsfreq = ktx.ppsfreq;
+ utx->jitter = ktx.jitter;
+ utx->shift = ktx.shift;
+ utx->stabil = ktx.stabil;
+ utx->jitcnt = ktx.jitcnt;
+ utx->calcnt = ktx.calcnt;
+ utx->errcnt = ktx.errcnt;
+ utx->stbcnt = ktx.stbcnt;
+ utx->tai = ktx.tai;
}
return __syscall_ret(r);
}
diff --git a/lib/libc/musl/src/linux/wait4.c b/lib/libc/musl/src/linux/wait4.c
index 97f12cc524685182d13121c4fd49c17205e1af2c..83650e34a860cccaf76c0b2aa102235b4114a9ba 100644
--- a/lib/libc/musl/src/linux/wait4.c
+++ b/lib/libc/musl/src/linux/wait4.c
@@ -1,9 +1,39 @@
#define _GNU_SOURCE
#include
#include
+#include
+#include
#include "syscall.h"
-pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)
+pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru)
{
- return syscall(SYS_wait4, pid, status, options, usage);
+ int r;
+#ifdef SYS_wait4_time64
+ if (ru) {
+ long long kru64[18];
+ r = __syscall(SYS_wait4_time64, pid, status, options, kru64);
+ if (!r) {
+ ru->ru_utime = (struct timeval)
+ { .tv_sec = kru64[0], .tv_usec = kru64[1] };
+ ru->ru_stime = (struct timeval)
+ { .tv_sec = kru64[2], .tv_usec = kru64[3] };
+ char *slots = (char *)&ru->ru_maxrss;
+ for (int i=0; i<14; i++)
+ *(long *)(slots + i*sizeof(long)) = kru64[4+i];
+ }
+ if (SYS_wait4_time64 == SYS_wait4 || r != -ENOSYS)
+ return __syscall_ret(r);
+ }
+#endif
+ char *dest = ru ? (char *)&ru->ru_maxrss - 4*sizeof(long) : 0;
+ r = __syscall(SYS_wait4, pid, status, options, dest);
+ if (r>0 && ru && sizeof(time_t) > sizeof(long)) {
+ long kru[4];
+ memcpy(kru, dest, 4*sizeof(long));
+ ru->ru_utime = (struct timeval)
+ { .tv_sec = kru[0], .tv_usec = kru[1] };
+ ru->ru_stime = (struct timeval)
+ { .tv_sec = kru[2], .tv_usec = kru[3] };
+ }
+ return __syscall_ret(r);
}
diff --git a/lib/libc/musl/src/math/i386/acos.s b/lib/libc/musl/src/math/i386/acos.s
index 47f365efb1ea7493c34f7d64b7db33761e4337bd..af423a2fcdbdac84409c4155e49be84ae354cd96 100644
--- a/lib/libc/musl/src/math/i386/acos.s
+++ b/lib/libc/musl/src/math/i386/acos.s
@@ -1,22 +1,10 @@
# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x)
-.global acosf
-.type acosf,@function
-acosf:
- flds 4(%esp)
- jmp 1f
-
-.global acosl
-.type acosl,@function
-acosl:
- fldt 4(%esp)
- jmp 1f
-
.global acos
.type acos,@function
acos:
fldl 4(%esp)
-1: fld %st(0)
+ fld %st(0)
fld1
fsub %st(0),%st(1)
fadd %st(2)
@@ -25,4 +13,6 @@ acos:
fabs # fix sign of zero (matters in downward rounding mode)
fxch %st(1)
fpatan
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/acosf.s b/lib/libc/musl/src/math/i386/acosf.s
index 6c95509f78be5f308b715722095f46aa6692b684..d2cdfdbfefd6f15a0c94540e42d57fa9b9f27077 100644
--- a/lib/libc/musl/src/math/i386/acosf.s
+++ b/lib/libc/musl/src/math/i386/acosf.s
@@ -1 +1,16 @@
-# see acos.s
+.global acosf
+.type acosf,@function
+acosf:
+ flds 4(%esp)
+ fld %st(0)
+ fld1
+ fsub %st(0),%st(1)
+ fadd %st(2)
+ fmulp
+ fsqrt
+ fabs # fix sign of zero (matters in downward rounding mode)
+ fxch %st(1)
+ fpatan
+ fstps 4(%esp)
+ flds 4(%esp)
+ ret
diff --git a/lib/libc/musl/src/math/i386/acosl.s b/lib/libc/musl/src/math/i386/acosl.s
index 6c95509f78be5f308b715722095f46aa6692b684..599c8230cd74099d14045f19a590a4efb1eff39f 100644
--- a/lib/libc/musl/src/math/i386/acosl.s
+++ b/lib/libc/musl/src/math/i386/acosl.s
@@ -1 +1,14 @@
-# see acos.s
+.global acosl
+.type acosl,@function
+acosl:
+ fldt 4(%esp)
+ fld %st(0)
+ fld1
+ fsub %st(0),%st(1)
+ fadd %st(2)
+ fmulp
+ fsqrt
+ fabs # fix sign of zero (matters in downward rounding mode)
+ fxch %st(1)
+ fpatan
+ ret
diff --git a/lib/libc/musl/src/math/i386/asin.s b/lib/libc/musl/src/math/i386/asin.s
index 920d967acfd257e0a6ac1a1d17a867cca7e6d4f7..2bc8356f49ab4125d17a515b564133ab87e9acc5 100644
--- a/lib/libc/musl/src/math/i386/asin.s
+++ b/lib/libc/musl/src/math/i386/asin.s
@@ -1,23 +1,3 @@
-.global asinf
-.type asinf,@function
-asinf:
- flds 4(%esp)
- mov 4(%esp),%eax
- add %eax,%eax
- cmp $0x01000000,%eax
- jae 1f
- # subnormal x, return x with underflow
- fld %st(0)
- fmul %st(1)
- fstps 4(%esp)
- ret
-
-.global asinl
-.type asinl,@function
-asinl:
- fldt 4(%esp)
- jmp 1f
-
.global asin
.type asin,@function
asin:
@@ -25,15 +5,17 @@ asin:
mov 8(%esp),%eax
add %eax,%eax
cmp $0x00200000,%eax
- jae 1f
- # subnormal x, return x with underflow
- fsts 4(%esp)
- ret
-1: fld %st(0)
+ jb 1f
+ fld %st(0)
fld1
fsub %st(0),%st(1)
fadd %st(2)
fmulp
fsqrt
fpatan
+ fstpl 4(%esp)
+ fldl 4(%esp)
+ ret
+ # subnormal x, return x with underflow
+1: fsts 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/asinf.s b/lib/libc/musl/src/math/i386/asinf.s
index e07bf5999cd19a57f6398aba01af76f68c6de52a..059097532ef046a87d7316da32e27d4fe9abaa65 100644
--- a/lib/libc/musl/src/math/i386/asinf.s
+++ b/lib/libc/musl/src/math/i386/asinf.s
@@ -1 +1,23 @@
-# see asin.s
+.global asinf
+.type asinf,@function
+asinf:
+ flds 4(%esp)
+ mov 4(%esp),%eax
+ add %eax,%eax
+ cmp $0x01000000,%eax
+ jb 1f
+ fld %st(0)
+ fld1
+ fsub %st(0),%st(1)
+ fadd %st(2)
+ fmulp
+ fsqrt
+ fpatan
+ fstps 4(%esp)
+ flds 4(%esp)
+ ret
+ # subnormal x, return x with underflow
+1: fld %st(0)
+ fmul %st(1)
+ fstps 4(%esp)
+ ret
diff --git a/lib/libc/musl/src/math/i386/asinl.s b/lib/libc/musl/src/math/i386/asinl.s
index e07bf5999cd19a57f6398aba01af76f68c6de52a..e973fc85fb26d517f6e387c04b1259eed27f68e9 100644
--- a/lib/libc/musl/src/math/i386/asinl.s
+++ b/lib/libc/musl/src/math/i386/asinl.s
@@ -1 +1,12 @@
-# see asin.s
+.global asinl
+.type asinl,@function
+asinl:
+ fldt 4(%esp)
+ fld %st(0)
+ fld1
+ fsub %st(0),%st(1)
+ fadd %st(2)
+ fmulp
+ fsqrt
+ fpatan
+ ret
diff --git a/lib/libc/musl/src/math/i386/atan.s b/lib/libc/musl/src/math/i386/atan.s
index a26feae1ff53583f97ccfbbf56a3382fd7dbad03..2c57f6b309d3d5e54430f17db69171e0ce5bc833 100644
--- a/lib/libc/musl/src/math/i386/atan.s
+++ b/lib/libc/musl/src/math/i386/atan.s
@@ -8,6 +8,8 @@ atan:
jb 1f
fld1
fpatan
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
# subnormal x, return x with underflow
1: fsts 4(%esp)
diff --git a/lib/libc/musl/src/math/i386/atan2.s b/lib/libc/musl/src/math/i386/atan2.s
index 76b95f3176d49904a918e36aad30517ea720cb68..8bc441b1e47ec344454d851f4b01d3f1744ba0c6 100644
--- a/lib/libc/musl/src/math/i386/atan2.s
+++ b/lib/libc/musl/src/math/i386/atan2.s
@@ -4,7 +4,8 @@ atan2:
fldl 4(%esp)
fldl 12(%esp)
fpatan
- fstl 4(%esp)
+ fstpl 4(%esp)
+ fldl 4(%esp)
mov 8(%esp),%eax
add %eax,%eax
cmp $0x00200000,%eax
diff --git a/lib/libc/musl/src/math/i386/atan2f.s b/lib/libc/musl/src/math/i386/atan2f.s
index c9408a9088d076e8a12618b3eeb2d32612d315ff..3908c86df9bac816fb8275bc4243f840ed94714c 100644
--- a/lib/libc/musl/src/math/i386/atan2f.s
+++ b/lib/libc/musl/src/math/i386/atan2f.s
@@ -4,7 +4,8 @@ atan2f:
flds 4(%esp)
flds 8(%esp)
fpatan
- fsts 4(%esp)
+ fstps 4(%esp)
+ flds 4(%esp)
mov 4(%esp),%eax
add %eax,%eax
cmp $0x01000000,%eax
diff --git a/lib/libc/musl/src/math/i386/atanf.s b/lib/libc/musl/src/math/i386/atanf.s
index 893beac5066c9d679747fbc486db3599888216fc..c2cbe2e0267f93272a195725489afcbbc24c8876 100644
--- a/lib/libc/musl/src/math/i386/atanf.s
+++ b/lib/libc/musl/src/math/i386/atanf.s
@@ -8,6 +8,8 @@ atanf:
jb 1f
fld1
fpatan
+ fstps 4(%esp)
+ flds 4(%esp)
ret
# subnormal x, return x with underflow
1: fld %st(0)
diff --git a/lib/libc/musl/src/math/i386/exp.s b/lib/libc/musl/src/math/i386/exp.s
deleted file mode 100644
index df87c49728b2f0496921b09db8b6caeaf55441d0..0000000000000000000000000000000000000000
--- a/lib/libc/musl/src/math/i386/exp.s
+++ /dev/null
@@ -1,146 +0,0 @@
-.global expm1f
-.type expm1f,@function
-expm1f:
- flds 4(%esp)
- mov 4(%esp),%eax
- add %eax,%eax
- cmp $0x01000000,%eax
- jae 1f
- # subnormal x, return x with underflow
- fld %st(0)
- fmul %st(1)
- fstps 4(%esp)
- ret
-
-.global expm1l
-.type expm1l,@function
-expm1l:
- fldt 4(%esp)
- jmp 1f
-
-.global expm1
-.type expm1,@function
-expm1:
- fldl 4(%esp)
- mov 8(%esp),%eax
- add %eax,%eax
- cmp $0x00200000,%eax
- jae 1f
- # subnormal x, return x with underflow
- fsts 4(%esp)
- ret
-1: fldl2e
- fmulp
- mov $0xc2820000,%eax
- push %eax
- flds (%esp)
- pop %eax
- fucomp %st(1)
- fnstsw %ax
- sahf
- fld1
- jb 1f
- # x*log2e < -65, return -1 without underflow
- fstp %st(1)
- fchs
- ret
-1: fld %st(1)
- fabs
- fucom %st(1)
- fnstsw %ax
- fstp %st(0)
- fstp %st(0)
- sahf
- ja 1f
- f2xm1
- ret
-1: call 1f
- fld1
- fsubrp
- ret
-
-.global exp2f
-.type exp2f,@function
-exp2f:
- flds 4(%esp)
- jmp 1f
-
-.global exp2l
-.global __exp2l
-.hidden __exp2l
-.type exp2l,@function
-exp2l:
-__exp2l:
- fldt 4(%esp)
- jmp 1f
-
-.global expf
-.type expf,@function
-expf:
- flds 4(%esp)
- jmp 2f
-
-.global exp
-.type exp,@function
-exp:
- fldl 4(%esp)
-2: fldl2e
- fmulp
- jmp 1f
-
-.global exp2
-.type exp2,@function
-exp2:
- fldl 4(%esp)
-1: sub $12,%esp
- fld %st(0)
- fstpt (%esp)
- mov 8(%esp),%ax
- and $0x7fff,%ax
- cmp $0x3fff+13,%ax
- jb 4f # |x| < 8192
- cmp $0x3fff+15,%ax
- jae 3f # |x| >= 32768
- fsts (%esp)
- cmpl $0xc67ff800,(%esp)
- jb 2f # x > -16382
- movl $0x5f000000,(%esp)
- flds (%esp) # 0x1p63
- fld %st(1)
- fsub %st(1)
- faddp
- fucomp %st(1)
- fnstsw
- sahf
- je 2f # x - 0x1p63 + 0x1p63 == x
- movl $1,(%esp)
- flds (%esp) # 0x1p-149
- fdiv %st(1)
- fstps (%esp) # raise underflow
-2: fld1
- fld %st(1)
- frndint
- fxch %st(2)
- fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
- f2xm1
- faddp # 2^(x-rint(x))
-1: fscale
- fstp %st(1)
- add $12,%esp
- ret
-3: xor %eax,%eax
-4: cmp $0x3fff-64,%ax
- fld1
- jb 1b # |x| < 0x1p-64
- fstpt (%esp)
- fistl 8(%esp)
- fildl 8(%esp)
- fsubrp %st(1)
- addl $0x3fff,8(%esp)
- f2xm1
- fld1
- faddp # 2^(x-rint(x))
- fldt (%esp) # 2^rint(x)
- fmulp
- add $12,%esp
- ret
diff --git a/lib/libc/musl/src/math/i386/exp2.s b/lib/libc/musl/src/math/i386/exp2.s
deleted file mode 100644
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..0000000000000000000000000000000000000000
--- a/lib/libc/musl/src/math/i386/exp2.s
+++ /dev/null
@@ -1 +0,0 @@
-# see exp.s
diff --git a/lib/libc/musl/src/math/i386/exp2f.s b/lib/libc/musl/src/math/i386/exp2f.s
deleted file mode 100644
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..0000000000000000000000000000000000000000
--- a/lib/libc/musl/src/math/i386/exp2f.s
+++ /dev/null
@@ -1 +0,0 @@
-# see exp.s
diff --git a/lib/libc/musl/src/math/i386/exp2l.s b/lib/libc/musl/src/math/i386/exp2l.s
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..8125761d1058a5c125856c3ebaa6005e9e3e3946 100644
--- a/lib/libc/musl/src/math/i386/exp2l.s
+++ b/lib/libc/musl/src/math/i386/exp2l.s
@@ -1 +1 @@
-# see exp.s
+# see exp_ld.s
diff --git a/lib/libc/musl/src/math/i386/exp_ld.s b/lib/libc/musl/src/math/i386/exp_ld.s
new file mode 100644
index 0000000000000000000000000000000000000000..99cba01fa172ffb7425142b2c3c773ae328c17fc
--- /dev/null
+++ b/lib/libc/musl/src/math/i386/exp_ld.s
@@ -0,0 +1,93 @@
+.global expm1l
+.type expm1l,@function
+expm1l:
+ fldt 4(%esp)
+ fldl2e
+ fmulp
+ mov $0xc2820000,%eax
+ push %eax
+ flds (%esp)
+ pop %eax
+ fucomp %st(1)
+ fnstsw %ax
+ sahf
+ fld1
+ jb 1f
+ # x*log2e < -65, return -1 without underflow
+ fstp %st(1)
+ fchs
+ ret
+1: fld %st(1)
+ fabs
+ fucom %st(1)
+ fnstsw %ax
+ fstp %st(0)
+ fstp %st(0)
+ sahf
+ ja 1f
+ f2xm1
+ ret
+1: call 1f
+ fld1
+ fsubrp
+ ret
+
+.global exp2l
+.global __exp2l
+.hidden __exp2l
+.type exp2l,@function
+exp2l:
+__exp2l:
+ fldt 4(%esp)
+1: sub $12,%esp
+ fld %st(0)
+ fstpt (%esp)
+ mov 8(%esp),%ax
+ and $0x7fff,%ax
+ cmp $0x3fff+13,%ax
+ jb 4f # |x| < 8192
+ cmp $0x3fff+15,%ax
+ jae 3f # |x| >= 32768
+ fsts (%esp)
+ cmpl $0xc67ff800,(%esp)
+ jb 2f # x > -16382
+ movl $0x5f000000,(%esp)
+ flds (%esp) # 0x1p63
+ fld %st(1)
+ fsub %st(1)
+ faddp
+ fucomp %st(1)
+ fnstsw
+ sahf
+ je 2f # x - 0x1p63 + 0x1p63 == x
+ movl $1,(%esp)
+ flds (%esp) # 0x1p-149
+ fdiv %st(1)
+ fstps (%esp) # raise underflow
+2: fld1
+ fld %st(1)
+ frndint
+ fxch %st(2)
+ fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
+ f2xm1
+ faddp # 2^(x-rint(x))
+1: fscale
+ fstp %st(1)
+ add $12,%esp
+ ret
+3: xor %eax,%eax
+4: cmp $0x3fff-64,%ax
+ fld1
+ jb 1b # |x| < 0x1p-64
+ fstpt (%esp)
+ fistl 8(%esp)
+ fildl 8(%esp)
+ fsubrp %st(1)
+ addl $0x3fff,8(%esp)
+ f2xm1
+ fld1
+ faddp # 2^(x-rint(x))
+ fldt (%esp) # 2^rint(x)
+ fmulp
+ add $12,%esp
+ ret
diff --git a/lib/libc/musl/src/math/i386/expf.s b/lib/libc/musl/src/math/i386/expf.s
deleted file mode 100644
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..0000000000000000000000000000000000000000
--- a/lib/libc/musl/src/math/i386/expf.s
+++ /dev/null
@@ -1 +0,0 @@
-# see exp.s
diff --git a/lib/libc/musl/src/math/i386/expm1.s b/lib/libc/musl/src/math/i386/expm1.s
deleted file mode 100644
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..0000000000000000000000000000000000000000
--- a/lib/libc/musl/src/math/i386/expm1.s
+++ /dev/null
@@ -1 +0,0 @@
-# see exp.s
diff --git a/lib/libc/musl/src/math/i386/expm1f.s b/lib/libc/musl/src/math/i386/expm1f.s
deleted file mode 100644
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..0000000000000000000000000000000000000000
--- a/lib/libc/musl/src/math/i386/expm1f.s
+++ /dev/null
@@ -1 +0,0 @@
-# see exp.s
diff --git a/lib/libc/musl/src/math/i386/expm1l.s b/lib/libc/musl/src/math/i386/expm1l.s
index f335a3e5277ed7fe0c0eb8a2d5302dfd13c1e749..8125761d1058a5c125856c3ebaa6005e9e3e3946 100644
--- a/lib/libc/musl/src/math/i386/expm1l.s
+++ b/lib/libc/musl/src/math/i386/expm1l.s
@@ -1 +1 @@
-# see exp.s
+# see exp_ld.s
diff --git a/lib/libc/musl/src/math/i386/log.s b/lib/libc/musl/src/math/i386/log.s
index fcccf0309cb475f55290211edd2249571431afac..08c59924b4afeb3713f59064645ca3daab7c8e6c 100644
--- a/lib/libc/musl/src/math/i386/log.s
+++ b/lib/libc/musl/src/math/i386/log.s
@@ -4,4 +4,6 @@ log:
fldln2
fldl 4(%esp)
fyl2x
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/log10.s b/lib/libc/musl/src/math/i386/log10.s
index 28eb5b2f913a03a3180d2bc1ef18e26e3c425a9d..120e91ece873690dd1a931dfd0d16d62551c1bc0 100644
--- a/lib/libc/musl/src/math/i386/log10.s
+++ b/lib/libc/musl/src/math/i386/log10.s
@@ -4,4 +4,6 @@ log10:
fldlg2
fldl 4(%esp)
fyl2x
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/log10f.s b/lib/libc/musl/src/math/i386/log10f.s
index c0c0c67ef1f12b32f502e36c2c02458f0129f2c3..b055493ad4325913808f513275218d449cc651c4 100644
--- a/lib/libc/musl/src/math/i386/log10f.s
+++ b/lib/libc/musl/src/math/i386/log10f.s
@@ -4,4 +4,6 @@ log10f:
fldlg2
flds 4(%esp)
fyl2x
+ fstps 4(%esp)
+ flds 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/log1p.s b/lib/libc/musl/src/math/i386/log1p.s
index 354f391a7e3707dad653269030da52082e5c4f0a..f3c95f83ade8cc81a783056e38e38b710a5dcdfe 100644
--- a/lib/libc/musl/src/math/i386/log1p.s
+++ b/lib/libc/musl/src/math/i386/log1p.s
@@ -10,10 +10,14 @@ log1p:
cmp $0x00100000,%eax
jb 2f
fyl2xp1
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
1: fld1
faddp
fyl2x
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
# subnormal x, return x with underflow
2: fsts 4(%esp)
diff --git a/lib/libc/musl/src/math/i386/log1pf.s b/lib/libc/musl/src/math/i386/log1pf.s
index 4d3484cd3747ad300c8732632e181d8cac716018..9f13d95ffb57ff8418d291b9951e1771f166ba5c 100644
--- a/lib/libc/musl/src/math/i386/log1pf.s
+++ b/lib/libc/musl/src/math/i386/log1pf.s
@@ -10,10 +10,14 @@ log1pf:
cmp $0x00800000,%eax
jb 2f
fyl2xp1
+ fstps 4(%esp)
+ flds 4(%esp)
ret
1: fld1
faddp
fyl2x
+ fstps 4(%esp)
+ flds 4(%esp)
ret
# subnormal x, return x with underflow
2: fxch
diff --git a/lib/libc/musl/src/math/i386/log2.s b/lib/libc/musl/src/math/i386/log2.s
index 15088037747fb3cdfbd363e166d44b3686ff73f6..7eff0b616c28d492e0d87cd85fe3ca53ae953a58 100644
--- a/lib/libc/musl/src/math/i386/log2.s
+++ b/lib/libc/musl/src/math/i386/log2.s
@@ -4,4 +4,6 @@ log2:
fld1
fldl 4(%esp)
fyl2x
+ fstpl 4(%esp)
+ fldl 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/log2f.s b/lib/libc/musl/src/math/i386/log2f.s
index 00cdce75a0fc5997cfd883c33da578e6016235f2..b32fa2f76ae1d6e33a83a846880f1604713bd691 100644
--- a/lib/libc/musl/src/math/i386/log2f.s
+++ b/lib/libc/musl/src/math/i386/log2f.s
@@ -4,4 +4,6 @@ log2f:
fld1
flds 4(%esp)
fyl2x
+ fstps 4(%esp)
+ flds 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/i386/logf.s b/lib/libc/musl/src/math/i386/logf.s
index da7ff3ae111d192894ea54e39e247ef549a86e8c..4d0346a4458626cf794f028551817a867187f70a 100644
--- a/lib/libc/musl/src/math/i386/logf.s
+++ b/lib/libc/musl/src/math/i386/logf.s
@@ -4,4 +4,6 @@ logf:
fldln2
flds 4(%esp)
fyl2x
+ fstps 4(%esp)
+ flds 4(%esp)
ret
diff --git a/lib/libc/musl/src/math/mips/fabs.c b/lib/libc/musl/src/math/mips/fabs.c
new file mode 100644
index 0000000000000000000000000000000000000000..0a5aa3b1d4ccb2a3405102ff2d85b479cd4a5010
--- /dev/null
+++ b/lib/libc/musl/src/math/mips/fabs.c
@@ -0,0 +1,16 @@
+#if !defined(__mips_soft_float) && defined(__mips_abs2008)
+
+#include
+
+double fabs(double x)
+{
+ double r;
+ __asm__("abs.d %0,%1" : "=f"(r) : "f"(x));
+ return r;
+}
+
+#else
+
+#include "../fabs.c"
+
+#endif
diff --git a/lib/libc/musl/src/math/mips/fabsf.c b/lib/libc/musl/src/math/mips/fabsf.c
new file mode 100644
index 0000000000000000000000000000000000000000..35307be6abae62c3d39a4d9e6ac564bb12e0d071
--- /dev/null
+++ b/lib/libc/musl/src/math/mips/fabsf.c
@@ -0,0 +1,16 @@
+#if !defined(__mips_soft_float) && defined(__mips_abs2008)
+
+#include
+
+float fabsf(float x)
+{
+ float r;
+ __asm__("abs.s %0,%1" : "=f"(r) : "f"(x));
+ return r;
+}
+
+#else
+
+#include "../fabsf.c"
+
+#endif
diff --git a/lib/libc/musl/src/math/mips/sqrt.c b/lib/libc/musl/src/math/mips/sqrt.c
new file mode 100644
index 0000000000000000000000000000000000000000..595c9dbc36232db1469359f36654e37dba2b534d
--- /dev/null
+++ b/lib/libc/musl/src/math/mips/sqrt.c
@@ -0,0 +1,16 @@
+#if !defined(__mips_soft_float) && __mips >= 3
+
+#include