Rob Landley writes:
I'm moving some code to use openat() and friends, but there doesn't appear to be a readdirat().The problem is that readdir(3) takes a path from cwd.
No, it doesn't. readdir() takes an existing DIR pointer, that was previously returned by opendir(3).
You will note that the opendir(3) man page also described an alternative fdopendir() function, which in conjunction with openat(3) will do what you want.
Attachment:
pgpqtRaiLVb0t.pgp
Description: PGP signature