android: Avoid referencing POSIX shared memory functions (#12341)

Stop trying to use POSIX shared memory functions such as `shm_open` on
Android as it's unsupported and the platform libc does not have those
symbols.

This avoids an error such as the below when trying to use
`libghostty-vt` on Android:

> dlopen failed: cannot locate symbol "shm_open" referenced by [..]
This commit is contained in:
Mitchell Hashimoto
2026-04-19 15:21:26 -07:00
committed by GitHub

View File

@@ -159,8 +159,9 @@ pub const LoadingImage = struct {
t: command.Transmission,
path: []const u8,
) !void {
// android does not support POSIX shared memory.
// windows is currently unsupported, does it support shm?
if (comptime builtin.target.os.tag == .windows) {
if (comptime builtin.abi.isAndroid() or builtin.target.os.tag == .windows) {
return error.UnsupportedMedium;
}