Re: [AVFS] avfs cvs compile

Peter <[email protected]> Fri, 30 Apr 2004 05:50:49 -0400
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <[email protected]>
In case I was not clear, I use kernel 2.6.5 on Slackware 9.1.

Adam was nice enough to write me the following:

Peter,

> Well, I also downloaded the AFVS tarball and tried to compile. The file is
> ancient -- from 2002, and I could not compile it due to missing/outdated
> headers. If anyone has had success with this, I would appreciate knowing.
> For now, the entire exercise is on hold.

Nick Mitchell had posted this a while back.  Should be what you're
looking for:
---

This is a hack to get AVFS to compile if you get the following errors
 when you try to do so:
 
 /usr/include/linux/time.h:9: error: redefinition of `struct timespec"
 /usr/include/linux/time.h:15: error: redefinition of `struct timeval"
 make[1]: *** [mount.o] Error 1
 
 Hack is edit out the following lines from time.h in /usr/include/linux
 
 #ifndef _STRUCT_TIMESPEC
 #define _STRUCT_TIMESPEC
 struct timespec {
        time_t  tv_sec;         /* seconds */
        long    tv_nsec;        /* nanoseconds */
 };
 #endif /* _STRUCT_TIMESPEC */
 
 struct timeval {
        time_t          tv_sec;         /* seconds */
        suseconds_t     tv_usec;        /* microseconds */
 };
 
 do something like
 
 //#ifndef _STRUCT_TIMESPEC
 //#define _STRUCT_TIMESPEC
 //struct timespec {
 //     time_t  tv_sec;         /* seconds */
 //     long    tv_nsec;        /* nanoseconds */
 //};
 //#endif /* _STRUCT_TIMESPEC */
 
 //struct timeval {
 //     time_t          tv_sec;         /* seconds */
 //     suseconds_t     tv_usec;        /* microseconds */
 //};
 
 Build avfs according to its install instructions.
 Return time.h to its previous, unedited state.
 Once avfs installed ROX has got its icing plus some cherries.
 
 This will stop the header conflicts that are causing AVFS compile to
 drop out.
 
 The probelm is not confined to SUSE 9 or kernel 2.4.21 but is due to
 some libc distributions including the linux header files it was built
 with and the conflicts not being taken care of.
 Hope this saves some other poor sap seveal hours of digging.
 
 Regards
 
 Nick
-----------------

I did this, but also found it necessary to comment out the structs timezone,
itimerspec and itimerval at lines 20, 354, and 359 of time.h as well.

After this, compile STILL failed in dispatch.c at line 322 and the following
error output was emitted:

dispatch.c:322: syntax error before '*' token
dispatch.c: In function `look_info':
dispatch.c:326: `id' undeclared (first use in this function)
dispatch.c:326: (Each undeclared identifier is reported only once
dispatch.c:326: for each function it appears in.)
dispatch.c: At top level:
dispatch.c:348: syntax error before '*' token
dispatch.c: In function `look_name':
dispatch.c:352: `id' undeclared (first use in this function)
dispatch.c: At top level:
dispatch.c:361: syntax error before '*' token
dispatch.c: In function `ref_fid':
dispatch.c:363: `fid' undeclared (first use in this function)
dispatch.c: At top level:
dispatch.c:369: syntax error before '*' token
dispatch.c: In function `unref_fid':
dispatch.c:371: `fid' undeclared (first use in this function)
dispatch.c: At top level:
dispatch.c:401: syntax error before "ViceFid"
dispatch.c: In function `create_file':
dispatch.c:406: `parentid' undeclared (first use in this function)
dispatch.c:409: `filename' undeclared (first use in this function)
dispatch.c:411: `newid' undeclared (first use in this function)
dispatch.c: In function `purge_file':
dispatch.c:430: structure has no member named `Volume'
dispatch.c:431: structure has no member named `Vnode'
dispatch.c:432: structure has no member named `Unique'
dispatch.c: In function `zap_file':
dispatch.c:449: structure has no member named `Volume'
dispatch.c:450: structure has no member named `Vnode'
dispatch.c:451: structure has no member named `Unique'
dispatch.c: At top level:
dispatch.c:585: syntax error before "ViceFid"
dispatch.c: In function `close_file':
dispatch.c:588: `of' undeclared (first use in this function)
dispatch.c:594: `ofp' undeclared (first use in this function)
dispatch.c:596: `fid' undeclared (first use in this function)
dispatch.c: In function `process_answer':
dispatch.c:684: warning: long int format, u_int32_t arg (arg 4)
dispatch.c:684: warning: long int format, u_int32_t arg (arg 6)
dispatch.c:694: warning: long int format, u_int32_t arg (arg 2)
dispatch.c:822: warning: long int format, u_int32_t arg (arg 2)
dispatch.c: In function `send_to_child':
dispatch.c:1061: structure has no member named `cred'
dispatch.c:1062: structure has no member named `cred'
dispatch.c:1112: warning: long int format, u_int32_t arg (arg 2)
dispatch.c: At top level:
dispatch.c:1143: syntax error before "ViceFid"
dispatch.c: In function `send_with_path':
dispatch.c:1149: `id' undeclared (first use in this function)
dispatch.c:1151: `req' undeclared (first use in this function)
dispatch.c:1157: `filename' undeclared (first use in this function)
dispatch.c:1159: `path2' undeclared (first use in this function)
dispatch.c:1165: `reqsize' undeclared (first use in this function)
dispatch.c: In function `process_kernel_req':
dispatch.c:1242: warning: long int format, u_int32_t arg (arg 3)
dispatch.c:1242: warning: long int format, u_int32_t arg (arg 4)
dispatch.c:1251: structure has no member named `Volume'
dispatch.c:1252: structure has no member named `Vnode'
dispatch.c:1253: structure has no member named `Unique'
dispatch.c:1315: structure has no member named `cred'
dispatch.c:1315: structure has no member named `cred'
make[1]: *** [dispatch.o] Error 1
make[1]: Leaving directory `/mnt/src/avfs/avfscoda'
make: *** [all] Error 2

Unfortunately, I believe the significant changes to header structure in the
2.6.x kernel has caused many problems -- not just with dispatch.c!



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click