aboutsummaryrefslogtreecommitdiff
path: root/std/os/bits/linux.zig
diff options
context:
space:
mode:
authorhryx <codroid@gmail.com>2019-06-08 16:23:27 -0700
committerhryx <codroid@gmail.com>2019-06-08 16:23:27 -0700
commitad0f0562d8103d65bd36eb12ead899f375bda3e0 (patch)
tree97adb8031a0647becf1a8b638494d8a79264c9c3 /std/os/bits/linux.zig
parented5b8335b564cc4372b12e1c1a1b459aa348a90d (diff)
parent720ed74413f086a93f5ed66159300d8dd48e8034 (diff)
downloadzig-ad0f0562d8103d65bd36eb12ead899f375bda3e0.tar.gz
zig-ad0f0562d8103d65bd36eb12ead899f375bda3e0.zip
Merge branch 'master' into translate-c-userland
Diffstat (limited to 'std/os/bits/linux.zig')
-rw-r--r--std/os/bits/linux.zig39
1 files changed, 30 insertions, 9 deletions
diff --git a/std/os/bits/linux.zig b/std/os/bits/linux.zig
index 6532e72362..ff541077d9 100644
--- a/std/os/bits/linux.zig
+++ b/std/os/bits/linux.zig
@@ -1,10 +1,10 @@
const builtin = @import("builtin");
const std = @import("../../std.zig");
const maxInt = std.math.maxInt;
-use @import("../bits.zig");
+usingnamespace @import("../bits.zig");
-pub use @import("linux/errno.zig");
-pub use switch (builtin.arch) {
+pub usingnamespace @import("linux/errno.zig");
+pub usingnamespace switch (builtin.arch) {
.x86_64 => @import("linux/x86_64.zig"),
.aarch64 => @import("linux/arm64.zig"),
else => struct {},
@@ -762,16 +762,16 @@ pub const epoll_data = extern union {
// On x86_64 the structure is packed so that it matches the definition of its
// 32bit counterpart
-pub const epoll_event = if (builtin.arch != .x86_64)
- extern struct {
+pub const epoll_event = switch (builtin.arch) {
+ .x86_64 => packed struct {
events: u32,
data: epoll_data,
- }
-else
- packed struct {
+ },
+ else => extern struct {
events: u32,
data: epoll_data,
- };
+ },
+};
pub const _LINUX_CAPABILITY_VERSION_1 = 0x19980330;
pub const _LINUX_CAPABILITY_U32S_1 = 1;
@@ -929,3 +929,24 @@ pub fn CPU_COUNT(set: cpu_set_t) cpu_count_t {
//#define CPU_COUNT(set) CPU_COUNT_S(sizeof(cpu_set_t),set)
//#define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t),set)
//#define CPU_EQUAL(s1,s2) CPU_EQUAL_S(sizeof(cpu_set_t),s1,s2)
+
+pub const MINSIGSTKSZ = switch (builtin.arch) {
+ .i386, .x86_64, .arm => 2048,
+ .aarch64 => 5120,
+ else => @compileError("MINSIGSTKSZ not defined for this architecture"),
+};
+pub const SIGSTKSZ = switch (builtin.arch) {
+ .i386, .x86_64, .arm => 8192,
+ .aarch64 => 16384,
+ else => @compileError("SIGSTKSZ not defined for this architecture"),
+};
+
+pub const SS_ONSTACK = 1;
+pub const SS_DISABLE = 2;
+pub const SS_AUTODISARM = 1 << 31;
+
+pub const stack_t = extern struct {
+ ss_sp: [*]u8,
+ ss_flags: i32,
+ ss_size: isize,
+};