]> granicus.if.org Git - strace/commitdiff
2004-01-13 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Tue, 13 Jan 2004 09:47:49 +0000 (09:47 +0000)
committerRoland McGrath <roland@redhat.com>
Tue, 13 Jan 2004 09:47:49 +0000 (09:47 +0000)
* file.c (direnttypes): Define under [LINUX] as well.  Add DT_UNKNOWN.
(sys_getdents64) [LINUX]: Print d_type field.

file.c

diff --git a/file.c b/file.c
index 5ab057ca69ebffa1bd6e4c5d0ff1758fa378e9a9..d03c01b04a5e394df0498cf5487df12c0e2be82c 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1903,8 +1903,9 @@ struct tcb *tcp;
 
 #endif /* LINUX */
 
-#ifdef FREEBSD
+#if defined FREEBSD || defined LINUX
 struct xlat direnttypes[] = {
+       { DT_UNKNOWN,   "DT_UNKNOWN"    },
        { DT_FIFO,      "DT_FIFO"       },
        { DT_CHR,       "DT_CHR"        },
        { DT_DIR,       "DT_DIR"        },
@@ -2036,6 +2037,11 @@ struct tcb *tcp;
                                i ? " " : "",
                                (unsigned long)d->d_ino,
                                (unsigned long)d->d_off);
+#ifdef LINUX
+                       tprintf("d_type=");
+                       printxval(direnttypes, d->d_type, "DT_???");
+                       tprintf(", ");
+#endif
                        tprintf("d_reclen=%u, d_name=\"%s\"}",
                                d->d_reclen, d->d_name);
                }