> I'm writing some code which uses the AFS header files and libraries. The
> header files make extensive use of the _IOW define from the system header
> files. I've found that on the solaris machine (but not the hp, rs6k or sunos
> machine), I have to include sys/ioccom.h to get the _IOW definition. On all
> the other platforms the AFS include files end up getting the right definition.
The AFS source code is programmed for BSD systems, hence, it uses BSD
specific features. _IOW is such a feature. The Solaris system header files
conditionally include BSD stuff if you define the value BSD_COMP.
Therefore your code should look something like this:
/* Set variable so that BSD stuff is included ... */
#define BSD_COMP
#include <afs/afsint.h>
#include <netinet/in.h>
#include <afs/venus.h>
main() {
struct ViceIoctl param;
char space[2048];
param.out = space;
param.out_size = sizeof(space);
param.in_size = 0;
return pioctl("/afs/pdx.intel.com", VIOCGETVOLSTAT, ¶m, 1);
}
BTW: If you try to generate libraries for use of AFS routines, you may
run into problems, because some AFS include files define variables.
This may lead to doubly defined symbol errors.
-Peter