diff --git a/sysdeps/posix/telldir.c b/sysdeps/posix/telldir.c index 1bb822c807..57d435ed21 100644 --- a/sysdeps/posix/telldir.c +++ b/sysdeps/posix/telldir.c @@ -23,5 +23,11 @@ long int telldir (DIR *dirp) { - return dirp->filepos; + long int ret; + + __libc_lock_lock (dirp->lock); + ret = dirp->filepos; + __libc_lock_unlock (dirp->lock); + + return ret; }