| author | |
| committer | |
| log | aa8e53908a355f42551b7fb51cf78b197bfbd851 |
| tree | c02533db908fd2f541be40e8d58466a98294deff |
| parent | dc1bc52dd6c10b99041f9e6189d6fd3541c714c4 |
| signature |
16 files changed, 153 insertions(+), 338 deletions(-)
lib/std/os/linux/aarch64.zig+10-22| ... | @@ -1,18 +1,6 @@ | ... | @@ -1,18 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const socklen_t = linux.socklen_t; | ||
| 7 | const sockaddr = linux.sockaddr; | ||
| 8 | const iovec = std.posix.iovec; | ||
| 9 | const iovec_const = std.posix.iovec_const; | ||
| 10 | const uid_t = linux.uid_t; | ||
| 11 | const gid_t = linux.gid_t; | ||
| 12 | const pid_t = linux.pid_t; | ||
| 13 | const stack_t = linux.stack_t; | ||
| 14 | const sigset_t = linux.sigset_t; | ||
| 15 | const timespec = std.os.linux.timespec; | ||
| 16 | 4 | ||
| 17 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 18 | return asm volatile ("svc #0" | 6 | return asm volatile ("svc #0" |
| ... | @@ -135,7 +123,7 @@ pub fn clone() callconv(.naked) u64 { | ... | @@ -135,7 +123,7 @@ pub fn clone() callconv(.naked) u64 { |
| 135 | pub const restore = restore_rt; | 123 | pub const restore = restore_rt; |
| 136 | 124 | ||
| 137 | pub fn restore_rt() callconv(.naked) noreturn { | 125 | pub fn restore_rt() callconv(.naked) noreturn { |
| 138 | switch (@import("builtin").zig_backend) { | 126 | switch (builtin.zig_backend) { |
| 139 | .stage2_c => asm volatile ( | 127 | .stage2_c => asm volatile ( |
| 140 | \\ mov x8, %[number] | 128 | \\ mov x8, %[number] |
| 141 | \\ svc #0 | 129 | \\ svc #0 |
| ... | @@ -170,28 +158,28 @@ pub const Stat = extern struct { | ... | @@ -170,28 +158,28 @@ pub const Stat = extern struct { |
| 170 | ino: ino_t, | 158 | ino: ino_t, |
| 171 | mode: mode_t, | 159 | mode: mode_t, |
| 172 | nlink: nlink_t, | 160 | nlink: nlink_t, |
| 173 | uid: uid_t, | 161 | uid: std.os.linux.uid_t, |
| 174 | gid: gid_t, | 162 | gid: std.os.linux.gid_t, |
| 175 | rdev: dev_t, | 163 | rdev: dev_t, |
| 176 | __pad: u64, | 164 | __pad: u64, |
| 177 | size: off_t, | 165 | size: off_t, |
| 178 | blksize: blksize_t, | 166 | blksize: blksize_t, |
| 179 | __pad2: i32, | 167 | __pad2: i32, |
| 180 | blocks: blkcnt_t, | 168 | blocks: blkcnt_t, |
| 181 | atim: timespec, | 169 | atim: std.os.linux.timespec, |
| 182 | mtim: timespec, | 170 | mtim: std.os.linux.timespec, |
| 183 | ctim: timespec, | 171 | ctim: std.os.linux.timespec, |
| 184 | __unused: [2]u32, | 172 | __unused: [2]u32, |
| 185 | 173 | ||
| 186 | pub fn atime(self: @This()) timespec { | 174 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 187 | return self.atim; | 175 | return self.atim; |
| 188 | } | 176 | } |
| 189 | 177 | ||
| 190 | pub fn mtime(self: @This()) timespec { | 178 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 191 | return self.mtim; | 179 | return self.mtim; |
| 192 | } | 180 | } |
| 193 | 181 | ||
| 194 | pub fn ctime(self: @This()) timespec { | 182 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 195 | return self.ctim; | 183 | return self.ctim; |
| 196 | } | 184 | } |
| 197 | }; | 185 | }; |
lib/std/os/linux/arm.zig+12-23| ... | @@ -1,17 +1,6 @@ | ... | @@ -1,17 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | ||
| 1 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 2 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 3 | const linux = std.os.linux; | ||
| 4 | const SYS = linux.SYS; | ||
| 5 | const iovec = std.posix.iovec; | ||
| 6 | const iovec_const = std.posix.iovec_const; | ||
| 7 | const socklen_t = linux.socklen_t; | ||
| 8 | const stack_t = linux.stack_t; | ||
| 9 | const sigset_t = linux.sigset_t; | ||
| 10 | const uid_t = linux.uid_t; | ||
| 11 | const gid_t = linux.gid_t; | ||
| 12 | const pid_t = linux.pid_t; | ||
| 13 | const sockaddr = linux.sockaddr; | ||
| 14 | const timespec = linux.timespec; | ||
| 15 | 4 | ||
| 16 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 17 | return asm volatile ("svc #0" | 6 | return asm volatile ("svc #0" |
| ... | @@ -128,7 +117,7 @@ pub fn clone() callconv(.naked) u32 { | ... | @@ -128,7 +117,7 @@ pub fn clone() callconv(.naked) u32 { |
| 128 | } | 117 | } |
| 129 | 118 | ||
| 130 | pub fn restore() callconv(.naked) noreturn { | 119 | pub fn restore() callconv(.naked) noreturn { |
| 131 | switch (@import("builtin").zig_backend) { | 120 | switch (builtin.zig_backend) { |
| 132 | .stage2_c => asm volatile ( | 121 | .stage2_c => asm volatile ( |
| 133 | \\ mov r7, %[number] | 122 | \\ mov r7, %[number] |
| 134 | \\ svc #0 | 123 | \\ svc #0 |
| ... | @@ -144,7 +133,7 @@ pub fn restore() callconv(.naked) noreturn { | ... | @@ -144,7 +133,7 @@ pub fn restore() callconv(.naked) noreturn { |
| 144 | } | 133 | } |
| 145 | 134 | ||
| 146 | pub fn restore_rt() callconv(.naked) noreturn { | 135 | pub fn restore_rt() callconv(.naked) noreturn { |
| 147 | switch (@import("builtin").zig_backend) { | 136 | switch (builtin.zig_backend) { |
| 148 | .stage2_c => asm volatile ( | 137 | .stage2_c => asm volatile ( |
| 149 | \\ mov r7, %[number] | 138 | \\ mov r7, %[number] |
| 150 | \\ svc #0 | 139 | \\ svc #0 |
| ... | @@ -206,27 +195,27 @@ pub const Stat = extern struct { | ... | @@ -206,27 +195,27 @@ pub const Stat = extern struct { |
| 206 | __ino_truncated: u32, | 195 | __ino_truncated: u32, |
| 207 | mode: mode_t, | 196 | mode: mode_t, |
| 208 | nlink: nlink_t, | 197 | nlink: nlink_t, |
| 209 | uid: uid_t, | 198 | uid: std.os.linux.uid_t, |
| 210 | gid: gid_t, | 199 | gid: std.os.linux.gid_t, |
| 211 | rdev: dev_t, | 200 | rdev: dev_t, |
| 212 | __rdev_padding: u32, | 201 | __rdev_padding: u32, |
| 213 | size: off_t, | 202 | size: off_t, |
| 214 | blksize: blksize_t, | 203 | blksize: blksize_t, |
| 215 | blocks: blkcnt_t, | 204 | blocks: blkcnt_t, |
| 216 | atim: timespec, | 205 | atim: std.os.linux.timespec, |
| 217 | mtim: timespec, | 206 | mtim: std.os.linux.timespec, |
| 218 | ctim: timespec, | 207 | ctim: std.os.linux.timespec, |
| 219 | ino: ino_t, | 208 | ino: ino_t, |
| 220 | 209 | ||
| 221 | pub fn atime(self: @This()) timespec { | 210 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 222 | return self.atim; | 211 | return self.atim; |
| 223 | } | 212 | } |
| 224 | 213 | ||
| 225 | pub fn mtime(self: @This()) timespec { | 214 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 226 | return self.mtim; | 215 | return self.mtim; |
| 227 | } | 216 | } |
| 228 | 217 | ||
| 229 | pub fn ctime(self: @This()) timespec { | 218 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 230 | return self.ctim; | 219 | return self.ctim; |
| 231 | } | 220 | } |
| 232 | }; | 221 | }; |
lib/std/os/linux/hexagon.zig+9-20| ... | @@ -1,17 +1,6 @@ | ... | @@ -1,17 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const iovec = std.posix.iovec; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const iovec_const = std.posix.iovec_const; | ||
| 5 | const linux = std.os.linux; | ||
| 6 | const SYS = linux.SYS; | ||
| 7 | const uid_t = std.os.linux.uid_t; | ||
| 8 | const gid_t = std.os.linux.gid_t; | ||
| 9 | const pid_t = std.os.linux.pid_t; | ||
| 10 | const sockaddr = linux.sockaddr; | ||
| 11 | const socklen_t = linux.socklen_t; | ||
| 12 | const stack_t = linux.stack_t; | ||
| 13 | const sigset_t = linux.sigset_t; | ||
| 14 | const timespec = std.os.linux.timespec; | ||
| 15 | 4 | ||
| 16 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 17 | return asm volatile ("trap0(#1)" | 6 | return asm volatile ("trap0(#1)" |
| ... | @@ -145,28 +134,28 @@ pub const Stat = extern struct { | ... | @@ -145,28 +134,28 @@ pub const Stat = extern struct { |
| 145 | ino: ino_t, | 134 | ino: ino_t, |
| 146 | mode: mode_t, | 135 | mode: mode_t, |
| 147 | nlink: nlink_t, | 136 | nlink: nlink_t, |
| 148 | uid: uid_t, | 137 | uid: std.os.linux.uid_t, |
| 149 | gid: gid_t, | 138 | gid: std.os.linux.gid_t, |
| 150 | rdev: dev_t, | 139 | rdev: dev_t, |
| 151 | __pad: u32, | 140 | __pad: u32, |
| 152 | size: off_t, | 141 | size: off_t, |
| 153 | blksize: blksize_t, | 142 | blksize: blksize_t, |
| 154 | __pad2: i32, | 143 | __pad2: i32, |
| 155 | blocks: blkcnt_t, | 144 | blocks: blkcnt_t, |
| 156 | atim: timespec, | 145 | atim: std.os.linux.timespec, |
| 157 | mtim: timespec, | 146 | mtim: std.os.linux.timespec, |
| 158 | ctim: timespec, | 147 | ctim: std.os.linux.timespec, |
| 159 | __unused: [2]u32, | 148 | __unused: [2]u32, |
| 160 | 149 | ||
| 161 | pub fn atime(self: @This()) timespec { | 150 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 162 | return self.atim; | 151 | return self.atim; |
| 163 | } | 152 | } |
| 164 | 153 | ||
| 165 | pub fn mtime(self: @This()) timespec { | 154 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 166 | return self.mtim; | 155 | return self.mtim; |
| 167 | } | 156 | } |
| 168 | 157 | ||
| 169 | pub fn ctime(self: @This()) timespec { | 158 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 170 | return self.ctim; | 159 | return self.ctim; |
| 171 | } | 160 | } |
| 172 | }; | 161 | }; |
lib/std/os/linux/loongarch64.zig+9-19| ... | @@ -1,16 +1,6 @@ | ... | @@ -1,16 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const linux = std.os.linux; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const SYS = linux.SYS; | ||
| 5 | const iovec = std.posix.iovec; | ||
| 6 | const iovec_const = std.posix.iovec_const; | ||
| 7 | const uid_t = linux.uid_t; | ||
| 8 | const gid_t = linux.gid_t; | ||
| 9 | const stack_t = linux.stack_t; | ||
| 10 | const sigset_t = linux.sigset_t; | ||
| 11 | const sockaddr = linux.sockaddr; | ||
| 12 | const socklen_t = linux.socklen_t; | ||
| 13 | const timespec = linux.timespec; | ||
| 14 | 4 | ||
| 15 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 16 | return asm volatile ( | 6 | return asm volatile ( |
| ... | @@ -150,28 +140,28 @@ pub const Stat = extern struct { | ... | @@ -150,28 +140,28 @@ pub const Stat = extern struct { |
| 150 | ino: ino_t, | 140 | ino: ino_t, |
| 151 | mode: mode_t, | 141 | mode: mode_t, |
| 152 | nlink: nlink_t, | 142 | nlink: nlink_t, |
| 153 | uid: uid_t, | 143 | uid: std.os.linux.uid_t, |
| 154 | gid: gid_t, | 144 | gid: std.os.linux.gid_t, |
| 155 | rdev: dev_t, | 145 | rdev: dev_t, |
| 156 | _pad1: u64, | 146 | _pad1: u64, |
| 157 | size: off_t, | 147 | size: off_t, |
| 158 | blksize: blksize_t, | 148 | blksize: blksize_t, |
| 159 | _pad2: i32, | 149 | _pad2: i32, |
| 160 | blocks: blkcnt_t, | 150 | blocks: blkcnt_t, |
| 161 | atim: timespec, | 151 | atim: std.os.linux.timespec, |
| 162 | mtim: timespec, | 152 | mtim: std.os.linux.timespec, |
| 163 | ctim: timespec, | 153 | ctim: std.os.linux.timespec, |
| 164 | _pad3: [2]u32, | 154 | _pad3: [2]u32, |
| 165 | 155 | ||
| 166 | pub fn atime(self: @This()) timespec { | 156 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 167 | return self.atim; | 157 | return self.atim; |
| 168 | } | 158 | } |
| 169 | 159 | ||
| 170 | pub fn mtime(self: @This()) timespec { | 160 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 171 | return self.mtim; | 161 | return self.mtim; |
| 172 | } | 162 | } |
| 173 | 163 | ||
| 174 | pub fn ctime(self: @This()) timespec { | 164 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 175 | return self.ctim; | 165 | return self.ctim; |
| 176 | } | 166 | } |
| 177 | }; | 167 | }; |
lib/std/os/linux/m68k.zig+9-18| ... | @@ -1,15 +1,6 @@ | ... | @@ -1,15 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const iovec = std.posix.iovec; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const iovec_const = std.posix.iovec_const; | ||
| 5 | const linux = std.os.linux; | ||
| 6 | const SYS = linux.SYS; | ||
| 7 | const uid_t = std.os.linux.uid_t; | ||
| 8 | const gid_t = std.os.linux.uid_t; | ||
| 9 | const pid_t = std.os.linux.pid_t; | ||
| 10 | const sockaddr = linux.sockaddr; | ||
| 11 | const socklen_t = linux.socklen_t; | ||
| 12 | const timespec = std.os.linux.timespec; | ||
| 13 | 4 | ||
| 14 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 15 | return asm volatile ("trap #0" | 6 | return asm volatile ("trap #0" |
| ... | @@ -166,27 +157,27 @@ pub const Stat = extern struct { | ... | @@ -166,27 +157,27 @@ pub const Stat = extern struct { |
| 166 | __ino_truncated: i32, | 157 | __ino_truncated: i32, |
| 167 | mode: mode_t, | 158 | mode: mode_t, |
| 168 | nlink: nlink_t, | 159 | nlink: nlink_t, |
| 169 | uid: uid_t, | 160 | uid: std.os.linux.uid_t, |
| 170 | gid: gid_t, | 161 | gid: std.os.linux.gid_t, |
| 171 | rdev: dev_t, | 162 | rdev: dev_t, |
| 172 | __pad2: i16, | 163 | __pad2: i16, |
| 173 | size: off_t, | 164 | size: off_t, |
| 174 | blksize: blksize_t, | 165 | blksize: blksize_t, |
| 175 | blocks: blkcnt_t, | 166 | blocks: blkcnt_t, |
| 176 | atim: timespec, | 167 | atim: std.os.linux.timespec, |
| 177 | mtim: timespec, | 168 | mtim: std.os.linux.timespec, |
| 178 | ctim: timespec, | 169 | ctim: std.os.linux.timespec, |
| 179 | ino: ino_t, | 170 | ino: ino_t, |
| 180 | 171 | ||
| 181 | pub fn atime(self: @This()) timespec { | 172 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 182 | return self.atim; | 173 | return self.atim; |
| 183 | } | 174 | } |
| 184 | 175 | ||
| 185 | pub fn mtime(self: @This()) timespec { | 176 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 186 | return self.mtim; | 177 | return self.mtim; |
| 187 | } | 178 | } |
| 188 | 179 | ||
| 189 | pub fn ctime(self: @This()) timespec { | 180 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 190 | return self.ctim; | 181 | return self.ctim; |
| 191 | } | 182 | } |
| 192 | }; | 183 | }; |
lib/std/os/linux/mips.zig+12-36| ... | @@ -1,18 +1,6 @@ | ... | @@ -1,18 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const socklen_t = linux.socklen_t; | ||
| 7 | const iovec = std.posix.iovec; | ||
| 8 | const iovec_const = std.posix.iovec_const; | ||
| 9 | const uid_t = linux.uid_t; | ||
| 10 | const gid_t = linux.gid_t; | ||
| 11 | const pid_t = linux.pid_t; | ||
| 12 | const stack_t = linux.stack_t; | ||
| 13 | const sigset_t = linux.sigset_t; | ||
| 14 | const sockaddr = linux.sockaddr; | ||
| 15 | const timespec = linux.timespec; | ||
| 16 | 4 | ||
| 17 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 18 | return asm volatile ( | 6 | return asm volatile ( |
| ... | @@ -264,39 +252,27 @@ pub const Stat = extern struct { | ... | @@ -264,39 +252,27 @@ pub const Stat = extern struct { |
| 264 | ino: ino_t, | 252 | ino: ino_t, |
| 265 | mode: mode_t, | 253 | mode: mode_t, |
| 266 | nlink: nlink_t, | 254 | nlink: nlink_t, |
| 267 | uid: uid_t, | 255 | uid: std.os.linux.uid_t, |
| 268 | gid: gid_t, | 256 | gid: std.os.linux.gid_t, |
| 269 | rdev: dev_t, | 257 | rdev: dev_t, |
| 270 | __pad1: [2]u32, | 258 | __pad1: [2]u32, |
| 271 | size: off_t, | 259 | size: off_t, |
| 272 | atim: i32, | 260 | atim: std.os.linux.timespec, |
| 273 | atim_nsec: i32, | 261 | mtim: std.os.linux.timespec, |
| 274 | mtim: i32, | 262 | ctim: std.os.linux.timespec, |
| 275 | mtim_nsec: i32, | ||
| 276 | ctim: i32, | ||
| 277 | ctim_nsec: i32, | ||
| 278 | blksize: blksize_t, | 263 | blksize: blksize_t, |
| 279 | __pad3: u32, | 264 | __pad3: u32, |
| 280 | blocks: blkcnt_t, | 265 | blocks: blkcnt_t, |
| 281 | 266 | ||
| 282 | pub fn atime(self: @This()) timespec { | 267 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 283 | return .{ | 268 | return self.atim; |
| 284 | .sec = self.atim, | ||
| 285 | .nsec = self.atim_nsec, | ||
| 286 | }; | ||
| 287 | } | 269 | } |
| 288 | 270 | ||
| 289 | pub fn mtime(self: @This()) timespec { | 271 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 290 | return .{ | 272 | return self.mtim; |
| 291 | .sec = self.mtim, | ||
| 292 | .nsec = self.mtim_nsec, | ||
| 293 | }; | ||
| 294 | } | 273 | } |
| 295 | 274 | ||
| 296 | pub fn ctime(self: @This()) timespec { | 275 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 297 | return .{ | 276 | return self.ctim; |
| 298 | .sec = self.ctim, | ||
| 299 | .nsec = self.ctim_nsec, | ||
| 300 | }; | ||
| 301 | } | 277 | } |
| 302 | }; | 278 | }; |
lib/std/os/linux/mips64.zig+6-18| ... | @@ -1,18 +1,6 @@ | ... | @@ -1,18 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const socklen_t = linux.socklen_t; | ||
| 7 | const iovec = std.posix.iovec; | ||
| 8 | const iovec_const = std.posix.iovec_const; | ||
| 9 | const uid_t = linux.uid_t; | ||
| 10 | const gid_t = linux.gid_t; | ||
| 11 | const pid_t = linux.pid_t; | ||
| 12 | const stack_t = linux.stack_t; | ||
| 13 | const sigset_t = linux.sigset_t; | ||
| 14 | const sockaddr = linux.sockaddr; | ||
| 15 | const timespec = linux.timespec; | ||
| 16 | 4 | ||
| 17 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 18 | return asm volatile ( | 6 | return asm volatile ( |
| ... | @@ -243,8 +231,8 @@ pub const Stat = extern struct { | ... | @@ -243,8 +231,8 @@ pub const Stat = extern struct { |
| 243 | ino: ino_t, | 231 | ino: ino_t, |
| 244 | mode: mode_t, | 232 | mode: mode_t, |
| 245 | nlink: nlink_t, | 233 | nlink: nlink_t, |
| 246 | uid: uid_t, | 234 | uid: std.os.linux.uid_t, |
| 247 | gid: gid_t, | 235 | gid: std.os.linux.gid_t, |
| 248 | rdev: dev_t, | 236 | rdev: dev_t, |
| 249 | __pad1: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). | 237 | __pad1: [2]u32, // -1 because our dev_t is u64 (kernel dev_t is really u32). |
| 250 | size: off_t, | 238 | size: off_t, |
| ... | @@ -258,21 +246,21 @@ pub const Stat = extern struct { | ... | @@ -258,21 +246,21 @@ pub const Stat = extern struct { |
| 258 | __pad3: u32, | 246 | __pad3: u32, |
| 259 | blocks: blkcnt_t, | 247 | blocks: blkcnt_t, |
| 260 | 248 | ||
| 261 | pub fn atime(self: @This()) timespec { | 249 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 262 | return .{ | 250 | return .{ |
| 263 | .sec = self.atim, | 251 | .sec = self.atim, |
| 264 | .nsec = self.atim_nsec, | 252 | .nsec = self.atim_nsec, |
| 265 | }; | 253 | }; |
| 266 | } | 254 | } |
| 267 | 255 | ||
| 268 | pub fn mtime(self: @This()) timespec { | 256 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 269 | return .{ | 257 | return .{ |
| 270 | .sec = self.mtim, | 258 | .sec = self.mtim, |
| 271 | .nsec = self.mtim_nsec, | 259 | .nsec = self.mtim_nsec, |
| 272 | }; | 260 | }; |
| 273 | } | 261 | } |
| 274 | 262 | ||
| 275 | pub fn ctime(self: @This()) timespec { | 263 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 276 | return .{ | 264 | return .{ |
| 277 | .sec = self.ctim, | 265 | .sec = self.ctim, |
| 278 | .nsec = self.ctim_nsec, | 266 | .nsec = self.ctim_nsec, |
lib/std/os/linux/powerpc.zig+10-22| ... | @@ -1,18 +1,6 @@ | ... | @@ -1,18 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const socklen_t = linux.socklen_t; | ||
| 7 | const iovec = std.posix.iovec; | ||
| 8 | const iovec_const = std.posix.iovec_const; | ||
| 9 | const uid_t = linux.uid_t; | ||
| 10 | const gid_t = linux.gid_t; | ||
| 11 | const pid_t = linux.pid_t; | ||
| 12 | const stack_t = linux.stack_t; | ||
| 13 | const sigset_t = linux.sigset_t; | ||
| 14 | const sockaddr = linux.sockaddr; | ||
| 15 | const timespec = linux.timespec; | ||
| 16 | 4 | ||
| 17 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 18 | // r0 is both an input register and a clobber. musl and glibc achieve this with | 6 | // r0 is both an input register and a clobber. musl and glibc achieve this with |
| ... | @@ -247,7 +235,7 @@ pub fn clone() callconv(.naked) u32 { | ... | @@ -247,7 +235,7 @@ pub fn clone() callconv(.naked) u32 { |
| 247 | pub const restore = restore_rt; | 235 | pub const restore = restore_rt; |
| 248 | 236 | ||
| 249 | pub fn restore_rt() callconv(.naked) noreturn { | 237 | pub fn restore_rt() callconv(.naked) noreturn { |
| 250 | switch (@import("builtin").zig_backend) { | 238 | switch (builtin.zig_backend) { |
| 251 | .stage2_c => asm volatile ( | 239 | .stage2_c => asm volatile ( |
| 252 | \\ li 0, %[number] | 240 | \\ li 0, %[number] |
| 253 | \\ sc | 241 | \\ sc |
| ... | @@ -282,27 +270,27 @@ pub const Stat = extern struct { | ... | @@ -282,27 +270,27 @@ pub const Stat = extern struct { |
| 282 | ino: ino_t, | 270 | ino: ino_t, |
| 283 | mode: mode_t, | 271 | mode: mode_t, |
| 284 | nlink: nlink_t, | 272 | nlink: nlink_t, |
| 285 | uid: uid_t, | 273 | uid: std.os.linux.uid_t, |
| 286 | gid: gid_t, | 274 | gid: std.os.linux.gid_t, |
| 287 | rdev: dev_t, | 275 | rdev: dev_t, |
| 288 | __rdev_padding: i16, | 276 | __rdev_padding: i16, |
| 289 | size: off_t, | 277 | size: off_t, |
| 290 | blksize: blksize_t, | 278 | blksize: blksize_t, |
| 291 | blocks: blkcnt_t, | 279 | blocks: blkcnt_t, |
| 292 | atim: timespec, | 280 | atim: std.os.linux.timespec, |
| 293 | mtim: timespec, | 281 | mtim: std.os.linux.timespec, |
| 294 | ctim: timespec, | 282 | ctim: std.os.linux.timespec, |
| 295 | __unused: [2]u32, | 283 | __unused: [2]u32, |
| 296 | 284 | ||
| 297 | pub fn atime(self: @This()) timespec { | 285 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 298 | return self.atim; | 286 | return self.atim; |
| 299 | } | 287 | } |
| 300 | 288 | ||
| 301 | pub fn mtime(self: @This()) timespec { | 289 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 302 | return self.mtim; | 290 | return self.mtim; |
| 303 | } | 291 | } |
| 304 | 292 | ||
| 305 | pub fn ctime(self: @This()) timespec { | 293 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 306 | return self.ctim; | 294 | return self.ctim; |
| 307 | } | 295 | } |
| 308 | }; | 296 | }; |
lib/std/os/linux/powerpc64.zig+10-22| ... | @@ -1,18 +1,6 @@ | ... | @@ -1,18 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const socklen_t = linux.socklen_t; | ||
| 7 | const iovec = std.posix.iovec; | ||
| 8 | const iovec_const = std.posix.iovec_const; | ||
| 9 | const uid_t = linux.uid_t; | ||
| 10 | const gid_t = linux.gid_t; | ||
| 11 | const pid_t = linux.pid_t; | ||
| 12 | const stack_t = linux.stack_t; | ||
| 13 | const sigset_t = linux.sigset_t; | ||
| 14 | const sockaddr = linux.sockaddr; | ||
| 15 | const timespec = linux.timespec; | ||
| 16 | 4 | ||
| 17 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 18 | // r0 is both an input register and a clobber. musl and glibc achieve this with | 6 | // r0 is both an input register and a clobber. musl and glibc achieve this with |
| ... | @@ -232,7 +220,7 @@ pub fn clone() callconv(.naked) u64 { | ... | @@ -232,7 +220,7 @@ pub fn clone() callconv(.naked) u64 { |
| 232 | pub const restore = restore_rt; | 220 | pub const restore = restore_rt; |
| 233 | 221 | ||
| 234 | pub fn restore_rt() callconv(.naked) noreturn { | 222 | pub fn restore_rt() callconv(.naked) noreturn { |
| 235 | switch (@import("builtin").zig_backend) { | 223 | switch (builtin.zig_backend) { |
| 236 | .stage2_c => asm volatile ( | 224 | .stage2_c => asm volatile ( |
| 237 | \\ li 0, %[number] | 225 | \\ li 0, %[number] |
| 238 | \\ sc | 226 | \\ sc |
| ... | @@ -267,26 +255,26 @@ pub const Stat = extern struct { | ... | @@ -267,26 +255,26 @@ pub const Stat = extern struct { |
| 267 | ino: ino_t, | 255 | ino: ino_t, |
| 268 | nlink: nlink_t, | 256 | nlink: nlink_t, |
| 269 | mode: mode_t, | 257 | mode: mode_t, |
| 270 | uid: uid_t, | 258 | uid: std.os.linux.uid_t, |
| 271 | gid: gid_t, | 259 | gid: std.os.linux.gid_t, |
| 272 | rdev: dev_t, | 260 | rdev: dev_t, |
| 273 | size: off_t, | 261 | size: off_t, |
| 274 | blksize: blksize_t, | 262 | blksize: blksize_t, |
| 275 | blocks: blkcnt_t, | 263 | blocks: blkcnt_t, |
| 276 | atim: timespec, | 264 | atim: std.os.linux.timespec, |
| 277 | mtim: timespec, | 265 | mtim: std.os.linux.timespec, |
| 278 | ctim: timespec, | 266 | ctim: std.os.linux.timespec, |
| 279 | __unused: [3]u64, | 267 | __unused: [3]u64, |
| 280 | 268 | ||
| 281 | pub fn atime(self: @This()) timespec { | 269 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 282 | return self.atim; | 270 | return self.atim; |
| 283 | } | 271 | } |
| 284 | 272 | ||
| 285 | pub fn mtime(self: @This()) timespec { | 273 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 286 | return self.mtim; | 274 | return self.mtim; |
| 287 | } | 275 | } |
| 288 | 276 | ||
| 289 | pub fn ctime(self: @This()) timespec { | 277 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 290 | return self.ctim; | 278 | return self.ctim; |
| 291 | } | 279 | } |
| 292 | }; | 280 | }; |
lib/std/os/linux/riscv32.zig+9-20| ... | @@ -1,17 +1,6 @@ | ... | @@ -1,17 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const iovec = std.posix.iovec; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const iovec_const = std.posix.iovec_const; | ||
| 5 | const linux = std.os.linux; | ||
| 6 | const SYS = linux.SYS; | ||
| 7 | const uid_t = std.os.linux.uid_t; | ||
| 8 | const gid_t = std.os.linux.gid_t; | ||
| 9 | const pid_t = std.os.linux.pid_t; | ||
| 10 | const stack_t = linux.stack_t; | ||
| 11 | const sigset_t = linux.sigset_t; | ||
| 12 | const sockaddr = linux.sockaddr; | ||
| 13 | const socklen_t = linux.socklen_t; | ||
| 14 | const timespec = std.os.linux.timespec; | ||
| 15 | 4 | ||
| 16 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 17 | return asm volatile ("ecall" | 6 | return asm volatile ("ecall" |
| ... | @@ -150,28 +139,28 @@ pub const Stat = extern struct { | ... | @@ -150,28 +139,28 @@ pub const Stat = extern struct { |
| 150 | ino: ino_t, | 139 | ino: ino_t, |
| 151 | mode: mode_t, | 140 | mode: mode_t, |
| 152 | nlink: nlink_t, | 141 | nlink: nlink_t, |
| 153 | uid: uid_t, | 142 | uid: std.os.linux.uid_t, |
| 154 | gid: gid_t, | 143 | gid: std.os.linux.gid_t, |
| 155 | rdev: dev_t, | 144 | rdev: dev_t, |
| 156 | __pad: u32, | 145 | __pad: u32, |
| 157 | size: off_t, | 146 | size: off_t, |
| 158 | blksize: blksize_t, | 147 | blksize: blksize_t, |
| 159 | __pad2: i32, | 148 | __pad2: i32, |
| 160 | blocks: blkcnt_t, | 149 | blocks: blkcnt_t, |
| 161 | atim: timespec, | 150 | atim: std.os.linux.timespec, |
| 162 | mtim: timespec, | 151 | mtim: std.os.linux.timespec, |
| 163 | ctim: timespec, | 152 | ctim: std.os.linux.timespec, |
| 164 | __unused: [2]u32, | 153 | __unused: [2]u32, |
| 165 | 154 | ||
| 166 | pub fn atime(self: @This()) timespec { | 155 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 167 | return self.atim; | 156 | return self.atim; |
| 168 | } | 157 | } |
| 169 | 158 | ||
| 170 | pub fn mtime(self: @This()) timespec { | 159 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 171 | return self.mtim; | 160 | return self.mtim; |
| 172 | } | 161 | } |
| 173 | 162 | ||
| 174 | pub fn ctime(self: @This()) timespec { | 163 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 175 | return self.ctim; | 164 | return self.ctim; |
| 176 | } | 165 | } |
| 177 | }; | 166 | }; |
lib/std/os/linux/riscv64.zig+9-20| ... | @@ -1,17 +1,6 @@ | ... | @@ -1,17 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const iovec = std.posix.iovec; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const iovec_const = std.posix.iovec_const; | ||
| 5 | const linux = std.os.linux; | ||
| 6 | const SYS = linux.SYS; | ||
| 7 | const uid_t = std.os.linux.uid_t; | ||
| 8 | const gid_t = std.os.linux.gid_t; | ||
| 9 | const pid_t = std.os.linux.pid_t; | ||
| 10 | const stack_t = linux.stack_t; | ||
| 11 | const sigset_t = linux.sigset_t; | ||
| 12 | const sockaddr = linux.sockaddr; | ||
| 13 | const socklen_t = linux.socklen_t; | ||
| 14 | const timespec = std.os.linux.timespec; | ||
| 15 | 4 | ||
| 16 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 17 | return asm volatile ("ecall" | 6 | return asm volatile ("ecall" |
| ... | @@ -150,28 +139,28 @@ pub const Stat = extern struct { | ... | @@ -150,28 +139,28 @@ pub const Stat = extern struct { |
| 150 | ino: ino_t, | 139 | ino: ino_t, |
| 151 | mode: mode_t, | 140 | mode: mode_t, |
| 152 | nlink: nlink_t, | 141 | nlink: nlink_t, |
| 153 | uid: uid_t, | 142 | uid: std.os.linux.uid_t, |
| 154 | gid: gid_t, | 143 | gid: std.os.linux.gid_t, |
| 155 | rdev: dev_t, | 144 | rdev: dev_t, |
| 156 | __pad: u64, | 145 | __pad: u64, |
| 157 | size: off_t, | 146 | size: off_t, |
| 158 | blksize: blksize_t, | 147 | blksize: blksize_t, |
| 159 | __pad2: i32, | 148 | __pad2: i32, |
| 160 | blocks: blkcnt_t, | 149 | blocks: blkcnt_t, |
| 161 | atim: timespec, | 150 | atim: std.os.linux.timespec, |
| 162 | mtim: timespec, | 151 | mtim: std.os.linux.timespec, |
| 163 | ctim: timespec, | 152 | ctim: std.os.linux.timespec, |
| 164 | __unused: [2]u32, | 153 | __unused: [2]u32, |
| 165 | 154 | ||
| 166 | pub fn atime(self: @This()) timespec { | 155 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 167 | return self.atim; | 156 | return self.atim; |
| 168 | } | 157 | } |
| 169 | 158 | ||
| 170 | pub fn mtime(self: @This()) timespec { | 159 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 171 | return self.mtim; | 160 | return self.mtim; |
| 172 | } | 161 | } |
| 173 | 162 | ||
| 174 | pub fn ctime(self: @This()) timespec { | 163 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 175 | return self.ctim; | 164 | return self.ctim; |
| 176 | } | 165 | } |
| 177 | }; | 166 | }; |
lib/std/os/linux/s390x.zig+9-20| ... | @@ -1,17 +1,6 @@ | ... | @@ -1,17 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const iovec = std.posix.iovec; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const iovec_const = std.posix.iovec_const; | ||
| 5 | const linux = std.os.linux; | ||
| 6 | const SYS = linux.SYS; | ||
| 7 | const uid_t = std.os.linux.uid_t; | ||
| 8 | const gid_t = std.os.linux.gid_t; | ||
| 9 | const pid_t = std.os.linux.pid_t; | ||
| 10 | const sockaddr = linux.sockaddr; | ||
| 11 | const socklen_t = linux.socklen_t; | ||
| 12 | const timespec = std.os.linux.timespec; | ||
| 13 | const stack_t = std.os.linux.stack_t; | ||
| 14 | const sigset_t = std.os.linux.sigset_t; | ||
| 15 | 4 | ||
| 16 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 17 | return asm volatile ("svc 0" | 6 | return asm volatile ("svc 0" |
| ... | @@ -172,26 +161,26 @@ pub const Stat = extern struct { | ... | @@ -172,26 +161,26 @@ pub const Stat = extern struct { |
| 172 | ino: ino_t, | 161 | ino: ino_t, |
| 173 | nlink: nlink_t, | 162 | nlink: nlink_t, |
| 174 | mode: mode_t, | 163 | mode: mode_t, |
| 175 | uid: uid_t, | 164 | uid: std.os.linux.uid_t, |
| 176 | gid: gid_t, | 165 | gid: std.os.linux.gid_t, |
| 177 | rdev: dev_t, | 166 | rdev: dev_t, |
| 178 | size: off_t, | 167 | size: off_t, |
| 179 | atim: timespec, | 168 | atim: std.os.linux.timespec, |
| 180 | mtim: timespec, | 169 | mtim: std.os.linux.timespec, |
| 181 | ctim: timespec, | 170 | ctim: std.os.linux.timespec, |
| 182 | blksize: blksize_t, | 171 | blksize: blksize_t, |
| 183 | blocks: blkcnt_t, | 172 | blocks: blkcnt_t, |
| 184 | __unused: [3]c_ulong, | 173 | __unused: [3]c_ulong, |
| 185 | 174 | ||
| 186 | pub fn atime(self: @This()) timespec { | 175 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 187 | return self.atim; | 176 | return self.atim; |
| 188 | } | 177 | } |
| 189 | 178 | ||
| 190 | pub fn mtime(self: @This()) timespec { | 179 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 191 | return self.mtim; | 180 | return self.mtim; |
| 192 | } | 181 | } |
| 193 | 182 | ||
| 194 | pub fn ctime(self: @This()) timespec { | 183 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 195 | return self.ctim; | 184 | return self.ctim; |
| 196 | } | 185 | } |
| 197 | }; | 186 | }; |
lib/std/os/linux/sparc64.zig+17-29| ... | @@ -1,19 +1,6 @@ | ... | @@ -1,19 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const pid_t = linux.pid_t; | ||
| 5 | const uid_t = linux.uid_t; | ||
| 6 | const clock_t = linux.clock_t; | ||
| 7 | const stack_t = linux.stack_t; | ||
| 8 | const sigset_t = linux.sigset_t; | ||
| 9 | |||
| 10 | const linux = std.os.linux; | ||
| 11 | const SYS = linux.SYS; | ||
| 12 | const sockaddr = linux.sockaddr; | ||
| 13 | const socklen_t = linux.socklen_t; | ||
| 14 | const iovec = std.posix.iovec; | ||
| 15 | const iovec_const = std.posix.iovec_const; | ||
| 16 | const timespec = linux.timespec; | ||
| 17 | 4 | ||
| 18 | pub fn syscall_pipe(fd: *[2]i32) u64 { | 5 | pub fn syscall_pipe(fd: *[2]i32) u64 { |
| 19 | return asm volatile ( | 6 | return asm volatile ( |
| ... | @@ -252,34 +239,35 @@ pub const blkcnt_t = i64; | ... | @@ -252,34 +239,35 @@ pub const blkcnt_t = i64; |
| 252 | 239 | ||
| 253 | // The `stat64` definition used by the kernel. | 240 | // The `stat64` definition used by the kernel. |
| 254 | pub const Stat = extern struct { | 241 | pub const Stat = extern struct { |
| 255 | dev: u64, | 242 | dev: dev_t, |
| 256 | ino: u64, | 243 | ino: ino_t, |
| 257 | nlink: u64, | 244 | nlink: nlink_t, |
| 245 | _pad: i32, | ||
| 258 | 246 | ||
| 259 | mode: u32, | 247 | mode: mode_t, |
| 260 | uid: u32, | 248 | uid: std.os.linux.uid_t, |
| 261 | gid: u32, | 249 | gid: std.os.linux.gid_t, |
| 262 | __pad0: u32, | 250 | __pad0: u32, |
| 263 | 251 | ||
| 264 | rdev: u64, | 252 | rdev: dev_t, |
| 265 | size: i64, | 253 | size: i64, |
| 266 | blksize: i64, | 254 | blksize: blksize_t, |
| 267 | blocks: i64, | 255 | blocks: blkcnt_t, |
| 268 | 256 | ||
| 269 | atim: timespec, | 257 | atim: std.os.linux.timespec, |
| 270 | mtim: timespec, | 258 | mtim: std.os.linux.timespec, |
| 271 | ctim: timespec, | 259 | ctim: std.os.linux.timespec, |
| 272 | __unused: [3]u64, | 260 | __unused: [3]u64, |
| 273 | 261 | ||
| 274 | pub fn atime(self: @This()) timespec { | 262 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 275 | return self.atim; | 263 | return self.atim; |
| 276 | } | 264 | } |
| 277 | 265 | ||
| 278 | pub fn mtime(self: @This()) timespec { | 266 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 279 | return self.mtim; | 267 | return self.mtim; |
| 280 | } | 268 | } |
| 281 | 269 | ||
| 282 | pub fn ctime(self: @This()) timespec { | 270 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 283 | return self.ctim; | 271 | return self.ctim; |
| 284 | } | 272 | } |
| 285 | }; | 273 | }; |
lib/std/os/linux/thumb.zig+1-2| ... | @@ -4,8 +4,7 @@ | ... | @@ -4,8 +4,7 @@ |
| 4 | //! Save and restore r7 around the syscall without touching the stack pointer not | 4 | //! Save and restore r7 around the syscall without touching the stack pointer not |
| 5 | //! to break the frame chain. | 5 | //! to break the frame chain. |
| 6 | const std = @import("../../std.zig"); | 6 | const std = @import("../../std.zig"); |
| 7 | const linux = std.os.linux; | 7 | const SYS = std.os.linux.SYS; |
| 8 | const SYS = linux.SYS; | ||
| 9 | 8 | ||
| 10 | pub fn syscall0(number: SYS) u32 { | 9 | pub fn syscall0(number: SYS) u32 { |
| 11 | var buf: [2]u32 = .{ @intFromEnum(number), undefined }; | 10 | var buf: [2]u32 = .{ @intFromEnum(number), undefined }; |
lib/std/os/linux/x86.zig+11-23| ... | @@ -1,18 +1,6 @@ | ... | @@ -1,18 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const socklen_t = linux.socklen_t; | ||
| 7 | const iovec = std.posix.iovec; | ||
| 8 | const iovec_const = std.posix.iovec_const; | ||
| 9 | const uid_t = linux.uid_t; | ||
| 10 | const gid_t = linux.gid_t; | ||
| 11 | const pid_t = linux.pid_t; | ||
| 12 | const stack_t = linux.stack_t; | ||
| 13 | const sigset_t = linux.sigset_t; | ||
| 14 | const sockaddr = linux.sockaddr; | ||
| 15 | const timespec = linux.timespec; | ||
| 16 | 4 | ||
| 17 | pub fn syscall0(number: SYS) u32 { | 5 | pub fn syscall0(number: SYS) u32 { |
| 18 | return asm volatile ("int $0x80" | 6 | return asm volatile ("int $0x80" |
| ... | @@ -169,7 +157,7 @@ pub fn clone() callconv(.naked) u32 { | ... | @@ -169,7 +157,7 @@ pub fn clone() callconv(.naked) u32 { |
| 169 | } | 157 | } |
| 170 | 158 | ||
| 171 | pub fn restore() callconv(.naked) noreturn { | 159 | pub fn restore() callconv(.naked) noreturn { |
| 172 | switch (@import("builtin").zig_backend) { | 160 | switch (builtin.zig_backend) { |
| 173 | .stage2_c => asm volatile ( | 161 | .stage2_c => asm volatile ( |
| 174 | \\ movl %[number], %%eax | 162 | \\ movl %[number], %%eax |
| 175 | \\ int $0x80 | 163 | \\ int $0x80 |
| ... | @@ -185,7 +173,7 @@ pub fn restore() callconv(.naked) noreturn { | ... | @@ -185,7 +173,7 @@ pub fn restore() callconv(.naked) noreturn { |
| 185 | } | 173 | } |
| 186 | 174 | ||
| 187 | pub fn restore_rt() callconv(.naked) noreturn { | 175 | pub fn restore_rt() callconv(.naked) noreturn { |
| 188 | switch (@import("builtin").zig_backend) { | 176 | switch (builtin.zig_backend) { |
| 189 | .stage2_c => asm volatile ( | 177 | .stage2_c => asm volatile ( |
| 190 | \\ movl %[number], %%eax | 178 | \\ movl %[number], %%eax |
| 191 | \\ int $0x80 | 179 | \\ int $0x80 |
| ... | @@ -221,27 +209,27 @@ pub const Stat = extern struct { | ... | @@ -221,27 +209,27 @@ pub const Stat = extern struct { |
| 221 | __ino_truncated: u32, | 209 | __ino_truncated: u32, |
| 222 | mode: mode_t, | 210 | mode: mode_t, |
| 223 | nlink: nlink_t, | 211 | nlink: nlink_t, |
| 224 | uid: uid_t, | 212 | uid: std.os.linux.uid_t, |
| 225 | gid: gid_t, | 213 | gid: std.os.linux.gid_t, |
| 226 | rdev: dev_t, | 214 | rdev: dev_t, |
| 227 | __rdev_padding: u32, | 215 | __rdev_padding: u32, |
| 228 | size: off_t, | 216 | size: off_t, |
| 229 | blksize: blksize_t, | 217 | blksize: blksize_t, |
| 230 | blocks: blkcnt_t, | 218 | blocks: blkcnt_t, |
| 231 | atim: timespec, | 219 | atim: std.os.linux.timespec, |
| 232 | mtim: timespec, | 220 | mtim: std.os.linux.timespec, |
| 233 | ctim: timespec, | 221 | ctim: std.os.linux.timespec, |
| 234 | ino: ino_t, | 222 | ino: ino_t, |
| 235 | 223 | ||
| 236 | pub fn atime(self: @This()) timespec { | 224 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 237 | return self.atim; | 225 | return self.atim; |
| 238 | } | 226 | } |
| 239 | 227 | ||
| 240 | pub fn mtime(self: @This()) timespec { | 228 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 241 | return self.mtim; | 229 | return self.mtim; |
| 242 | } | 230 | } |
| 243 | 231 | ||
| 244 | pub fn ctime(self: @This()) timespec { | 232 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 245 | return self.ctim; | 233 | return self.ctim; |
| 246 | } | 234 | } |
| 247 | }; | 235 | }; |
lib/std/os/linux/x86_64.zig+10-24| ... | @@ -1,20 +1,6 @@ | ... | @@ -1,20 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("../../std.zig"); | 2 | const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const SYS = std.os.linux.SYS; |
| 4 | const linux = std.os.linux; | ||
| 5 | const SYS = linux.SYS; | ||
| 6 | const iovec = std.posix.iovec; | ||
| 7 | const iovec_const = std.posix.iovec_const; | ||
| 8 | |||
| 9 | const pid_t = linux.pid_t; | ||
| 10 | const uid_t = linux.uid_t; | ||
| 11 | const gid_t = linux.gid_t; | ||
| 12 | const clock_t = linux.clock_t; | ||
| 13 | const stack_t = linux.stack_t; | ||
| 14 | const sigset_t = linux.sigset_t; | ||
| 15 | const sockaddr = linux.sockaddr; | ||
| 16 | const socklen_t = linux.socklen_t; | ||
| 17 | const timespec = linux.timespec; | ||
| 18 | 4 | ||
| 19 | pub fn syscall0(number: SYS) u64 { | 5 | pub fn syscall0(number: SYS) u64 { |
| 20 | return asm volatile ("syscall" | 6 | return asm volatile ("syscall" |
| ... | @@ -131,7 +117,7 @@ pub fn clone() callconv(.naked) u64 { | ... | @@ -131,7 +117,7 @@ pub fn clone() callconv(.naked) u64 { |
| 131 | pub const restore = restore_rt; | 117 | pub const restore = restore_rt; |
| 132 | 118 | ||
| 133 | pub fn restore_rt() callconv(.naked) noreturn { | 119 | pub fn restore_rt() callconv(.naked) noreturn { |
| 134 | switch (@import("builtin").zig_backend) { | 120 | switch (builtin.zig_backend) { |
| 135 | .stage2_c => asm volatile ( | 121 | .stage2_c => asm volatile ( |
| 136 | \\ movl %[number], %%eax | 122 | \\ movl %[number], %%eax |
| 137 | \\ syscall | 123 | \\ syscall |
| ... | @@ -177,28 +163,28 @@ pub const Stat = extern struct { | ... | @@ -177,28 +163,28 @@ pub const Stat = extern struct { |
| 177 | nlink: u64, | 163 | nlink: u64, |
| 178 | 164 | ||
| 179 | mode: u32, | 165 | mode: u32, |
| 180 | uid: uid_t, | 166 | uid: std.os.linux.uid_t, |
| 181 | gid: gid_t, | 167 | gid: std.os.linux.gid_t, |
| 182 | __pad0: u32, | 168 | __pad0: u32, |
| 183 | rdev: dev_t, | 169 | rdev: dev_t, |
| 184 | size: off_t, | 170 | size: off_t, |
| 185 | blksize: i64, | 171 | blksize: i64, |
| 186 | blocks: i64, | 172 | blocks: i64, |
| 187 | 173 | ||
| 188 | atim: timespec, | 174 | atim: std.os.linux.timespec, |
| 189 | mtim: timespec, | 175 | mtim: std.os.linux.timespec, |
| 190 | ctim: timespec, | 176 | ctim: std.os.linux.timespec, |
| 191 | __unused: [3]i64, | 177 | __unused: [3]i64, |
| 192 | 178 | ||
| 193 | pub fn atime(self: @This()) timespec { | 179 | pub fn atime(self: @This()) std.os.linux.timespec { |
| 194 | return self.atim; | 180 | return self.atim; |
| 195 | } | 181 | } |
| 196 | 182 | ||
| 197 | pub fn mtime(self: @This()) timespec { | 183 | pub fn mtime(self: @This()) std.os.linux.timespec { |
| 198 | return self.mtim; | 184 | return self.mtim; |
| 199 | } | 185 | } |
| 200 | 186 | ||
| 201 | pub fn ctime(self: @This()) timespec { | 187 | pub fn ctime(self: @This()) std.os.linux.timespec { |
| 202 | return self.ctim; | 188 | return self.ctim; |
| 203 | } | 189 | } |
| 204 | }; | 190 | }; |