From 41b96fede3c869491412d6efbe748080b1017650 Mon Sep 17 00:00:00 2001 From: Tom Almeida <tommoa256@gmail.com> Date: Thu, 15 Mar 2018 15:57:19 +0800 Subject: [PATCH] Added a different internal function for redox --- src/stdio/src/internal.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stdio/src/internal.rs b/src/stdio/src/internal.rs index 00b68924..f9ef756f 100644 --- a/src/stdio/src/internal.rs +++ b/src/stdio/src/internal.rs @@ -142,6 +142,12 @@ pub unsafe fn ftello(stream: *mut FILE) -> off_t { } } +#[cfg(target_os = "linux")] pub fn stdio_seek(stream: *mut FILE, off: off_t, whence: c_int) -> off_t { unsafe { platform::lseek((*stream).fd, off, whence) } } + +#[cfg(target_os = "redox")] +pub fn stdio_seek(stream: *mut FILE, off: off_t, whence: c_int) -> off_t { + unsafe { platform::lseek((*stream).fd, off as isize, whence as usize) as off_t } +} -- GitLab