From 59a6501b5fefd27ec32efd355060dbc8c745bf9a Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 14 Oct 1994 21:23:31 +0000 Subject: Formerly utilities.c.~5~ --- ufs-fsck/utilities.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'ufs-fsck') diff --git a/ufs-fsck/utilities.c b/ufs-fsck/utilities.c index 7dacaa95..4780ac8a 100644 --- a/ufs-fsck/utilities.c +++ b/ufs-fsck/utilities.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Read disk block ADDR into BUF of SIZE bytes. */ void @@ -229,6 +230,28 @@ reply (char *question) } } +/* Print a helpful description of the given inode number. */ +void +pinode (ino_t ino) +{ + struct dinode dino; + struct passwd *pw; + char *p; + + printf (" I=%d ", ino); + if (ino < ROOTINO || ino > maxino) + return; + getinode (ino, &dino); + printf (" OWNER="); + if (pw = getpwuid (dino.di_uid)) + printf ("%s ", pw->pw_name); + else + printf ("%lu ", dino.di_uid); - + printf (" MODE=%o\n", DI_MODE (&dino)); + printf ("SIZE=%llu ", dino.di_size); + p = ctime (&dino.di_mtime.ts_sec); + printf ("MTIME=%12.12s %4.4s ", &p[4], &p[20]); +} + -- cgit v1.2.3