devfs_readdir() bits; ugly but works (mostly)