So a really quite substantial bug (affecting perhaps 3% of all calls to
this function in nontrivial directories) persisted for *a quarter of a
century* before anyone noticed it.
I suspect that seekdir()/telldir() has exactly one user: Samba. Given how
horrible it makes filesystem implementations, and the closeness of Samba
implementors to the kernel, I'm not sure that it's worth preserving this
function for that one user (which is privileged in any case so the usual
oops-it-might-use-up-too-much-memory arguments against a naive
entirely-in-VFS implementation do not apply).
Votes to make seekdir()/telldir() root-only, anyone?