Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/readdir.c
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | if (__isthreaded) { | ||||
_pthread_mutex_unlock(&dirp->dd_lock); | _pthread_mutex_unlock(&dirp->dd_lock); | ||||
} | } | ||||
else | else | ||||
dp = _readdir_unlocked(dirp, 1); | dp = _readdir_unlocked(dirp, 1); | ||||
return (dp); | return (dp); | ||||
} | } | ||||
int | int | ||||
readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) | __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) | ||||
{ | { | ||||
struct dirent *dp; | struct dirent *dp; | ||||
int saved_errno; | int saved_errno; | ||||
saved_errno = errno; | saved_errno = errno; | ||||
errno = 0; | errno = 0; | ||||
if (__isthreaded) { | if (__isthreaded) { | ||||
_pthread_mutex_lock(&dirp->dd_lock); | _pthread_mutex_lock(&dirp->dd_lock); | ||||
Show All 12 Lines | __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) | ||||
if (dp != NULL) | if (dp != NULL) | ||||
*result = entry; | *result = entry; | ||||
else | else | ||||
*result = NULL; | *result = NULL; | ||||
return (0); | return (0); | ||||
} | } | ||||
__strong_reference(__readdir_r, readdir_r); |