From 8f998fb47044937d6d3c266c7568974ce1c60817 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 13 Jan 2009 17:46:17 +1300 Subject: [PATCH] getdents.2: Before kernel < 2.6.4, 'd_type' was effectively always DT_UNKNOWN Reported-by: Bastien ROUCARIES Signed-off-by: Michael Kerrisk --- man2/getdents.2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/man2/getdents.2 b/man2/getdents.2 index 70c43c9c3..2852263f1 100644 --- a/man2/getdents.2 +++ b/man2/getdents.2 @@ -115,6 +115,16 @@ This is a Unix domain socket. .B DT_UNKNOWN The file type is unknown. .PP +The +.I d_type +field is implemented since Linux 2.6.4. +It occupies a space that was previously a zero-filled padding byte in the +.IR linux_dirent +structure. +Thus, on kernels before 2.6.3, +attempting to access this field always provides the value 0 +.RB ( DT_UNKNOWN ). +.PP Currently, .\" kernel 2.6.27 .\" The same sentence is in readdir.2