", .{ 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 a39f73cf96..83e96d5c95 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 0ee3cb4646..fd60fe3a0f 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 3ab24cc932..0000000000
--- 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 b4e9fb6a1c..0000000000
--- 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 53f296e037..72392b874f 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 d1ad5774d5..a99e771958 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 e4d86deb11..0000000000
--- 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 0000000000..d055f3e837
--- /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 ba9c3aa003..0000000000
--- 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 e5c8ba7520..037fd956d4 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 9097f9ffdb..eaa885a8b5 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 aa5587127a..1ecb03ca0e 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 78e91b4028..3bf02b3756 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 778430b874..5429a867e3 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 0830b10c2c..4588ff2e39 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 53dd20479d..28390cee6b 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 bd411459eb..10db66745e 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 0000000000..16f37f6982
--- /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 b1a7affbbb..0000000000
--- 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 3af94ce07a..1f814548d3 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 1be0deba7a..e69de29bb2 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 34aba4d2a2..e69de29bb2 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 2be943aa18..665c411a6f 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 871f385859..c38b56c470 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 35198b06a5..12b8d30384 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)
-#define letoh64(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 f649c1773b..6b8e6aa25a 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 38ad59e601..78db5b776b 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 917b80c2e3..1b0a1b16e3 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 6419a5a0a7..44a2d8b0f3 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 37d81698eb..8be01cd4ef 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 95baf6bdb1..4a8a746f8e 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 cb1292a647..dfb237795f 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 949f701493..f0bdb19232 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 be58c64174..45078b866d 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 6bfa3a5ace..e812c675c2 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 7963785f67..6225d25d53 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 52f956ad23..8f26fb75f7 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 37ee858c48..99d473c50e 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 02e4c7887c..b4161dec6b 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 7d3a88079a..28c9b6e24f 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 85c605b75f..9bfd0a1075 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 4cc6567f93..c5f79d86d2 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 6c255d3a8b..03db62abfa 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 a37ef97bcf..1f0c6890fe 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 90def956e6..8ef18ec050 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 1a54ab5880..8ebe0c8b08 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 95e5d9433c..41362fab28 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 2c82ee12b2..957d3da9f0 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 521b873afa..e8a3753445 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 b2fb003b32..0da838f1ef 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 cb3022c778..301c098ab4 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 acbde569f2..6da1226b16 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 3bea27f45a..ff158861cf 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 fc42fc653b..cab33a954c 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 2324873319..602a4af79a 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 352fdcadf1..0ad11ab54f 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 51ef3bad7b..cecff6647c 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 755c6ad7aa..5a9f61eb4d 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 89c2bc8013..1ad5c49c5d 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 769101a2fe..29fa60d2f1 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 b4a1272fe6..c330f5dd05 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 0000000000..d055f3e837
--- /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 208e36bcd7..fc11433d98 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 e5c8ba7520..037fd956d4 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 e63d0732bb..f4936d6f5a 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 aa5587127a..1ecb03ca0e 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 78e91b4028..3bf02b3756 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 482f1d1d19..c9bfc7f95e 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 d0f00474bd..c714577aaa 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 e888a1939f..0000000000
--- 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 0cc1faa9f7..bcdd936f16 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 ce20d2e760..c4fbd0d8df 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 0000000000..d055f3e837
--- /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 ba9c3aa003..0000000000
--- 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 f310867d19..9e428cabd5 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 0000000000..87b05d488d
--- /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 0000000000..4e5357d24f
--- /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 8a7d5852ed..f9a6ea657a 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 dd4c03b7f6..751f71fc47 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 5e9d7ce475..f247f6983d 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 67bd95fa5c..3f2666e56f 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 2078964487..9745553d16 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 e888a1939f..0000000000
--- 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 ac11a8d7bf..0000000000
--- 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 87d555b12d..4207084528 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 e14881035b..b3d86fe1d8 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 f94f3e2f44..f655b43e3d 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 ca2af1ed57..0000000000
--- 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 98eff9a7d5..bce4b19320 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 0000000000..d055f3e837
--- /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 ba9c3aa003..0000000000
--- 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 1bbca229c7..9232e03800 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 fefd211aa9..715a0ac85c 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 ef46d7f101..e45c2ab19a 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 12e0001316..48051afb63 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 ba5e2b50d2..4225b91779 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 e5298772da..fa6d8dfdb8 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 888868ad5c..ce2818352c 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 b650fe8f9a..6177874ffa 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 4f3a41f0c1..0000000000
--- 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 c312b0d459..de82cf9ec7 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 d453d65ce4..1fa551d93e 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 38b8263144..4592aac64d 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 c326d32774..8db53c8293 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 b449472ae9..0000000000
--- 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 5eddfd18bc..87ae2ee7d1 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 dfedbe836f..0000000000
--- 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 423de02ab1..808207fb4b 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 e831219e08..55dbfa500c 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 19063e7423..0000000000
--- 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 e984295854..fc11433d98 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 decce20733..0000000000
--- 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 e2436d95c8..790f513736 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 ec6a904f58..7418a48234 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 e984295854..fc11433d98 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 0372d7dd0e..0000000000
--- 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 fed8f0384e..e4dbe4b061 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 67802d1190..e647237146 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 d56abdac96..c547ca0b72 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 7a74d2febc..0000000000
--- 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 0226588c3d..0000000000
--- 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 c11677e9d0..0000000000
--- 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 955e2cabad..93648afdfe 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 40cf0b2891..b1b68c7255 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 667963c7e1..d62bd7bde6 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 5953724a0b..0000000000
--- 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 0018ad1e20..4f4fcb0c5b 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 fbc6d238dc..0000000000
--- 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 bc8436c4ad..7bbbb2bf43 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 d383d4ea55..544e3d2a52 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 81b2a29abb..725fb46968 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 22b19bbfec..5d7828cf79 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 a565a4ee1f..11d677635b 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 2c2e7f58f9..d091d2ad92 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 53fb155c0d..4b08762d7b 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 0000000000..c845fe82dd
--- /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 d1a6c035f8..60ae8b850b 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 0000000000..e69de29bb2
diff --git a/lib/libc/musl/arch/generic/bits/socket.h b/lib/libc/musl/arch/generic/bits/socket.h
index 1f73b995c6..e69de29bb2 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 1a8432d3e7..6feb03a6c3 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 172c338f50..0000000000
--- 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 0018ad1e20..4f4fcb0c5b 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 c340ceb220..07743b6fd6 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 bc8436c4ad..7bbbb2bf43 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 e61571c121..65661542a5 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 81b2a29abb..725fb46968 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 22b19bbfec..5d7828cf79 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 c95e108e55..1ae4e48a8f 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 22b0b28b83..69642e578a 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 66ca18ad61..ff934a4c42 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 5399dcb544..0000000000
--- 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 13e86fe702..7986deb7f6 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 e277c3f05c..e20bf19eaa 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 0018ad1e20..4f4fcb0c5b 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 fbc6d238dc..0000000000
--- 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 f28aece8fa..c734dbb570 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 5184eb5977..fe6f094858 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 8d19378191..ab8c642d82 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 1a84de5904..e1d97ac781 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 b82c7d341f..02fbb88b4d 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 3291a63620..48d4ac8044 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 582fa3b51c..86251bf31b 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 b3d59a45ca..88d236390e 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 6ea73437b5..f821e73fcc 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 2b2e34a831..fcd61ee853 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 5399dcb544..0000000000
--- 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 58698c62dc..0000000000
--- 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 5aff0d91c2..519b9c8ead 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 34b9752e6a..9b406e9a4d 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 bbd9bd9d2d..fdb5edc9ca 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 8e687ef16d..b48df6a625 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 4442abf4eb..0000000000
--- 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 b6cbb18f47..ac9bfd204a 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 0018ad1e20..4f4fcb0c5b 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 fbc6d238dc..0000000000
--- 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 171c11a34f..9fb15dccb2 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 bc2d6d1f51..28be484528 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 b19801d51a..fb1d4020f6 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 06efb11cf2..c1bf3caf34 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 a94b8bdb8c..b19ed42bfa 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 dcb896fd5f..585d98e908 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 adcf63dbbc..8d4f79b524 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 5b205851f1..143ffa8d25 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 2016cb2074..0000000000
--- 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 0226588c3d..0000000000
--- 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 2cc0604c5e..d5493b1856 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 0f3c9aac90..557e324fde 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 32545b3940..b935864c41 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 5bdaeede54..2f1bba059f 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 41ad4d0490..0c38258868 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 ae9ba41daf..4579d1740b 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 172c338f50..0000000000
--- 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 0226588c3d..0000000000
--- 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 c800788c3f..2633f39d77 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 2ff4be302c..b006334f78 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 aae537d343..0000000000
--- 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 1db70cfbf5..0043eeba3c 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 1a83846209..15d18c8f4a 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 ef074b776e..0000000000
--- 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 86ef7663fd..07743b6fd6 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 bd4b20c429..0000000000
--- 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 c4c70474ef..e89f378299 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 a238dc654c..6e5c1fb876 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 dc551d4720..5cd8a2997f 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 172c338f50..0000000000
--- 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 86ef7663fd..07743b6fd6 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 a4c89f3d7a..0000000000
--- 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 2d4634f683..6a646ad346 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 0000000000..acfbd3cc52
--- /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 0000000000..b0042c6317
--- /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 0000000000..9c6f190abe
--- /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 0000000000..ed5119bd7d
--- /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 0000000000..5a25b8ac02
--- /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 0000000000..47a24c1350
--- /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 0000000000..0cac7bbdf6
--- /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 0000000000..91ef067d02
--- /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 0000000000..7ca4f0e9c7
--- /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 0000000000..314251d1c1
--- /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 0000000000..a057274e15
--- /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 0000000000..e1ad2e283a
--- /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 0000000000..5950943a00
--- /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 0000000000..3e08439887
--- /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 0000000000..85dcb008ed
--- /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 0000000000..166a6daeb6
--- /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 0000000000..7856f176e6
--- /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 0000000000..f29533f12f
--- /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 0000000000..5a1295bde9
--- /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 0000000000..4bac4bf526
--- /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 0000000000..d7487dee6e
--- /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 0000000000..1f3ce68e3e
--- /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 0000000000..963f0e0525
--- /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 0000000000..7d72bfb320
--- /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 0000000000..96bc303490
--- /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 0000000000..633ec8293f
--- /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 0000000000..c1257a1449
--- /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 0000000000..7f75cd4a18
--- /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 0000000000..e6f15d513a
--- /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 0000000000..211cea4ba4
--- /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 0000000000..93b697a7e1
--- /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 0000000000..a01f09b89d
--- /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 0000000000..ea6bdd81b1
--- /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 0000000000..43b4b0df6f
--- /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 0000000000..ecaa8f868d
--- /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 0000000000..fba1f2a914
--- /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 0000000000..2d29602cb7
--- /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 0000000000..33df27a4ad
--- /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 0000000000..99f24f734d
--- /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 0000000000..3ec2995115
--- /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 0000000000..acf1cfb8c0
--- /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 0000000000..36cbbaca02
--- /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 0000000000..2d8df9acaf
--- /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 0000000000..c3469f9bc3
--- /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 0000000000..34ec528199
--- /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 0000000000..2475fd8c11
--- /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 0000000000..09e625cba3
--- /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 0000000000..6b3aa39c72
--- /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 0000000000..8c6121dadd
--- /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 0000000000..cc76364d3b
--- /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 0000000000..59088001b2
--- /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 0000000000..4b8fac1c29
--- /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 0000000000..fdec17c345
--- /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 0000000000..60d68fbf84
--- /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 0000000000..b4184cc283
--- /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 0000000000..a447e7d41a
--- /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 0000000000..75e5435f18
--- /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 0000000000..67830d3418
--- /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 0000000000..e9ca94cb42
--- /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 0000000000..65f11d4634
--- /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 0000000000..c687b8d1b4
--- /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 0000000000..59248f623b
--- /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 0000000000..8fe128edbf
--- /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 0000000000..918548e74f
--- /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 19bc28a9b1..453c41b748 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 d2e6f1c681..b8d183d144 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 4cc879b1d7..d9ff462e1e 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 b315e0f357..581925a433 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 e0a8fe6a2f..650ecf646a 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 78fb0733b2..13ab71dd07 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 1bd444518a..172c43203a 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 f4d651efcd..85cfb72a0d 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 02c2139d27..53a27b9de4 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 f5cbe79656..0c807ea0cb 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 cf951d9133..01269e7d4a 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 8af47dbef5..a08485e7f7 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 d7fa8d5e4e..0ae132a585 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 a4347a53fd..50c626a69c 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 c7a86480d3..44a007aaf5 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 daccc760bb..472e4b8470 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 e238321b9c..984db68064 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 7e470d3a13..822f464efd 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 277c47d6f7..3690f49609 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 5c48cb838f..fbdf667b2f 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 9b0ba36fbe..fae9d0508f 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 372e3ddc1c..c2ce3b4840 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 d0761b1832..3bade72720 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 07f0d73dc7..d9c846e9c2 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 e23bf1ad6b..38e58c168b 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 229e1f3d99..5d62a9859a 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 70d793d563..3068328d09 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 d34cbf10d9..b3bab1d57b 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 410c877446..a747784ede 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 8692efa7ad..38f5bb17b3 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 9d096624bc..10d446c463 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 ef07d6846a..793490b6dc 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 c5cab814c0..cdc67ef650 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 108c1f5ccb..628239b7ed 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 2794d36a6c..1b832cdd8f 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 2e688880a8..8b417e1be2 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 d251b715c6..edb55bc4d6 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 50c5c709a6..d4b1f2e185 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 8122b3b1df..52ec3100eb 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 672b3fc3ee..5494df1836 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 dd5ff927c2..5755bd53ee 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 0429014d85..b293f427e6 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 9b24b6af24..34b66f8787 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 8e42f1ae86..76127f75f4 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 d7e6b54547..8bd80581ae 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 d3eaee204f..3a284be9c6 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 e10d9c0934..ef3907a506 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 a9fc02db03..e62526c006 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 299277c71c..4167f3876c 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 0000000000..6ee1209b96
--- /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 48231e73fb..5d05a3d1a0 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,16,16,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 7a6239405a..67929470c9 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,16,16,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 8f6810184e..76d137696e 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 49c40eea8c..36256a5385 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 e4672b23ce..e403c9a5a2 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 f149003d2e..0ea78bf9ac 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 ffd06b0471..764e3a1a8f 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 278bf25025..8c0828fcb3 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 9f2784dbaf..975a0031d4 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 56294c973c..fc7215c7b3 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 8ac0a33491..0384f97e96 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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 0000000000..bb2e70408f
--- /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 2f531397c3..23eb8729db 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 97f12cc524..83650e34a8 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 47f365efb1..af423a2fcd 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 6c95509f78..d2cdfdbfef 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 6c95509f78..599c8230cd 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 920d967acf..2bc8356f49 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 e07bf5999c..059097532e 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 e07bf5999c..e973fc85fb 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 a26feae1ff..2c57f6b309 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 76b95f3176..8bc441b1e4 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 c9408a9088..3908c86df9 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 893beac506..c2cbe2e026 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/exp2.s b/lib/libc/musl/src/math/i386/exp2.s
deleted file mode 100644
index f335a3e527..0000000000
--- 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 f335a3e527..0000000000
--- 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 f335a3e527..8125761d10 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.s b/lib/libc/musl/src/math/i386/exp_ld.s
similarity index 67%
rename from lib/libc/musl/src/math/i386/exp.s
rename to lib/libc/musl/src/math/i386/exp_ld.s
index df87c49728..99cba01fa1 100644
--- a/lib/libc/musl/src/math/i386/exp.s
+++ b/lib/libc/musl/src/math/i386/exp_ld.s
@@ -1,35 +1,8 @@
-.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
+ fldl2e
fmulp
mov $0xc2820000,%eax
push %eax
@@ -59,12 +32,6 @@ expm1:
fsubrp
ret
-.global exp2f
-.type exp2f,@function
-exp2f:
- flds 4(%esp)
- jmp 1f
-
.global exp2l
.global __exp2l
.hidden __exp2l
@@ -72,26 +39,6 @@ exp2f:
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)
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 f335a3e527..0000000000
--- 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 f335a3e527..0000000000
--- 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 f335a3e527..0000000000
--- 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 f335a3e527..8125761d10 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 fcccf0309c..08c59924b4 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 28eb5b2f91..120e91ece8 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 c0c0c67ef1..b055493ad4 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 354f391a7e..f3c95f83ad 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 4d3484cd37..9f13d95ffb 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 1508803774..7eff0b616c 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 00cdce75a0..b32fa2f76a 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 da7ff3ae11..4d0346a445 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 0000000000..0a5aa3b1d4
--- /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 0000000000..35307be6ab
--- /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 0000000000..595c9dbc36
--- /dev/null
+++ b/lib/libc/musl/src/math/mips/sqrt.c
@@ -0,0 +1,16 @@
+#if !defined(__mips_soft_float) && __mips >= 3
+
+#include