> Is there a good way to tell if AFS is loaded in the kernel? In
> particular a "setpag()" call seems to hang on a system without
> AFS installed. It would be nice if it just returned an error.
> Do I have to make some sort of pioctl check on /afs?
That would be nice. Here's our kluge method...
FILE * fp;
char * cptr = NULL;
char cell[AFS_CELLSIZE];
char somefile[PATH_MAX];
if ((fp = fopen(AFS_CELLFILE, "r")) != NULL) {
cptr = fgets(cell, sizeof(cell), fp);
fclose(fp);
}
if ((cptr == NULL) || (*cptr == '\0')) {
strcpy(cell, AFS_CELLNAME); /* assume our CELL */
} else {
cell[strlen(cell) - 1] = '\0'; /* kill '\n' */
}
sprintf(somefile, "/afs/%s/@sys", cell);
if (access(somefile, F_OK) == 0) {
setpag();
} else {
/* bitch and moan */
}
John