Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!anchor!olson From: olson@anchor.esd.sgi.com (Dave Olson) Newsgroups: comp.sys.sgi Subject: Re: About the volume header: one solution Message-ID: <1991Feb22.042038.26946@odin.corp.sgi.com> Date: 22 Feb 91 04:20:38 GMT References: <9102212115.AA20052@koko.pdi.com> Sender: news@odin.corp.sgi.com (Net News) Organization: Silicon Graphics, Inc. Mountain View, CA Lines: 43 In <9102212115.AA20052@koko.pdi.com> shoshana@pdi.UUCP (Shoshana Abrass) writes: | Dave Olsen (olson@anchor.esd.sgi.com) writes: | >> You could simply get the file out with 'dvhtool -v g vhfile file' | >> if you are doing a shell script. Otherwise look at sys/dkio.h | >> and sys/dvh.h. | | I am *not* writing a shell script. I must have sounded *really* stupid. | Why would I write a shell script to replace hinv? Anyway, I will People do all kinds of things for various reasons. It isn't necessarily stupid to use a shell script. Often it is the appropriate answer. Sorry, I didn't mean to sound patronizing; I guess I've spent a bit too much time on the phone lately with people with people who had a different base understanding of the situation than I had... | read_partition_table(char* file) <=== "file" is a disk path | { e.g., /dev/rdsk/dks0d1vh | | int fd; | struct volume_header *buf; | | buf = (struct volume_header *)malloc(512);<=== Seems like there should be | some explanation of how | this number was calculated What is wrong with buf = (struct volume_header *)malloc(sizeof *buf); Seems pretty self documenting to me. Why would one ever hard code a constant for something like this!?! Of course, the fact that I copied some old comments and stupidly embedded the constant 512 in the dksc.7 man page couldn't have anything to do with it, could it? :) I'll fix the man page. -- Dave Olson Life would be so much easier if we could just look at the source code. Brought to you by Super Global Mega Corp .com