diff options
author | wtchang%redhat.com <devnull@localhost> | 2005-02-09 00:28:33 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2005-02-09 00:28:33 +0000 |
commit | c413f470cbaec95c18233552b0784f2430436614 (patch) | |
tree | 9af9340a93b8012599f69da93b984be5d62c4010 | |
parent | 82caac4189a5db5601c4ce7e908740c6e39a360b (diff) | |
download | nspr-hg-c413f470cbaec95c18233552b0784f2430436614.tar.gz |
Bugzilla Bug 280984: we found that the L_IGNOREUNLOAD flag is not yet
supported on 64-bit AIX, so we have to work around that. The patch is
contributed by Philip K. Warren (IBM) <pkwarren@gmail.com>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r-- | pr/src/linking/prlink.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c index 1b14058a..c80c8c1f 100644 --- a/pr/src/linking/prlink.c +++ b/pr/src/linking/prlink.c @@ -1753,6 +1753,7 @@ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr) struct ld_info *info; unsigned int info_length = LD_INFO_INCREMENT * sizeof(struct ld_info); struct ld_info *infop; + int loadflags = L_GETINFO | L_IGNOREUNLOAD; for (;;) { info = PR_Malloc(info_length); @@ -1760,9 +1761,22 @@ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr) return NULL; } /* If buffer is too small, loadquery fails with ENOMEM. */ - if (loadquery(L_GETINFO | L_IGNOREUNLOAD, info, info_length) != -1) { + if (loadquery(loadflags, info, info_length) != -1) { break; } + /* + * Calling loadquery when compiled for 64-bit with the + * L_IGNOREUNLOAD flag can cause an invalid argument error + * on AIX 5.1. Detect this error the first time that + * loadquery is called, and try calling it again without + * this flag set. + */ + if (errno == EINVAL && (loadflags & L_IGNOREUNLOAD)) { + loadflags &= ~L_IGNOREUNLOAD; + if (loadquery(loadflags, info, info_length) != -1) { + break; + } + } PR_Free(info); if (errno != ENOMEM) { /* should not happen */ |