*** ./nss/lib/freebl/unix_rand.c.ORIG Sat Dec 3 00:34:06 2016 --- ./nss/lib/freebl/unix_rand.c Sat Dec 3 00:35:11 2016 *************** *** 1055,1060 **** --- 1055,1064 ---- return S_ISREG(stat_buf.st_mode) ? PR_TRUE : PR_FALSE; } + #ifndef NAME_MAX + #define NAME_MAX (MAXNAMLEN - 1) + #endif + /* * read one file out of either /etc or the user's home directory. * fileToRead tells which file to read. *** ./nss/lib/freebl/stubs.c.ORIG Sat Dec 3 00:43:00 2016 --- ./nss/lib/freebl/stubs.c Sat Dec 3 00:46:37 2016 *************** *** 392,397 **** --- 392,401 ---- extern char * PR_GetLibraryFilePathname_stub(const char *name, PRFuncPtr addr) { + #ifdef _AIX + /* AIX does not have Dl_info in and dladdr() ! */ + return NULL; + #else Dl_info dli; char *result; *************** *** 405,410 **** --- 409,415 ---- strcpy(result, dli.dli_fname); } return result; + #endif } #include *************** *** 649,656 **** --- 654,666 ---- * fetch the library if it's loaded. For NSS it should already be loaded */ + #ifdef _AIX #define freebl_getLibrary(libName) \ + dlopen(libName, RTLD_LAZY) + #else + #define freebl_getLibrary(libName) \ dlopen(libName, RTLD_LAZY | RTLD_NOLOAD) + #endif #define freebl_releaseLibrary(lib) \ if (lib) \ dlclose(lib) *** ./nss/lib/freebl/lowhash_vector.c.ORIG Sat Dec 3 01:13:57 2016 --- ./nss/lib/freebl/lowhash_vector.c Sat Dec 3 01:15:10 2016 *************** *** 46,56 **** --- 46,61 ---- static char * freebl_lowhash_getLibraryFilePath(void *addr) { + #ifdef _AIX + /* AIX does not have Dl_info in and dladdr() ! */ + return NULL; + #else Dl_info dli; if (dladdr(addr, &dli) == 0) { return NULL; } return strdup(dli.dli_fname); + #endif } /* *** ./nss/lib/freebl/lowhash_vector.c.ORIG Mon Dec 5 10:11:35 2016 --- ./nss/lib/freebl/lowhash_vector.c Mon Dec 5 10:12:25 2016 *************** *** 115,121 **** --- 115,125 ---- if (loadFreeBLOnce.initialized) { return loadFreeBLOnce.status; } + #ifdef _AIX + if (PR_ATOMIC_SET(&loadFreeBLOnce.inProgress, 1) == 0) { + #else if (__sync_lock_test_and_set(&loadFreeBLOnce.inProgress, 1) == 0) { + #endif loadFreeBLOnce.status = freebl_LoadDSO(); loadFreeBLOnce.initialized = 1; } else {