| 250 | |
| 251 | #[inline] |
| 252 | pub(crate) fn _seek(fd: BorrowedFd<'_>, offset: i64, whence: c::c_uint) -> io::Result<u64> { |
| 253 | #[cfg(target_pointer_width = "32")] |
| 254 | unsafe { |
| 255 | let mut result = MaybeUninit::<u64>::uninit(); |
| 256 | ret(syscall!( |
| 257 | __NR__llseek, |
| 258 | fd, |
| 259 | // Don't use the hi/lo functions here because Linux's llseek |
| 260 | // takes its 64-bit argument differently from everything else. |
| 261 | pass_usize((offset >> 32) as usize), |
| 262 | pass_usize(offset as usize), |
| 263 | &mut result, |
| 264 | c_uint(whence) |
| 265 | ))?; |
| 266 | Ok(result.assume_init()) |
| 267 | } |
| 268 | #[cfg(target_pointer_width = "64")] |
| 269 | unsafe { |
| 270 | ret_u64(syscall_readonly!( |
| 271 | __NR_lseek, |
| 272 | fd, |
| 273 | loff_t(offset), |
| 274 | c_uint(whence) |
| 275 | )) |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | #[inline] |
| 280 | pub(crate) fn tell(fd: BorrowedFd<'_>) -> io::Result<u64> { |