Next: dlfcn.h, Previous: ctype.h, Up: ISO C and POSIX Header File Substitutes [Contents][Index]
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
Gnulib module: dirent
Portability problems fixed by Gnulib:
ino_t
is missing on some platforms:
glibc 2.23 and others.
Portability problems not fixed by Gnulib:
struct dirent
member named
d_type
and directory entry type macros like DT_DIR
and
DT_LNK
, some do not:
Minix 3.1.8, AIX 7.2, HP-UX 11, Solaris 11.4, mingw.
d_type
, not every filesystem supports
d_type
, and those lacking support will set it to DT_UNKNOWN
.
struct dirent
member named d_namlen
containing the string length of d_name
, but others do not:
glibc 2.23 on Linux, Minix 3.1.8, Solaris 11.4, Cygwin.
All of these, except Cygwin, have a member d_reclen
instead,
that has a different semantics.
struct dirent
member named d_off
containing a magic cookie suitable as an argument to seekdir
,
but others do not:
glibc 2.23 on Hurd, macOS 11.1, FreeBSD 11.0, NetBSD 10.0, OpenBSD 6.7, AIX 5.1, HP-UX 11, Cygwin, mingw.
struct dirent
member named
d_reclen
containing the number of bytes in the directory entry
record, but others do not. This member has limited utility, as it is
an implementation detail.