Looking at opendir()/readdir()/closedir() sequence via ktrace,
I've seen supposedly useless lseek() syscall just before close().
It's called from closedir():
_seekdir(dirp, dirp->dd_rewind); /* free seekdir storage */
It seems that free()ing libc seekdir storage should be done without
calling lseek().
Other strange place for me is stat() before open() in opendir()
/*
* stat() before _open() because opening of special files may be
* harmful. _fstat() after open because the file may have changed.
*/
What is the case when opening special file may be harmful ?
--
Igor Sysoev
http://sysoev.ru/en/
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"