diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-09-26 01:54:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-26 01:54:45 -0400 |
| commit | 68bb3945708c43109c48bda3664176307d45b62c (patch) | |
| tree | afb9731e10cef9d192560b52cd9ae2cf179775c4 /lib/std/c/linux.zig | |
| parent | 6128bc728d1e1024a178c16c2149f5b1a167a013 (diff) | |
| parent | 4637e8f9699af9c3c6cf4df50ef5bb67c7a318a4 (diff) | |
| download | zig-68bb3945708c43109c48bda3664176307d45b62c.tar.gz zig-68bb3945708c43109c48bda3664176307d45b62c.zip | |
Merge pull request #3315 from ziglang/mv-std-lib
Move std/ to lib/std/
Diffstat (limited to 'lib/std/c/linux.zig')
| -rw-r--r-- | lib/std/c/linux.zig | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/std/c/linux.zig b/lib/std/c/linux.zig new file mode 100644 index 0000000000..b3b3cbdde7 --- /dev/null +++ b/lib/std/c/linux.zig @@ -0,0 +1,32 @@ +const std = @import("../std.zig"); +const maxInt = std.math.maxInt; +usingnamespace std.c; + +extern "c" fn __errno_location() *c_int; +pub const _errno = __errno_location; + +pub const MAP_FAILED = @intToPtr(*c_void, maxInt(usize)); + +pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize; +pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int; +pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int; +pub extern "c" fn epoll_ctl(epfd: fd_t, op: c_uint, fd: fd_t, event: ?*epoll_event) c_int; +pub extern "c" fn epoll_create1(flags: c_uint) c_int; +pub extern "c" fn epoll_wait(epfd: fd_t, events: [*]epoll_event, maxevents: c_uint, timeout: c_int) c_int; +pub extern "c" fn epoll_pwait( + epfd: fd_t, + events: [*]epoll_event, + maxevents: c_int, + timeout: c_int, + sigmask: *const sigset_t, +) c_int; +pub extern "c" fn inotify_init1(flags: c_uint) c_int; +pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*]const u8, mask: u32) c_int; + +/// See std.elf for constants for this +pub extern "c" fn getauxval(__type: c_ulong) c_ulong; + +pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int; +pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; + +pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
