Re: [Python-Dev] [Python-checkins] cpython: Backed out changeset 36f2e236c601: For some reason, rewinddir() doesn't work as

On Mon, Jan 9, 2012 at 5:31 AM, charles-francois.natali <python-checkins@python.org> wrote:
Backed out changeset 36f2e236c601: For some reason, rewinddir() doesn't work as it should on OpenIndiana.
Can rewinddir() end up touching the filesystem to retrieve data? I noticed that your previous change (the one this checkin reverted) moved it outside the GIL release macros. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

Actually, it also calls lseek() on the directory FD: http://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/rewinddir.c;hb=... But lseek() doesn't (normally) perform I/O, it just sets an offset in the kernel file structure: http://lxr.free-electrons.com/source/fs/read_write.c#L38 For example, it's not documented to return EINTR. Now, one could imagine that the kernel could do some read-ahead or some other magic things when passed SEEK_DATA or SEEK_HOLE, but seeking at the beginning of a directory FD should be fast. Anyway, I ended up reverting this change, because for some reason this broke OpenIndiana buildbots (maybe rewinddir() is a no-op before readdir() has been called?). Cheers, cf

Actually, it also calls lseek() on the directory FD: http://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/rewinddir.c;hb=... But lseek() doesn't (normally) perform I/O, it just sets an offset in the kernel file structure: http://lxr.free-electrons.com/source/fs/read_write.c#L38 For example, it's not documented to return EINTR. Now, one could imagine that the kernel could do some read-ahead or some other magic things when passed SEEK_DATA or SEEK_HOLE, but seeking at the beginning of a directory FD should be fast. Anyway, I ended up reverting this change, because for some reason this broke OpenIndiana buildbots (maybe rewinddir() is a no-op before readdir() has been called?). Cheers, cf
participants (3)
-
Benjamin Peterson
-
Charles-François Natali
-
Nick Coghlan