Solved Two Versions of Directory Entry Header (dirent.h)

Hello People,

There is a version of the Directory Entry definition file (dirent.h) in /usr/include/ and another version of /usr/include/sys/.
I believe that for FreeBSD programming I should use /usr/include/dirent.h.
Is this correct?
I note that the /usr/include/ version does include the /usr/include/sys/ version.


=thoth=
 
Code:
SYNOPSIS
     #include <dirent.h>
Code:
     The directory entry format is defined in the file <sys/dirent.h> (which
     should not be included directly by applications):
From dirent(5).
 
Hi SirDice,

Code:
SYNOPSIS
     #include <dirent.h>
Code:
     The directory entry format is defined in the file <sys/dirent.h> (which
     should not be included directly by applications):
From dirent(5).

I happened to see that on the Ubuntu box my elder son is using. After reading this post, I see the warning in the man page on a FreeBSD laptop.
However, I was looking at the source files on one of my FreeBSD laptops.
Code:
Predator: ~: uname -a
FreeBSD Predator 11.2-RELEASE FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
Surprisingly, that sentence is not in either file.
I am still getting used to the idea of checking for a man page for an include.


Thank you for answering.


=thoth=
 
Back
Top