I must be missing something obvious here. I'm trying to call HPVOLINFO from
gcc. It's always returning status=(-151,163) which means unpaired itemnum or
itemptr.
HPVOLINFO doesn't appear to be an OPTION EXTENSIBLE function, so there shouldn't
be any hidden number of parameters argument. Actually, if I specify one, it
croaks badly with an unrecovered ESCAPE.
Here's my code; please tell me what I'm doing wrong:
#include <stdio.h>
#include <string.h>
#define _MPEXL_SOURCE
#include <errno.h>
int main(int argc, char **argv) {
short fserror, itemerror, itemnums[]={35,0};
char vsname[33], volspecifier[35];
long long lcapacity, lfreespace;
t_mpe_status status;
extern FLABELINFO(char *formaldesig, short mode, short *fserrorcode, short *iten
num, void *item, short *itemerror);
extern HPVOLINFO(t_mpe_status *status, short volspecifiernum, void *volspecifier
,
short itemnum1, void *itemptr1,
short itemnum2, void *itemptr2,
short itemnum3, void *itemptr3,
short itemnum4, void *itemptr4,
short itemnum5, void *itemptr5,
short itemnum6, void *itemptr6);
vsname[0] = '\0'; /* initialize the volumeset name to a null string */
/* Obtain the file's volumeset name */
FLABELINFO(argv[1],0,&fserror,(short *)&itemnums,&vsname,&itemerror);
if (fserror == 0) {
vsname[32] = '\0'; /* make it a legal C string */
sprintf(volspecifier," %s ",strtok(vsname," "));
/* Obtain the capacity and freespace */
HPVOLINFO(&status,2,&volspecifier,14,&lcapacity,40,&lfreespace,0,NULL,0,NULL,0
,NULL,0,NULL);
printf("HPVOLINFO status = (%hd, %hd)\n",status.decode.error_num,status.decode
.subsys_num);
}
}
--
Mark Bixby E-mail: [log in to unmask]
Coast Community College Dist. Web: http://www.cccd.edu/~markb/
District Information Services 1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support Voice: +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)
|