here's my standard prolog for this sort of thing:
#include <stdio.h>
#include <sys/types.h> /* time_t */
#include <sys/dir.h> /* DIR */
#include <sys/stat.h> /* struct stat */
#include <netinet/in.h>
#include <sys/ioctl.h> /* for afs/vice.h */
#include <afs/vice.h> /* struct ViceIoctl */
/*#include <osi.h> /* for afs.h */
#include <afs/afsint.h> /* for afs.h */
#include <lock.h> /* for afs.h */
#include <sys/vnode.h> /* for afs.h */
#define KERNEL /* for afs.h */
#include <afs.h> /* struct fcache, VenusFid */
#undef KERNEL
blech.
peter