This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix readdir_r with long file names


On 05/16/2013 02:15 PM, Florian Weimer wrote:
On 05/16/2013 01:01 PM, Siddhesh Poyarekar wrote:
On Tue, May 14, 2013 at 01:32:23PM +0200, Florian Weimer wrote:
This patch changes readdir_r to return ENAMETOOLONG if the kernel
returns a file name longer than NAME_MAX characters, after the end of
the directory has been reached (so that the directory contents is not
truncated).  It also makes the padding compensation code
architecture-agnostic and enables it everywhere.

The specification for readdir/readdir_r does not mention ENAMETOOLONG
as a possible error return[1], so this should at least be mentioned in
the glibc manual, if not also in the man page.  So a manual patch is
needed on top of this.

Thanks for your comments.

We could use EOVERFLOW instead.  But ENAMETOOLONG is more informative.

I think the description for EOVERFLOW:
"One of the values in the structure to be returned cannot be represented correctly." fits this case - so, let's use that one to follow POSIX,

Andreas
--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]