mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.os.linux: move some generic decls out of the arch bits
This commit is contained in:
parent
8970d80355
commit
fc7a5f2ae4
16 changed files with 12 additions and 153 deletions
|
|
@ -88,7 +88,6 @@ pub fn clone(
|
|||
}
|
||||
|
||||
pub const ARCH = arch_bits.ARCH;
|
||||
pub const Elf_Symndx = arch_bits.Elf_Symndx;
|
||||
pub const F = arch_bits.F;
|
||||
pub const Flock = arch_bits.Flock;
|
||||
pub const HWCAP = arch_bits.HWCAP;
|
||||
|
|
@ -103,8 +102,6 @@ pub const mode_t = arch_bits.mode_t;
|
|||
pub const nlink_t = arch_bits.nlink_t;
|
||||
pub const off_t = arch_bits.off_t;
|
||||
pub const time_t = arch_bits.time_t;
|
||||
pub const timeval = arch_bits.timeval;
|
||||
pub const timezone = arch_bits.timezone;
|
||||
pub const user_desc = arch_bits.user_desc;
|
||||
|
||||
pub const tls = @import("linux/tls.zig");
|
||||
|
|
@ -1611,6 +1608,8 @@ pub fn flock(fd: fd_t, operation: i32) usize {
|
|||
return syscall2(.flock, @as(usize, @bitCast(@as(isize, fd))), @as(usize, @bitCast(@as(isize, operation))));
|
||||
}
|
||||
|
||||
pub const Elf_Symndx = if (native_arch == .s390x) u64 else u32;
|
||||
|
||||
// We must follow the C calling convention when we call into the VDSO
|
||||
const VdsoClockGettime = *align(1) const fn (clockid_t, *timespec) callconv(.c) usize;
|
||||
var vdso_clock_gettime: ?VdsoClockGettime = &init_vdso_clock_gettime;
|
||||
|
|
@ -8360,6 +8359,16 @@ pub const POSIX_FADV = switch (native_arch) {
|
|||
},
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
tv_sec: isize,
|
||||
tv_usec: i64,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
/// The timespec struct used by the kernel.
|
||||
pub const kernel_timespec = extern struct {
|
||||
sec: i64,
|
||||
|
|
|
|||
|
|
@ -230,15 +230,3 @@ pub const Stat = extern struct {
|
|||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: isize,
|
||||
usec: isize,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -266,15 +266,3 @@ pub const Stat = extern struct {
|
|||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: i32,
|
||||
usec: i32,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -154,11 +154,6 @@ pub const F = struct {
|
|||
pub const GETOWNER_UIDS = 17;
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: time_t,
|
||||
usec: i32,
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
type: i16,
|
||||
whence: i16,
|
||||
|
|
@ -209,6 +204,4 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
pub const VDSO = void;
|
||||
|
|
|
|||
|
|
@ -176,11 +176,6 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
tv_sec: time_t,
|
||||
tv_usec: i64,
|
||||
};
|
||||
|
||||
pub const F = struct {
|
||||
pub const DUPFD = 0;
|
||||
pub const GETFD = 1;
|
||||
|
|
@ -209,5 +204,3 @@ pub const VDSO = struct {
|
|||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_5.10";
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -186,11 +186,6 @@ pub const ino_t = u64;
|
|||
pub const dev_t = u64;
|
||||
pub const blkcnt_t = i64;
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: time_t,
|
||||
usec: i32,
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
type: i16,
|
||||
whence: i16,
|
||||
|
|
@ -230,7 +225,5 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
// No VDSO used as of glibc 112a0ae18b831bf31f44d81b82666980312511d6.
|
||||
pub const VDSO = void;
|
||||
|
|
|
|||
|
|
@ -336,15 +336,3 @@ pub const Stat = extern struct {
|
|||
};
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: isize,
|
||||
usec: isize,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -315,15 +315,3 @@ pub const Stat = extern struct {
|
|||
};
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: isize,
|
||||
usec: isize,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -340,15 +340,3 @@ pub const Stat = extern struct {
|
|||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: time_t,
|
||||
usec: isize,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -325,15 +325,3 @@ pub const Stat = extern struct {
|
|||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: isize,
|
||||
usec: isize,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -168,11 +168,6 @@ pub const ino_t = u64;
|
|||
pub const dev_t = u64;
|
||||
pub const blkcnt_t = i64;
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: time_t,
|
||||
usec: i64,
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
type: i16,
|
||||
whence: i16,
|
||||
|
|
@ -214,8 +209,6 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_4.15";
|
||||
|
|
|
|||
|
|
@ -168,11 +168,6 @@ pub const ino_t = u64;
|
|||
pub const dev_t = u64;
|
||||
pub const blkcnt_t = i64;
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: time_t,
|
||||
usec: i64,
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
type: i16,
|
||||
whence: i16,
|
||||
|
|
@ -214,8 +209,6 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_4.15";
|
||||
|
|
|
|||
|
|
@ -186,11 +186,6 @@ pub const ino_t = u64;
|
|||
pub const dev_t = u64;
|
||||
pub const blkcnt_t = i64;
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: time_t,
|
||||
usec: i64,
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
type: i16,
|
||||
whence: i16,
|
||||
|
|
@ -229,8 +224,6 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u64;
|
||||
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__kernel_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_2.6.29";
|
||||
|
|
|
|||
|
|
@ -314,15 +314,3 @@ pub const Stat = extern struct {
|
|||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: isize,
|
||||
usec: i32,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
|
|
@ -278,18 +278,6 @@ pub const Stat = extern struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: i32,
|
||||
usec: i32,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
pub const user_desc = extern struct {
|
||||
entry_number: u32,
|
||||
base_addr: u32,
|
||||
|
|
|
|||
|
|
@ -234,15 +234,3 @@ pub const Stat = extern struct {
|
|||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
pub const timeval = extern struct {
|
||||
sec: isize,
|
||||
usec: isize,
|
||||
};
|
||||
|
||||
pub const timezone = extern struct {
|
||||
minuteswest: i32,
|
||||
dsttime: i32,
|
||||
};
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue