This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/226] [RFC] d_type is always set to "0"


------- Additional Comments From cbou at mail dot ru  2004-06-18 11:59 -------
Oh sorry, forgot. 
It is i686-gnu-linux, filesystem is ext2. 
 
$ uname -a 
Linux localhost 2.6.7 #1 Fri Jun 18 16:43:58 MSD 2004 i686 unknown unknown 
GNU/Linux 
 
Test case is: 
#include <stdio.h> 
#include <unistd.h> 
#include <dirent.h> 
 
int main(int argc, char *argv[]) 
{ 
        DIR *d; 
        struct dirent *de; 
#ifdef _DIRENT_HAVE_D_TYPE 
        printf("have d_type\n"); 
#endif 
        d = opendir("/usr"); 
        while ((de = readdir(d)) != NULL) { 
                printf("%d | %s\n" ,(unsigned int)de->d_type, de->d_name); 
 
        } 
        return 0; 
} 
 
test case output on my box: 
have d_type 
0 | . 
0 | .. 
0 | bin 
0 | lib 
0 | [.....] 
 
 
strace -fqv ./testcase says: 
... 
getdents(3, {{d_ino=489601, d_off=12, d_reclen=16, d_name="."} {d_ino=2, 
d_off=24, d_reclen=16, d_name=".."} {d_ino=522241, d_off=36, d_reclen=16, 
d_name="bin"} {d_ino=554881, d_off=48, d_reclen=16, d_name="lib"} 
{d_ino=587521, d_off=64, d_reclen=20, d_name="local"} {d_ino=1664641, d_off=76, 
d_reclen=16, d_name="man"} {d_ino=2023681, d_off=88, d_reclen=16, d_name="doc"} 
{d_ino=2056321, d_off=100, d_reclen=16, d_name="src"} {d_ino=2088961, 
d_off=112, d_reclen=16, d_name="etc"} {d_ino=489602, d_off=124, d_reclen=16, 
d_name="X11"} {d_ino=2154241, d_off=136, d_reclen=16, d_name="info"} 
{d_ino=2186881, d_off=148, d_reclen=16, d_name="sbin"} {d_ino=2219521, 
d_off=164, d_reclen=20, d_name="share"} {d_ino=490455, d_off=180, d_reclen=20, 
d_name="X11R6"} {d_ino=2872321, d_off=208, d_reclen=20, d_name="include"} 
{d_ino=489603, d_off=220, d_reclen=16, d_name="adm"} {d_ino=489604, d_off=236, 
d_reclen=20, d_name="spool"} {d_ino=489605, d_off=248, d_reclen=16, 
d_name="tmp"} {d_ino=4928641, d_off=552, d_reclen=20, d_name="libexec"} 
{d_ino=2839683, d_off=4096, d_reclen=20, d_name="packs"}}, 4096) = 348 
... 
 
syscall getdents in my kernel does not provide d_type? I'm confused, what 
should I do to enable d_type in kernel and glibc? 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW


http://sources.redhat.com/bugzilla/show_bug.cgi?id=226

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]