mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 03:44:46 +01:00
- use symbol export helper - move all declarations from common.zig into c.zig - correct documentation - delete dead code
16 lines
373 B
Zig
16 lines
373 B
Zig
const builtin = @import("builtin");
|
|
|
|
const std = @import("std");
|
|
|
|
const symbol = @import("../../c.zig").symbol;
|
|
const errno = @import("../../c.zig").errno;
|
|
|
|
comptime {
|
|
if (builtin.target.isMuslLibC()) {
|
|
symbol(&flockLinux, "flock");
|
|
}
|
|
}
|
|
|
|
fn flockLinux(fd: c_int, operation: c_int) callconv(.c) c_int {
|
|
return errno(std.os.linux.flock(fd, operation));
|
|
}
|