feature. See also
. The project being documented here (as the example) is the Zig library itself.
c.pthread_rwlock_t
pub const pthread_rwlock_t = switch (native_os)
File
Code
pub const pthread_rwlock_t = switch (native_os) {
.linux => switch (native_abi) {
.android, .androideabi => switch (@sizeOf(usize)) {
4 => extern struct {
data: [40]u8 align(@alignOf(usize)) = @splat(0),
},
8 => extern struct {
data: [56]u8 align(@alignOf(usize)) = @splat(0),
},
else => @compileError("impossible pointer size"),
},
else => extern struct {
data: [56]u8 align(@alignOf(usize)) = @splat(0),
},
},
.driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
sig: c_long = 0x2DA8B3B4,
data: [192]u8 = @splat(0),
},
.freebsd, .dragonfly, .openbsd => extern struct {
ptr: ?*anyopaque = null,
},
.hermit => extern struct {
ptr: usize = maxInt(usize),
},
.netbsd => extern struct {
magic: c_uint = 0x99990009,
interlock: switch (builtin.cpu.arch) {
.aarch64, .aarch64_be, .m68k, .sparc, .sparc64, .x86, .x86_64 => u8,
.arm, .armeb, .powerpc => c_int,
.mips, .mipsel, .mips64, .mips64el => c_uint,
else => unreachable,
} = 0,
rblocked_first: ?*u8 = null,
rblocked_last: ?*u8 = null,
wblocked_first: ?*u8 = null,
wblocked_last: ?*u8 = null,
nreaders: c_uint = 0,
owner: ?pthread_t = null,
private: ?*anyopaque = null,
},
.illumos => extern struct {
readers: i32 = 0,
type: u16 = 0,
magic: u16 = 0x5257,
mutex: pthread_mutex_t = .{},
readercv: pthread_cond_t = .{},
writercv: pthread_cond_t = .{},
},
.fuchsia => extern struct {
size: [56]u8 align(@alignOf(usize)) = @splat(0),
},
.emscripten => extern struct {
size: [32]u8 align(4) = @splat(0),
},
.serenity => extern struct {
inner: u64 = 0,
},
else => void,
}