This is the mail archive of the
mailing list for the glibc project.
Re: [Jamie Lokier <firstname.lastname@example.org>] libc/1068: [glibc] Possible erroneous return code from Linux __getdirentries
- To: email@example.com
- Subject: Re: [Jamie Lokier <firstname.lastname@example.org>] libc/1068: [glibc] Possible erroneous return code from Linux __getdirentries
- From: Andreas Schwab <email@example.com>
- Date: 07 Apr 1999 14:09:24 +0200
- Cc: Jamie Lokier <firstname.lastname@example.org>
- References: <email@example.com>
Andreas Jaeger <firstname.lastname@example.org> 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
email@example.com completely different"