* tests/d_type-check: The hardcoded name doesn't hold true for all
Linux/glibc platforms, let alone Linux/non-glibc.
Use ctypes.util.find_library() instead to search for the library.
fail = 1
try:
- import ctypes
+ import ctypes.util
(DT_UNKNOWN, DT_DIR,) = (0, 4,)
direntp = ctypes.POINTER(dirent)
- # FIXME: find a way to avoid hard-coding libc's so-name.
- libc = ctypes.cdll.LoadLibrary("libc.so.6")
+ libc = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True)
libc.readdir.restype = direntp
dirp = libc.opendir(".")