Commit 934df5bd44

N00byEdge <hannesbredberg@gmail.com>
2021-07-30 19:04:18
Make linux syscalls accessible with non-Linux target OS
1 parent b465037
lib/std/os/linux/arm-eabi.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile ("svc #0"
lib/std/os/linux/arm64.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile ("svc #0"
lib/std/os/linux/i386.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile ("int $0x80"
lib/std/os/linux/mips.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile (
lib/std/os/linux/powerpc.zig
@@ -5,6 +5,7 @@
 // and substantial portions of the software.
 
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile (
lib/std/os/linux/powerpc64.zig
@@ -5,6 +5,7 @@
 // and substantial portions of the software.
 
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile (
lib/std/os/linux/riscv64.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile ("ecall"
lib/std/os/linux/sparc64.zig
@@ -1,4 +1,5 @@
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall_pipe(fd: *[2]i32) usize {
     return asm volatile (
lib/std/os/linux/thumb.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 // The syscall interface is identical to the ARM one but we're facing an extra
 // challenge: r7, the register where the syscall number is stored, may be
lib/std/os/linux/x86_64.zig
@@ -4,6 +4,7 @@
 // The MIT license requires this copyright notice to be included in all copies
 // and substantial portions of the software.
 usingnamespace @import("../bits.zig");
+usingnamespace @import("../bits/linux.zig");
 
 pub fn syscall0(number: SYS) usize {
     return asm volatile ("syscall"