summaryrefslogtreecommitdiff
path: root/iperlsys.h
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-03-29 08:22:45 +0000
committerSteve Hay <SteveHay@planit.com>2005-03-29 08:22:45 +0000
commit58e24efff3e72032a19e2adb55a951735452dbca (patch)
tree730df36fd67e20d9774cb73a3aec5c66768e70fd /iperlsys.h
parentd94a595083cd516d035cdb88f9587033a47e185e (diff)
downloadperl-58e24efff3e72032a19e2adb55a951735452dbca.tar.gz
Fix PerlLIO_chsize() for platforms that don't have chsize()
This is the patch from the end of the thread that started here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-09/msg00055.html p4raw-id: //depot/perl@24092
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))