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

Florian Weimer fweimer@redhat.com
Mon Sep 19 08:30:29 GMT 2022


* Andreas Schwab:

> 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?

It's an internal Linux construct.  Isn't this clear from the context?

Thanks,
Florian



More information about the Libc-alpha mailing list