/* * Tru64 5.x */ #include #include #include #include #define DKTYPENAMES #define STANDALONE #include #include /* ./prtoc /dev/rdisk/dsk0c */ main(int argc, char ** argv) { int disk; struct fs *ufs; unsigned char b[DEV_BSIZE]; struct disklabel *label; short i; unsigned short sum, *word; if ( -1 == ( disk = open( argv[1], O_RDONLY ))) { perror(argv[1]); exit(1); } else { fprintf(stdout,"%d\tsizeof(*label)\n",sizeof(*label)); for (i=0; i<=LABELSECTOR; i++) { if ( sizeof(b) != read( disk, &b[0], sizeof(b) )) perror("read label"); } close(disk); label=(struct disklabel *)(&b[LABELOFFSET]); fprintf(stdout,"0x%X\td_magic (should be 0x%X)\n",label->d_magic,DISKMAGIC); fprintf(stdout,"%u\ttype (%s)\n",label->d_type,dktypenames[label->d_type]); } exit ( 0 ); }