Is it safe to call dlclose(NULL)?
问题 I experience a crash when I pass a null pointer to dlclose . Should I check for null before calling dlclose ? POSIX tells nothing about this: http://pubs.opengroup.org/onlinepubs/7908799/xsh/dlclose.html Is it undefined behaviour or a bug in dlclose implementation? 回答1: This is tricky. POSIX states that if handle does not refer to an open object, dlclose() returns a non-zero value from which you could infer that it should detect, for an arbitrary pointer, whether that pointer refers to an