Index: fsdb.8 =================================================================== RCS file: /home/ncvs/src/sbin/fsdb/fsdb.8,v retrieving revision 1.29 diff -u -p -r1.29 fsdb.8 --- fsdb.8 2 Jun 2006 12:55:26 -0000 1.29 +++ fsdb.8 2 Jun 2006 14:02:19 -0000 @@ -207,7 +207,8 @@ Change the generation number of the curr .It Cm mtime Ar time .It Cm ctime Ar time .It Cm atime Ar time -Change the modification, change, or access time (respectively) on the +.It Cm btime Ar time +Change the modification, change, access, or birth time (respectively) on the current inode to .Ar time . .Ar Time @@ -219,9 +220,11 @@ is an optional nanosecond specification. If no nanoseconds are specified, the .Va mtimensec , .Va ctimensec , +.Va atimensec , or -.Va atimensec +.Va birthnsec field will be set to zero. +Note that birth time is UFS2 feature. .Pp .It Cm quit , q , exit , Em Exit the program. Index: fsdb.c =================================================================== RCS file: /home/ncvs/src/sbin/fsdb/fsdb.c,v retrieving revision 1.33 diff -u -p -r1.33 fsdb.c --- fsdb.c 2 Jun 2006 12:55:26 -0000 1.33 +++ fsdb.c 2 Jun 2006 14:02:19 -0000 @@ -151,6 +151,7 @@ CMDFUNC(back); /* pop back to last in CMDFUNC(chmtime); /* Change mtime */ CMDFUNC(chctime); /* Change ctime */ CMDFUNC(chatime); /* Change atime */ +CMDFUNC(chbtime); /* Change birthtime */ CMDFUNC(chinum); /* Change inode # of dirent */ CMDFUNC(chname); /* Change dirname of dirent */ @@ -185,6 +186,7 @@ struct cmdtable cmds[] = { { "mtime", "Change mtime of current inode to MTIME", 2, 2, FL_WR, chmtime }, { "ctime", "Change ctime of current inode to CTIME", 2, 2, FL_WR, chctime }, { "atime", "Change atime of current inode to ATIME", 2, 2, FL_WR, chatime }, + { "btime", "Change birthtime of current inode to BTIME", 2, 2, FL_WR, chbtime }, { "quit", "Exit", 1, 1, FL_RO, quit }, { "q", "Exit", 1, 1, FL_RO, quit }, { "exit", "Exit", 1, 1, FL_RO, quit }, @@ -1182,3 +1184,20 @@ CMDFUNCSTART(chctime) printactive(0); return 0; } + +CMDFUNCSTART(chbtime) +{ + time_t secs; + int32_t nsecs; + + if (dotime(argv[1], &secs, &nsecs)) + return 1; + if (sblock.fs_magic == FS_UFS2_MAGIC) { + curinode->dp2.di_birthtime = _time_to_time64(secs); + curinode->dp2.di_birthnsec = nsecs; + inodirty(); + printactive(0); + return 0; + } else + return 1; +} Index: fsdbutil.c =================================================================== RCS file: /home/ncvs/src/sbin/fsdb/fsdbutil.c,v retrieving revision 1.19 diff -u -p -r1.19 fsdbutil.c --- fsdbutil.c 21 Apr 2006 20:33:16 -0000 1.19 +++ fsdbutil.c 2 Jun 2006 14:02:19 -0000 @@ -175,8 +175,14 @@ printstat(const char *cp, ino_t inum, un else t = _time64_to_time(dp->dp2.di_atime); p = ctime(&t); - printf("\n\tATIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20], + printf("\n\tATIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20], DIP(dp, di_atimensec)); + if (sblock.fs_magic == FS_UFS2_MAGIC) { + t = _time64_to_time(dp->dp2.di_birthtime); + p = ctime(&t); + printf("\n\tBTIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20], + dp->dp2.di_atimensec); + } if ((pw = getpwuid(DIP(dp, di_uid)))) printf("OWNER=%s ", pw->pw_name);