Function pread [src]

Prototype

pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: i64) usize

Parameters

fd: i32buf: [*]u8count: usizeoffset: i64

Source

pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: i64) usize { if (@hasField(SYS, "pread64") and usize_bits < 64) { const offset_halves = splitValue64(offset); if (require_aligned_register_pair) { return syscall6( .pread64, @as(usize, @bitCast(@as(isize, fd))), @intFromPtr(buf), count, 0, offset_halves[0], offset_halves[1], ); } else { return syscall5( .pread64, @as(usize, @bitCast(@as(isize, fd))), @intFromPtr(buf), count, offset_halves[0], offset_halves[1], ); } } else { // Some architectures (eg. 64bit SPARC) pread is called pread64. const syscall_number = if (!@hasField(SYS, "pread") and @hasField(SYS, "pread64")) .pread64 else .pread; return syscall4( syscall_number, @as(usize, @bitCast(@as(isize, fd))), @intFromPtr(buf), count, @as(u64, @bitCast(offset)), ); } }