@zigc/lib 0.17.0-dev.44 → 0.17.0-dev.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/c/inttypes.zig +0 -10
- package/c/math.zig +27 -116
- package/c/search.zig +1 -27
- package/c/stdlib/drand48.zig +0 -57
- package/c/stdlib.zig +0 -100
- package/c/string.zig +0 -7
- package/c/strings.zig +0 -38
- package/c/unistd.zig +27 -26
- package/c.zig +1 -2
- package/compiler_rt/cos.zig +0 -2
- package/compiler_rt/exp.zig +0 -2
- package/compiler_rt/exp2.zig +0 -2
- package/compiler_rt/fabs.zig +0 -2
- package/compiler_rt/fma.zig +0 -2
- package/compiler_rt/fmax.zig +0 -2
- package/compiler_rt/fmin.zig +0 -2
- package/compiler_rt/fmod.zig +0 -2
- package/compiler_rt/limb64.zig +32 -0
- package/compiler_rt/log.zig +0 -2
- package/compiler_rt/log10.zig +0 -2
- package/compiler_rt/log2.zig +0 -2
- package/compiler_rt/round.zig +0 -2
- package/compiler_rt/sin.zig +0 -2
- package/compiler_rt/sincos.zig +0 -2
- package/compiler_rt/sqrt.zig +0 -2
- package/compiler_rt/tan.zig +0 -2
- package/compiler_rt/trunc.zig +0 -2
- package/package.json +1 -1
- package/std/Io/Dispatch.zig +3 -13
- package/std/Io/Semaphore.zig +112 -17
- package/std/Io/Threaded.zig +158 -24
- package/std/Io/Uring.zig +11 -13
- package/std/Io/net.zig +11 -11
- package/std/Io.zig +89 -25
- package/std/Target.zig +0 -2
- package/std/c/haiku.zig +3 -0
- package/std/c/serenity.zig +1 -6
- package/std/c.zig +59 -6
- package/std/debug.zig +1 -1
- package/std/os.zig +41 -0
- package/std/zig/LibCInstallation.zig +1 -0
- package/libc/musl/src/unistd/dup2.c +0 -20
- package/libc/musl/src/unistd/dup3.c +0 -26
package/std/c.zig
CHANGED
|
@@ -3260,8 +3260,8 @@ pub const Sigaction = switch (native_os) {
|
|
|
3260
3260
|
|
|
3261
3261
|
/// signal handler
|
|
3262
3262
|
handler: extern union {
|
|
3263
|
-
handler: handler_fn,
|
|
3264
|
-
sigaction: sigaction_fn,
|
|
3263
|
+
handler: ?handler_fn,
|
|
3264
|
+
sigaction: ?sigaction_fn,
|
|
3265
3265
|
},
|
|
3266
3266
|
|
|
3267
3267
|
/// signal mask to apply
|
|
@@ -11102,6 +11102,61 @@ pub const ioctl = switch (native_os) {
|
|
|
11102
11102
|
else => private.ioctl,
|
|
11103
11103
|
};
|
|
11104
11104
|
|
|
11105
|
+
pub extern "c" fn bzero(s: *anyopaque, n: usize) void;
|
|
11106
|
+
|
|
11107
|
+
pub extern "c" fn swab(noalias from: *const anyopaque, noalias to: *anyopaque, n: isize) void;
|
|
11108
|
+
|
|
11109
|
+
pub extern "c" fn strncmp(a: [*:0]const c_char, b: [*:0]const c_char, max: usize) c_int;
|
|
11110
|
+
pub extern "c" fn strcasecmp(a: [*:0]const c_char, b: [*:0]const c_char) c_int;
|
|
11111
|
+
pub extern "c" fn strncasecmp(a: [*:0]const c_char, b: [*:0]const c_char, max: usize) c_int;
|
|
11112
|
+
|
|
11113
|
+
pub extern "c" fn ffs(i: c_int) c_int;
|
|
11114
|
+
pub extern "c" fn ffsl(i: c_long) c_long;
|
|
11115
|
+
pub extern "c" fn ffsll(i: c_longlong) c_longlong;
|
|
11116
|
+
|
|
11117
|
+
pub extern "c" fn erand48(xsubi: *[3]c_ushort) f64;
|
|
11118
|
+
pub extern "c" fn jrand48(xsubi: *[3]c_ushort) c_long;
|
|
11119
|
+
pub extern "c" fn nrand48(xsubi: *[3]c_ushort) c_long;
|
|
11120
|
+
|
|
11121
|
+
pub extern "c" fn insque(element: *anyopaque, pred: ?*anyopaque) void;
|
|
11122
|
+
pub extern "c" fn remque(element: *anyopaque) void;
|
|
11123
|
+
|
|
11124
|
+
pub extern "c" fn imaxabs(a: intmax_t) intmax_t;
|
|
11125
|
+
pub extern "c" fn imaxdiv(a: intmax_t, b: intmax_t) imaxdiv_t;
|
|
11126
|
+
|
|
11127
|
+
pub extern "c" fn abs(a: c_int) c_int;
|
|
11128
|
+
pub extern "c" fn labs(a: c_long) c_long;
|
|
11129
|
+
pub extern "c" fn llabs(a: c_longlong) c_longlong;
|
|
11130
|
+
|
|
11131
|
+
pub extern "c" fn div(a: c_int, b: c_int) div_t;
|
|
11132
|
+
pub extern "c" fn ldiv(a: c_long, b: c_long) ldiv_t;
|
|
11133
|
+
pub extern "c" fn lldiv(a: c_longlong, b: c_longlong) lldiv_t;
|
|
11134
|
+
|
|
11135
|
+
pub extern "c" fn atoi(str: [*:0]const c_char) c_int;
|
|
11136
|
+
pub extern "c" fn atol(str: [*:0]const c_char) c_long;
|
|
11137
|
+
pub extern "c" fn atoll(str: [*:0]const c_char) c_longlong;
|
|
11138
|
+
|
|
11139
|
+
pub extern "c" fn bsearch(
|
|
11140
|
+
key: *const anyopaque,
|
|
11141
|
+
base: *const anyopaque,
|
|
11142
|
+
n: usize,
|
|
11143
|
+
size: usize,
|
|
11144
|
+
compare: *const fn (a: *const anyopaque, b: *const anyopaque) callconv(.c) c_int,
|
|
11145
|
+
) ?*anyopaque;
|
|
11146
|
+
|
|
11147
|
+
// Math
|
|
11148
|
+
pub extern "c" fn atan(x: f64) f64;
|
|
11149
|
+
pub extern "c" fn copysign(x: f64, y: f64) f64;
|
|
11150
|
+
pub extern "c" fn fdim(x: f64, y: f64) f64;
|
|
11151
|
+
pub extern "c" fn frexp(x: f64, e: *c_int) f64;
|
|
11152
|
+
pub extern "c" fn hypot(x: f64, y: f64) f64;
|
|
11153
|
+
pub extern "c" fn modff(x: f32, iptr: *f32) f32;
|
|
11154
|
+
pub extern "c" fn modf(x: f64, iptr: *f64) f64;
|
|
11155
|
+
pub extern "c" fn modfl(x: c_longdouble, iptr: *c_longdouble) c_longdouble;
|
|
11156
|
+
pub extern "c" fn rintf(x: f32) f32;
|
|
11157
|
+
pub extern "c" fn rint(x: f64) f64;
|
|
11158
|
+
pub extern "c" fn rintl(x: c_longdouble) c_longdouble;
|
|
11159
|
+
|
|
11105
11160
|
// OS-specific bits. These are protected from being used on the wrong OS by
|
|
11106
11161
|
// comptime assertions inside each OS-specific file.
|
|
11107
11162
|
|
|
@@ -11142,6 +11197,8 @@ pub const _kern_open_dir = haiku._kern_open_dir;
|
|
|
11142
11197
|
pub const _kern_read_dir = haiku._kern_read_dir;
|
|
11143
11198
|
pub const _kern_read_stat = haiku._kern_read_stat;
|
|
11144
11199
|
pub const _kern_rewind_dir = haiku._kern_rewind_dir;
|
|
11200
|
+
pub const readv_pos = haiku.readv_pos;
|
|
11201
|
+
pub const writev_pos = haiku.writev_pos;
|
|
11145
11202
|
pub const area_id = haiku.area_id;
|
|
11146
11203
|
pub const area_info = haiku.area_info;
|
|
11147
11204
|
pub const directory_which = haiku.directory_which;
|
|
@@ -11449,15 +11506,11 @@ pub const disown = serenity.disown;
|
|
|
11449
11506
|
pub const profiling_enable = serenity.profiling_enable;
|
|
11450
11507
|
pub const profiling_disable = serenity.profiling_disable;
|
|
11451
11508
|
pub const profiling_free_buffer = serenity.profiling_free_buffer;
|
|
11452
|
-
pub const futex_wait = serenity.futex_wait;
|
|
11453
|
-
pub const futex_wake = serenity.futex_wake;
|
|
11454
11509
|
pub const purge = serenity.purge;
|
|
11455
11510
|
pub const perf_event = serenity.perf_event;
|
|
11456
11511
|
pub const perf_register_string = serenity.perf_register_string;
|
|
11457
11512
|
pub const get_stack_bounds = serenity.get_stack_bounds;
|
|
11458
11513
|
pub const anon_create = serenity.anon_create;
|
|
11459
|
-
pub const serenity_readlink = serenity.serenity_readlink;
|
|
11460
|
-
pub const serenity_open = serenity.serenity_open;
|
|
11461
11514
|
pub const getkeymap = serenity.getkeymap;
|
|
11462
11515
|
pub const setkeymap = serenity.setkeymap;
|
|
11463
11516
|
|
package/std/debug.zig
CHANGED
|
@@ -1576,12 +1576,12 @@ fn handleSegfaultPosix(sig: posix.SIG, info: *const posix.siginfo_t, ctx_ptr: ?*
|
|
|
1576
1576
|
.tvos,
|
|
1577
1577
|
.visionos,
|
|
1578
1578
|
.watchos,
|
|
1579
|
+
.haiku,
|
|
1579
1580
|
=> @intFromPtr(info.addr),
|
|
1580
1581
|
.linux,
|
|
1581
1582
|
=> @intFromPtr(info.fields.sigfault.addr),
|
|
1582
1583
|
.netbsd,
|
|
1583
1584
|
=> @intFromPtr(info.info.reason.fault.addr),
|
|
1584
|
-
.haiku,
|
|
1585
1585
|
.openbsd,
|
|
1586
1586
|
=> @intFromPtr(info.data.fault.addr),
|
|
1587
1587
|
.illumos,
|
package/std/os.zig
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const builtin = @import("builtin");
|
|
2
|
+
const std = @import("std.zig");
|
|
2
3
|
const native_os = builtin.os.tag;
|
|
3
4
|
|
|
4
5
|
pub const linux = @import("os/linux.zig");
|
|
@@ -8,6 +9,46 @@ pub const wasi = @import("os/wasi.zig");
|
|
|
8
9
|
pub const emscripten = @import("os/emscripten.zig");
|
|
9
10
|
pub const windows = @import("os/windows.zig");
|
|
10
11
|
|
|
12
|
+
/// Returns whether the Zig standard library requires libc in order to interface
|
|
13
|
+
/// with the operating system on the given target.
|
|
14
|
+
pub fn targetRequiresLibC(target: *const std.Target) bool {
|
|
15
|
+
if (target.requiresLibC()) return true;
|
|
16
|
+
return switch (target.os.tag) {
|
|
17
|
+
.linux => switch (target.cpu.arch) {
|
|
18
|
+
// https://codeberg.org/ziglang/zig/issues/30940
|
|
19
|
+
.alpha,
|
|
20
|
+
// https://codeberg.org/ziglang/zig/issues/30942
|
|
21
|
+
.csky,
|
|
22
|
+
// https://codeberg.org/ziglang/zig/issues/30943
|
|
23
|
+
.hppa,
|
|
24
|
+
.hppa64,
|
|
25
|
+
// https://codeberg.org/ziglang/zig/issues/30944
|
|
26
|
+
.microblaze,
|
|
27
|
+
.microblazeel,
|
|
28
|
+
// https://codeberg.org/ziglang/zig/issues/30946
|
|
29
|
+
.sh,
|
|
30
|
+
.sheb,
|
|
31
|
+
// https://codeberg.org/ziglang/zig/issues/30945
|
|
32
|
+
.sparc,
|
|
33
|
+
// https://codeberg.org/ziglang/zig/issues/30947
|
|
34
|
+
.xtensa,
|
|
35
|
+
.xtensaeb,
|
|
36
|
+
=> true,
|
|
37
|
+
else => false,
|
|
38
|
+
},
|
|
39
|
+
.freebsd => true, // https://codeberg.org/ziglang/zig/issues/30981
|
|
40
|
+
.netbsd => true, // https://codeberg.org/ziglang/zig/issues/30980
|
|
41
|
+
.openbsd => true, // https://codeberg.org/ziglang/zig/issues/30982
|
|
42
|
+
else => false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// Returns whether the Zig standard library requires libc in order to interface
|
|
47
|
+
/// with the operating system on the current target.
|
|
48
|
+
pub fn requiresLibC() bool {
|
|
49
|
+
return targetRequiresLibC(&builtin.target);
|
|
50
|
+
}
|
|
51
|
+
|
|
11
52
|
test {
|
|
12
53
|
_ = linux;
|
|
13
54
|
if (native_os == .uefi) _ = uefi;
|
|
@@ -459,6 +459,7 @@ fn findNativeCrtDirPosix(self: *LibCInstallation, gpa: Allocator, io: Io, args:
|
|
|
459
459
|
|
|
460
460
|
fn findNativeGccDirHaiku(self: *LibCInstallation, gpa: Allocator, io: Io, args: FindNativeOptions) FindError!void {
|
|
461
461
|
self.gcc_dir = try ccPrintFileName(gpa, io, .{
|
|
462
|
+
.environ_map = args.environ_map,
|
|
462
463
|
.search_basename = "crtbeginS.o",
|
|
463
464
|
.want_dirname = .only_dir,
|
|
464
465
|
.verbose = args.verbose,
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#include <unistd.h>
|
|
2
|
-
#include <errno.h>
|
|
3
|
-
#include <fcntl.h>
|
|
4
|
-
#include "syscall.h"
|
|
5
|
-
|
|
6
|
-
int dup2(int old, int new)
|
|
7
|
-
{
|
|
8
|
-
int r;
|
|
9
|
-
#ifdef SYS_dup2
|
|
10
|
-
while ((r=__syscall(SYS_dup2, old, new))==-EBUSY);
|
|
11
|
-
#else
|
|
12
|
-
if (old==new) {
|
|
13
|
-
r = __syscall(SYS_fcntl, old, F_GETFD);
|
|
14
|
-
if (r >= 0) return old;
|
|
15
|
-
} else {
|
|
16
|
-
while ((r=__syscall(SYS_dup3, old, new, 0))==-EBUSY);
|
|
17
|
-
}
|
|
18
|
-
#endif
|
|
19
|
-
return __syscall_ret(r);
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#define _GNU_SOURCE
|
|
2
|
-
#include <unistd.h>
|
|
3
|
-
#include <errno.h>
|
|
4
|
-
#include <fcntl.h>
|
|
5
|
-
#include "syscall.h"
|
|
6
|
-
|
|
7
|
-
int __dup3(int old, int new, int flags)
|
|
8
|
-
{
|
|
9
|
-
int r;
|
|
10
|
-
#ifdef SYS_dup2
|
|
11
|
-
if (old==new) return __syscall_ret(-EINVAL);
|
|
12
|
-
if (flags) {
|
|
13
|
-
while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY);
|
|
14
|
-
if (r!=-ENOSYS) return __syscall_ret(r);
|
|
15
|
-
if (flags & ~O_CLOEXEC) return __syscall_ret(-EINVAL);
|
|
16
|
-
}
|
|
17
|
-
while ((r=__syscall(SYS_dup2, old, new))==-EBUSY);
|
|
18
|
-
if (r >= 0 && (flags & O_CLOEXEC))
|
|
19
|
-
__syscall(SYS_fcntl, new, F_SETFD, FD_CLOEXEC);
|
|
20
|
-
#else
|
|
21
|
-
while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY);
|
|
22
|
-
#endif
|
|
23
|
-
return __syscall_ret(r);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
weak_alias(__dup3, dup3);
|