| author | |
| committer | |
| log | 0b8bd9b2b4f609fb4ae7d31da7e7a0fd4f5ad987 |
| tree | c5c11adbecdba4ecd60fa45d612a57d3f9a9d8c6 |
| parent | df1f401cf0e997ed289e14f69ab1114e839b56ee |
7 files changed, 42 insertions(+), 7 deletions(-)
lib/std/os/linux/arm64.zig+6-1| ... | @@ -98,8 +98,13 @@ pub fn syscall6( | ... | @@ -98,8 +98,13 @@ pub fn syscall6( |
| 98 | ); | 98 | ); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | const CloneFn = switch (@import("builtin").zig_backend) { | ||
| 102 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 103 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 104 | }; | ||
| 105 | |||
| 101 | /// This matches the libc clone function. | 106 | /// This matches the libc clone function. |
| 102 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 107 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 103 | 108 | ||
| 104 | pub const restore = restore_rt; | 109 | pub const restore = restore_rt; |
| 105 | 110 |
lib/std/os/linux/i386.zig+6-1| ... | @@ -118,8 +118,13 @@ pub fn socketcall(call: usize, args: [*]usize) usize { | ... | @@ -118,8 +118,13 @@ pub fn socketcall(call: usize, args: [*]usize) usize { |
| 118 | ); | 118 | ); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | const CloneFn = switch (@import("builtin").zig_backend) { | ||
| 122 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 123 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 124 | }; | ||
| 125 | |||
| 121 | /// This matches the libc clone function. | 126 | /// This matches the libc clone function. |
| 122 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 127 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 123 | 128 | ||
| 124 | pub fn restore() callconv(.Naked) void { | 129 | pub fn restore() callconv(.Naked) void { |
| 125 | return asm volatile ("int $0x80" | 130 | return asm volatile ("int $0x80" |
lib/std/os/linux/mips.zig+6-1| ... | @@ -190,8 +190,13 @@ pub fn syscall7( | ... | @@ -190,8 +190,13 @@ pub fn syscall7( |
| 190 | ); | 190 | ); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | const CloneFn = switch (@import("builtin").zig_backend) { | ||
| 194 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 195 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 196 | }; | ||
| 197 | |||
| 193 | /// This matches the libc clone function. | 198 | /// This matches the libc clone function. |
| 194 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 199 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 195 | 200 | ||
| 196 | pub fn restore() callconv(.Naked) void { | 201 | pub fn restore() callconv(.Naked) void { |
| 197 | return asm volatile ("syscall" | 202 | return asm volatile ("syscall" |
lib/std/os/linux/powerpc.zig+6-1| ... | @@ -126,8 +126,13 @@ pub fn syscall6( | ... | @@ -126,8 +126,13 @@ pub fn syscall6( |
| 126 | ); | 126 | ); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | const CloneFn = switch (@import("builtin").zig_backend) { | ||
| 130 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 131 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 132 | }; | ||
| 133 | |||
| 129 | /// This matches the libc clone function. | 134 | /// This matches the libc clone function. |
| 130 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 135 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 131 | 136 | ||
| 132 | pub const restore = restore_rt; | 137 | pub const restore = restore_rt; |
| 133 | 138 |
lib/std/os/linux/powerpc64.zig+6-1| ... | @@ -126,8 +126,13 @@ pub fn syscall6( | ... | @@ -126,8 +126,13 @@ pub fn syscall6( |
| 126 | ); | 126 | ); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | const CloneFn = switch (@import("builtin").zig_backend) { | ||
| 130 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 131 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 132 | }; | ||
| 133 | |||
| 129 | /// This matches the libc clone function. | 134 | /// This matches the libc clone function. |
| 130 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 135 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 131 | 136 | ||
| 132 | pub const restore = restore_rt; | 137 | pub const restore = restore_rt; |
| 133 | 138 |
lib/std/os/linux/riscv64.zig+6-1| ... | @@ -95,7 +95,12 @@ pub fn syscall6( | ... | @@ -95,7 +95,12 @@ pub fn syscall6( |
| 95 | ); | 95 | ); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 98 | const CloneFn = switch (@import("builtin").zig_backend) { |
| 99 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 100 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 101 | }; | ||
| 102 | |||
| 103 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | ||
| 99 | 104 | ||
| 100 | pub const restore = restore_rt; | 105 | pub const restore = restore_rt; |
| 101 | 106 |
lib/std/os/linux/sparc64.zig+6-1| ... | @@ -178,8 +178,13 @@ pub fn syscall6( | ... | @@ -178,8 +178,13 @@ pub fn syscall6( |
| 178 | ); | 178 | ); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | const CloneFn = switch (@import("builtin").zig_backend) { | ||
| 182 | .stage1 => fn (arg: usize) callconv(.C) u8, | ||
| 183 | else => *const fn (arg: usize) callconv(.C) u8, | ||
| 184 | }; | ||
| 185 | |||
| 181 | /// This matches the libc clone function. | 186 | /// This matches the libc clone function. |
| 182 | pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | 187 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 183 | 188 | ||
| 184 | pub const restore = restore_rt; | 189 | pub const restore = restore_rt; |
| 185 | 190 |