From: Gurucharan Shetty Date: Tue, 11 Mar 2014 17:07:18 +0000 (-0700) Subject: stdio: fseeko for Windows. X-Git-Tag: sliver-openvswitch-2.2.90-1~6^2~131 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f69aa2561d9c44ff04aec09ab110f2008922bdd4;hp=7470e8e62a4069eed23b283803787cad3a58d729;p=sliver-openvswitch.git stdio: fseeko for Windows. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- diff --git a/lib/stdio.c b/lib/stdio.c index 49a50786a..5c5c92466 100644 --- a/lib/stdio.c +++ b/lib/stdio.c @@ -17,6 +17,7 @@ #include #include +#include #ifdef _WIN32 #undef snprintf @@ -45,4 +46,15 @@ ovs_vsnprintf(char *s, size_t n, const char *format, va_list args) } return needed; } + +int +fseeko(FILE *stream, off_t offset, int whence) +{ + int error; + error = _fseeki64(stream, offset, whence); + if (error) { + return -1; + } + return error; +} #endif /* _WIN32 */ diff --git a/lib/stdio.h.in b/lib/stdio.h.in index 3bf1f03ca..7adb9ed2a 100644 --- a/lib/stdio.h.in +++ b/lib/stdio.h.in @@ -23,6 +23,7 @@ #include #include +#include /* Windows libc has defective snprintf() and vsnprintf(): * @@ -38,6 +39,8 @@ int ovs_snprintf(char *, size_t, const char *, ...); #undef vsnprintf #define vsnprintf ovs_vsnprintf int ovs_vsnprintf(char *, size_t, const char *, va_list); + +int fseeko(FILE *stream, off_t offset, int whence); #endif /* _WIN32 */ #endif /* stdio.h wrapper */