I finally got around to hacking up GNU find to know about
AFS and while trying to compile it under SunOS 4.1.2 got the following
error:
find.c: In function `is_afs':
find.c:164: `V' undeclared (first use this function)
find.c:164: (Each undeclared identifier is reported only once
find.c:164: for each function it appears in.)
After tracking down the macro calls I found the following afs/vice.h:
#if defined(AFS_HPUX_ENV) || defined(hpux) || defined(AFS_AIX31_ENV) || defined\
(_AIX) || defined(AFS_NEXT_ENV) || defined(NeXT) || defined(AFS_ULTRIX_40)
#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
#else
#define _VICEIOCTL(id) ((unsigned int ) _IOW(V, id, struct ViceIoctl))
#endif defined(AFS_HPUX_ENV) || defined(hpux)
It looks like the second #define is missing quotes around the V. After
fixing this GNU find compiled correctly. If that is the case then why have
the #else since both macros are the same? If that is not the case then where
is the function/macro for V?
Now about the AFS patch for GNU find (3.8):
o What does this patch add?
By default, AFS mountpoints are NOT traversed. In order to traverse
AFS mountpoints, you must give the "-afs" option or specify '-type m'.
The -noleaf option is on by default.
A new type 'm' has been added to the '-type' predicate. This predicate
returns true if a directory is an AFS mountpoint. This predicate
implies -afs.
o How do I compile GNU find with these features?
You should be able to give some options to configure, but I didn't
do that :-( First apply the patch.
Run configure.
Edit ./Makefile and add "-DDO_AFS" to the DEFS variable.
Edit ./find/Makefile and uncomment the lines that define
AFS_INCLUDES, AFS_LIB, and AFS_LIBS. Make sure AFS_INCLUDES
and AFS_LIB are correct for your system.
Type make.
You can find various things in:
/afs/ir.stanford.edu/src/gnu/find
patch.afs the patch file
find-afs the patched source
find-3.8 the original source
find.{next,dec,ibm,sun} binaries for NeXTstep 2.1, Ultrix 4.2a,
AIX 3.2.3, and SunOS 4.1.2.
Please let me know if there are any problems. I have tried to optimize
the amount of checks I make (thanks to some hints that Daniel
Edward Lovinger posted in alt.filesystems.afs ) and I think it is fairly
efficient.
Roland
--
Roland J. Schemers III | Networking Systems
Systems Programmer | 414 Sweet Hall +1 (415) 723-6740
Distributed Systems Operations | Stanford, CA 94305-3090
Stanford University | [EMAIL PROTECTED]