There is no ftruncate() in visual studio. There is a _chsize_s()
which has a similar functionality.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
#include <WS2tcpip.h>
#include <windows.h>
#include <BaseTsd.h>
+#include <io.h>
#define inline __inline
#define __func__ __FUNCTION__
{
return ovs_format_message(GetLastError());
}
+
+int
+ftruncate(int fd, off_t length)
+{
+ int error;
+
+ error = _chsize_s(fd, length);
+ if (error) {
+ return -1;
+ }
+ return 0;
+}
#endif
\f
char *ovs_format_message(int error);
char *ovs_lasterror_to_string(void);
+int ftruncate(int fd, off_t length);
#endif
#ifdef __cplusplus