diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2002-03-02 09:16:39 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2002-03-02 09:16:39 +0000 |
commit | bddfe5d0cecccc8aa995fe95c4af5cbc41743747 (patch) | |
tree | 5ca9135daa03b182b678b4ca01092f103be27549 /otherlibs/unix/ftruncate.c | |
parent | 00d7dbf924dccb864a839fdfa86001e9fe48142e (diff) |
Ajout operations sur gros fichiers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix/ftruncate.c')
-rw-r--r-- | otherlibs/unix/ftruncate.c | 12 |
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) |