Path: blob/main/core/kernel/src/wasm/posix/unistd.zig
1068 views
pub fn keepalive() void {}1const std = @import("std");2const unistd = @cImport({3@cInclude("unistd.h");4@cInclude("fcntl.h"); // just needed for constants5@cInclude("poll.h");6@cInclude("sys/socket.h");7});89pub const constants = .{10.c_import = unistd,11.names = [_][:0]const u8{ "O_CLOEXEC", "O_NONBLOCK", "O_APPEND", "F_ULOCK", "F_LOCK", "F_TLOCK", "F_TEST", "POLLIN", "POLLOUT", "SOL_SOCKET", "SHUT_RD", "SHUT_WR", "SHUT_RDWR" },12};1314// uid_t geteuid(void);15extern fn _geteuid() unistd.uid_t;16export fn geteuid() unistd.uid_t {17return _geteuid();18}1920// int fchown(int fd, uid_t owner, gid_t group);21extern fn _fchown(fd: c_int, owner: unistd.uid_t, group: unistd.gid_t) c_int;22export fn fchown(fd: c_int, owner: unistd.uid_t, group: unistd.gid_t) c_int {23return _fchown(fd, owner, group);24}252627