[PATCH] Linux: Do not skip d_ino == 0 entries in readdir, readdir64 (bug 12165)

Andreas Schwab schwab@suse.de
Mon Sep 19 08:26:22 GMT 2022


On Sep 19 2022, Florian Weimer via Libc-alpha wrote:

> -	  if (bytes <= 0)
> -	    {
> -	      /* On some systems getdents fails with ENOENT when the

Shouldn't that be "some file systems"?

> -		 open directory has been rmdir'd already.  POSIX.1
> -		 requires that we treat this condition like normal EOF.  */
> -	      if (bytes < 0 && errno == ENOENT)
> -		bytes = 0;
> -
> -	      /* Don't modifiy errno when reaching EOF.  */
> -	      if (bytes == 0)
> -		__set_errno (saved_errno);
> -	      dp = NULL;
> -	      break;
> -	    }
> -	  dirp->size = (size_t) bytes;
> -
> -	  /* Reset the offset into the buffer.  */
> -	  dirp->offset = 0;
> +	  /* Linux fails with ENOENT if IS_DEADDIR is true for the

What is IS_DEADDIR?

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list