authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-30 01:50:49 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-30 01:50:49 -07:00
logcb4ce969e68724779bb34e0a662ea8c7becd155d
tree4e37f376934ad48435c595558bdfdab8600f3bf5
parent93bead17d88d0f5258de2af01fda51a3efbb687b
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add lseek


2 files changed, 14 insertions(+), 0 deletions(-)

mod.zig+13
...@@ -3313,6 +3313,14 @@ pub const W = struct {...@@ -3313,6 +3313,14 @@ pub const W = struct {
3313 }3313 }
3314};3314};
33153315
3316pub const SEEK = struct {
3317 pub const SET = 0;
3318 pub const CUR = 1;
3319 pub const END = 2;
3320 pub const DATA = 3;
3321 pub const HOLE = 4;
3322};
3323
3316pub fn getpid() pid_t {3324pub fn getpid() pid_t {
3317 return libc.getpid();3325 return libc.getpid();
3318}3326}
...@@ -3700,3 +3708,8 @@ pub fn unlinkat(fd: c_int, name: [*:0]const u8, flag: c_int) !void {...@@ -3700,3 +3708,8 @@ pub fn unlinkat(fd: c_int, name: [*:0]const u8, flag: c_int) !void {
3700 if (rc == -1) return errno.fromInt(errno.fromLibC());3708 if (rc == -1) return errno.fromInt(errno.fromLibC());
3701 std.debug.assert(rc == 0);3709 std.debug.assert(rc == 0);
3702}3710}
3711pub fn lseek(fd: c_int, offset: off_t, whence: c_int) !void {
3712 const rc = libc.lseek(fd, offset, whence);
3713 if (rc == -1) return errno.fromInt(errno.fromLibC());
3714 std.debug.assert(rc >= 0);
3715}
test.zig+1
...@@ -79,4 +79,5 @@ test {...@@ -79,4 +79,5 @@ test {
79 _ = &linux.poll;79 _ = &linux.poll;
80 _ = &linux.waitpid;80 _ = &linux.waitpid;
81 _ = &linux.unlinkat;81 _ = &linux.unlinkat;
82 _ = &linux.lseek;
82}83}