summaryrefslogtreecommitdiff
path: root/test/e2e_harness.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-11 15:58:58 -0300
committerGabriel Schneider <[email protected]>2026-08-11 16:26:20 -0300
commit4ca28745d774c232cd31a29c17878f19bbe24cf5 (patch)
treeface852acae5bc347e6bab2bb5cede501e0ce1d3 /test/e2e_harness.zig
parentdedfdea43f0d6c7151c541284c81027969d89032 (diff)
parent89d93d5e7348304bc7d8a148f9ad9c1beb200459 (diff)
downloadpardes-4ca28745d774c232cd31a29c17878f19bbe24cf5.tar.gz
pardes-4ca28745d774c232cd31a29c17878f19bbe24cf5.zip
merge the macOS app branch: the AppKit shell, pixel attachments, live theming, and mupdf -Djpx
Three commits off 38e9919 (macos-app@upstream) merged into main's ghostty bump. No textual conflicts, and two things the merge needed: - nested.zig asked libc for fstatat. Darwin has it; on linux std.c declares it `void` (glibc hides it behind a versioned symbol std cannot name), so the tty build stopped at 'type void not a function'. statNoFollow keeps fstatat on darwin and asks statx on linux for the same three fields, which is what this file did before the branch generalized it to both platforms. - .DS_Store rode along with a797a1a. Deleted, and .gitignore now says so. linux: snap 86/86, unit-test, image-harness and mupdf-check green. nested.zig also type-checks for aarch64-macos.
Diffstat (limited to 'test/e2e_harness.zig')
-rw-r--r--test/e2e_harness.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/e2e_harness.zig b/test/e2e_harness.zig
index 2e87d362..4767871f 100644
--- a/test/e2e_harness.zig
+++ b/test/e2e_harness.zig
@@ -183,8 +183,16 @@ pub const Harness = struct {
/// input just sent: without it, an app still asleep in its event loop looks
/// exactly like an app that has finished. See snapshot.zig's waitStable.
pub fn pending(self: *Harness) usize {
+ // Darwin files FIONREAD under the socket ioctls rather than the
+ // termios group std.posix.T exposes, and encodes it differently
+ // besides — _IOR('f', 127, int) against linux's flat constant.
+ // Neither is derivable from the other, so both are named.
+ const FIONREAD: c_int = switch (@import("builtin").os.tag) {
+ .linux => posix.T.FIONREAD,
+ else => 0x4004667f,
+ };
var n: c_int = 0;
- if (posix.system.ioctl(self.master, posix.T.FIONREAD, @intFromPtr(&n)) != 0) return 0;
+ if (posix.system.ioctl(self.master, FIONREAD, @intFromPtr(&n)) != 0) return 0;
return if (n > 0) @intCast(n) else 0;
}