aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/bits/linux.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-12 16:43:50 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-04-15 19:06:39 -0700
commit429cd2b5dd27bec15a4a3351114ce1bcd12d8d01 (patch)
tree6f0dda8c4a63d7944046bf9a580e20ba304de814 /lib/std/os/bits/linux.zig
parenta4bb7c8bb17a4ac692401946df6b9f4cc3e5b1b2 (diff)
downloadzig-429cd2b5dd27bec15a4a3351114ce1bcd12d8d01.tar.gz
zig-429cd2b5dd27bec15a4a3351114ce1bcd12d8d01.zip
std: change `@import("builtin")` to `std.builtin`
Diffstat (limited to 'lib/std/os/bits/linux.zig')
-rw-r--r--lib/std/os/bits/linux.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig
index 86d89016f3..1c8414ceb5 100644
--- a/lib/std/os/bits/linux.zig
+++ b/lib/std/os/bits/linux.zig
@@ -3,17 +3,17 @@
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
-const builtin = @import("builtin");
const std = @import("../../std.zig");
const maxInt = std.math.maxInt;
+const arch = std.Target.current.cpu.arch;
usingnamespace @import("../bits.zig");
-pub usingnamespace switch (builtin.arch) {
+pub usingnamespace switch (arch) {
.mips, .mipsel => @import("linux/errno-mips.zig"),
else => @import("linux/errno-generic.zig"),
};
-pub usingnamespace switch (builtin.arch) {
+pub usingnamespace switch (arch) {
.i386 => @import("linux/i386.zig"),
.x86_64 => @import("linux/x86_64.zig"),
.aarch64 => @import("linux/arm64.zig"),
@@ -30,9 +30,9 @@ pub usingnamespace @import("linux/netlink.zig");
pub usingnamespace @import("linux/prctl.zig");
pub usingnamespace @import("linux/securebits.zig");
-const is_mips = builtin.arch.isMIPS();
-const is_ppc64 = builtin.arch.isPPC64();
-const is_sparc = builtin.arch.isSPARC();
+const is_mips = arch.isMIPS();
+const is_ppc64 = arch.isPPC64();
+const is_sparc = arch.isSPARC();
pub const pid_t = i32;
pub const fd_t = i32;
@@ -134,7 +134,7 @@ pub const PROT_WRITE = 0x2;
pub const PROT_EXEC = 0x4;
/// page may be used for atomic ops
-pub const PROT_SEM = switch (builtin.arch) {
+pub const PROT_SEM = switch (arch) {
// TODO: also xtensa
.mips, .mipsel, .mips64, .mips64el => 0x10,
else => 0x8,
@@ -1004,7 +1004,7 @@ pub const sigset_t = [1024 / 32]u32;
pub const all_mask: sigset_t = [_]u32{0xffffffff} ** sigset_t.len;
pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffffffff} ** 30;
-pub const k_sigaction = switch (builtin.arch) {
+pub const k_sigaction = switch (arch) {
.mips, .mipsel => extern struct {
flags: c_uint,
handler: ?fn (c_int) callconv(.C) void,
@@ -1121,7 +1121,7 @@ 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 = switch (builtin.arch) {
+pub const epoll_event = switch (arch) {
.x86_64 => packed struct {
events: u32,
data: epoll_data,
@@ -1288,12 +1288,12 @@ pub fn CPU_COUNT(set: cpu_set_t) cpu_count_t {
//#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) {
+pub const MINSIGSTKSZ = switch (arch) {
.i386, .x86_64, .arm, .mipsel => 2048,
.aarch64 => 5120,
else => @compileError("MINSIGSTKSZ not defined for this architecture"),
};
-pub const SIGSTKSZ = switch (builtin.arch) {
+pub const SIGSTKSZ = switch (arch) {
.i386, .x86_64, .arm, .mipsel => 8192,
.aarch64 => 16384,
else => @compileError("SIGSTKSZ not defined for this architecture"),
@@ -2053,7 +2053,7 @@ pub const B3000000 = 0o0010015;
pub const B3500000 = 0o0010016;
pub const B4000000 = 0o0010017;
-pub usingnamespace switch (builtin.arch) {
+pub usingnamespace switch (arch) {
.powerpc, .powerpc64, .powerpc64le => struct {
pub const VINTR = 0;
pub const VQUIT = 1;