mirror of
https://github.com/openvswitch/ovs
synced 2025-10-21 14:49:41 +00:00
stdio: fseeko for Windows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
12
lib/stdio.c
12
lib/stdio.c
@@ -17,6 +17,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#undef snprintf
|
#undef snprintf
|
||||||
@@ -45,4 +46,15 @@ ovs_vsnprintf(char *s, size_t n, const char *format, va_list args)
|
|||||||
}
|
}
|
||||||
return needed;
|
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 */
|
#endif /* _WIN32 */
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* Windows libc has defective snprintf() and vsnprintf():
|
/* Windows libc has defective snprintf() and vsnprintf():
|
||||||
*
|
*
|
||||||
@@ -38,6 +39,8 @@ int ovs_snprintf(char *, size_t, const char *, ...);
|
|||||||
#undef vsnprintf
|
#undef vsnprintf
|
||||||
#define vsnprintf ovs_vsnprintf
|
#define vsnprintf ovs_vsnprintf
|
||||||
int ovs_vsnprintf(char *, size_t, const char *, va_list);
|
int ovs_vsnprintf(char *, size_t, const char *, va_list);
|
||||||
|
|
||||||
|
int fseeko(FILE *stream, off_t offset, int whence);
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#endif /* stdio.h wrapper */
|
#endif /* stdio.h wrapper */
|
||||||
|
Reference in New Issue
Block a user