summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTim Bunce <Tim.Bunce@ig.co.uk>1997-06-11 12:00:00 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-06-11 12:00:00 +1200
commit1553ab042847244da5856825de22281fd831878d (patch)
treed65be104a22e8e3a89a3fbde5aa9d88078c0fa3d /ext
parent137153360e77d819f1f8e8f21d3fdc5e16babede (diff)
downloadperl-1553ab042847244da5856825de22281fd831878d.tar.gz
perl5.004 on AIX: Patches
(this is the same change as commit a9581ec21a2686ca09657757555fcd66435bb205, but as applied)
Diffstat (limited to 'ext')
-rw-r--r--ext/DynaLoader/dl_aix.xs12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/DynaLoader/dl_aix.xs b/ext/DynaLoader/dl_aix.xs
index bdf33b2410..746666636a 100644
--- a/ext/DynaLoader/dl_aix.xs
+++ b/ext/DynaLoader/dl_aix.xs
@@ -29,6 +29,12 @@
#include <a.out.h>
#include <ldfcn.h>
+/* If using PerlIO, redefine these macros from <ldfcn.h> */
+#ifdef USE_PERLIO
+#define FSEEK(ldptr,o,p) PerlIO_seek(IOPTR(ldptr),(p==BEGINNING)?(OFFSET(ldptr)+o):o,p)
+#define FREAD(p,s,n,ldptr) PerlIO_read(IOPTR(ldptr),p,s*n)
+#endif
+
/*
* We simulate dlopen() et al. through a call to load. Because AIX has
* no call to find an exported symbol we read the loader section of the
@@ -389,7 +395,13 @@ static int readExports(ModulePtr mp)
;
return -1;
}
+/* This first case is a hack, since it assumes that the 3rd parameter to
+ FREAD is 1. See the redefinition of FREAD above to see how this works. */
+#ifdef USE_PERLIO
+ if (FREAD(ldbuf, sh.s_size, 1, ldp) != sh.s_size) {
+#else
if (FREAD(ldbuf, sh.s_size, 1, ldp) != 1) {
+#endif
errvalid++;
strcpy(errbuf, "readExports: cannot read loader section");
safefree(ldbuf);