__libc_lock_init (dirp->lock)
__libc_lock_init (dirp->lock);
__opendir (const char *name){  DIR *dirp;  struct stat statbuf;  int fd;  if (name[0] == '\0')    {      /* POSIX.1-1990 says an empty name gets ENOENT;	 but `open' might like it fine.  */      __set_errno (ENOENT);      return NULL;    }  fd = __open (name, O_RDONLY);  if (fd < 0)    return NULL;  if (__fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)    goto lose;  if (fstat (fd, &statbuf) < 0)    goto lose;  if (! S_ISDIR (statbuf.st_mode))    {      __set_errno (ENOTDIR);      goto lose;    }  dirp = (DIR *) calloc (1, sizeof (DIR)); /* Zero-fill.  */  if (dirp == NULL)  lose:    {      int save = errno;      (void) __close (fd);      __set_errno (save);      return NULL;    }#ifdef _STATBUF_ST_BLKSIZE  if (statbuf.st_blksize < sizeof (struct dirent))    dirp->allocation = sizeof (struct dirent);  else    dirp->allocation = statbuf.st_blksize;#else  dirp->allocation = (BUFSIZ < sizeof (struct dirent) ?		      sizeof (struct dirent) : BUFSIZ);#endif  dirp->data = (char *) malloc (dirp->allocation);  if (dirp->data == NULL)    {      int save = errno;      free (dirp);      (void) __close (fd);      __set_errno (save);      return NULL;    }  dirp->fd = fd;  __libc_lock_init (dirp->lock)  return dirp;}