Christopher Gorski <[EMAIL PROTECTED]> wrote: > > Of course, the getdents() API is rather unfortunate. It appears the only > > safe algorithm is: > > > > while ((r = getdents(...)) > 0) { > > /* process results */ > > } > > if (r < 0) { > > /* handle error */ > > } > > > > You _always_ have to call it at least twice to be sure you've gotten > > everything. > > > > Yes, it is Sun's cp. I'm trying, with some difficulty, to figure out > exactly how to reproduce this error in a way not specific to my data. I > copied a set of randomly generated files with a deep directory structure > and cp seems to correctly call getdents() multiple times.
Note that cp (mv) does not call getdents() directly but readdir(). If there is a problem, it is most likely in readdir() and it really looks strangee that ls(1) (although it uses the same implementaion) works for you. Jörg -- EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin [EMAIL PROTECTED] (uni) [EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss