Or make depth exceeded be a soft failure: once depth is exceeded, start
keeping two parallel copies of next symlink. Update on one advance to
next symlink twice for every once on the other. If ever device and inode
are the same you've found a loop.
Of course, if the loop is a thousand sylinks deep, you'll have to do
something like 3000 readlinks before you detect it. Probably this means
that while in the depth exceeded algorithm you should be very polite
about resource use.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to firstname.lastname@example.org