Check for nlist function presence before attenmpting to use it instead
of relying on the presence of the nlist.h header. Mac OS X, in particular
has the header, but only has the function in the 32bit libraries.
memset_s \
mkdtemp \
ngetaddrinfo \
+ nlist \
nsleep \
ogetaddrinfo \
openlog_r \
int
lib_contains_symbol(const char *path, const char *s)
{
-#ifdef HAVE_NLIST_H
+#ifdef HAVE_NLIST
struct nlist nl[2];
int ret = -1, r;
out:
free(nl[0].n_name);
return ret;
-#else /* HAVE_NLIST_H */
+#else /* HAVE_NLIST */
int fd, ret = -1;
struct stat st;
void *m = NULL;
munmap(m, sz);
close(fd);
return ret;
-#endif /* HAVE_NLIST_H */
+#endif /* HAVE_NLIST */
}
int