Clean up some of the dirent.h documentation and add a dirfd() function.
Use the proper header file for the memcpy2() and memset2() functions.