This is the mail archive of the
mailing list for the glibc project.
Re: [Jamie Lokier <email@example.com>] libc/1068: [glibc] Possible erroneous return code from Linux __getdirentries
- To: firstname.lastname@example.org
- Subject: Re: [Jamie Lokier <email@example.com>] libc/1068: [glibc] Possible erroneous return code from Linux __getdirentries
- From: Andreas Schwab <firstname.lastname@example.org>
- Date: 07 Apr 1999 14:09:24 +0200
- Cc: Jamie Lokier <email@example.com>
- References: <firstname.lastname@example.org>
Andreas Jaeger <email@example.com> writes:
|> We've received the appended bug report about a problem with
|> The linux man page states:
|> RETURN VALUE
|> getdirentries returns the number of bytes read or zero
|> when at the end of the directory. If an error occurs, -1
|> is returned, and errno is set appropriately.
|> and <dirent.h> has:
|> /* Read directory entries from FD into BUF, reading at most NBYTES.
|> Reading starts at offset *BASEP, and *BASEP is updated with the new
|> position after reading. Returns the number of bytes read; zero when at
|> end of directory; or -1 for errors. */
|> We could (as my appended patch does) directly return the -1 from
|> getdents for errors. Is this the right semantic?
IMHO this is exactly the Right Thing to do. There could be other errors
like EIO that should be reported back immediately as well. I have checked
Andreas Schwab "And now for something
firstname.lastname@example.org completely different"