summaryrefslogtreecommitdiff
path: root/iperlsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'iperlsys.h')
-rw-r--r--iperlsys.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/iperlsys.h b/iperlsys.h
index 5bb0f05c8b..28e6719427 100644
--- a/iperlsys.h
+++ b/iperlsys.h
@@ -726,7 +726,13 @@ struct IPerlLIOInfo
#define PerlLIO_access(file, mode) access((file), (mode))
#define PerlLIO_chmod(file, mode) chmod((file), (mode))
#define PerlLIO_chown(file, owner, grp) chown((file), (owner), (grp))
-#define PerlLIO_chsize(fd, size) chsize((fd), (size))
+#if defined(HAS_TRUNCATE)
+# define PerlLIO_chsize(fd, size) ftruncate((fd), (size))
+#elif defined(HAS_CHSIZE)
+# define PerlLIO_chsize(fd, size) chsize((fd), (size))
+#else
+# define PerlLIO_chsize(fd, size) my_chsize((fd), (size))
+#endif
#define PerlLIO_close(fd) close((fd))
#define PerlLIO_dup(fd) dup((fd))
#define PerlLIO_dup2(fd1, fd2) dup2((fd1), (fd2))