summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/ftruncate.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/ftruncate.c')
-rw-r--r--otherlibs/unix/ftruncate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/otherlibs/unix/ftruncate.c b/otherlibs/unix/ftruncate.c
index 259404362..8fe041b47 100644
--- a/otherlibs/unix/ftruncate.c
+++ b/otherlibs/unix/ftruncate.c
@@ -13,8 +13,13 @@
/* $Id$ */
+#include <sys/types.h>
#include <mlvalues.h>
+#include <io.h>
#include "unixsupport.h"
+#ifdef HAS_UNISTD
+#include <unistd.h>
+#endif
#ifdef HAS_TRUNCATE
@@ -25,6 +30,13 @@ CAMLprim value unix_ftruncate(value fd, value len)
return Val_unit;
}
+CAMLprim value unix_ftruncate_64(value fd, value len)
+{
+ if (ftruncate(Int_val(fd), File_offset_val(len)) == -1)
+ uerror("ftruncate", Nothing);
+ return Val_unit;
+}
+
#else
CAMLprim value unix_ftruncate(value fd, value len)