I am trying to use gamin instead of FAM on FC2 (I have SELinux enabled) and a FAM application (OMake - http://omake.metaprl.org/) that I need to run does not work. I am using a result of "rpmbuild --rebuild" on http://www.gnome.org/~veillard/gamin/SRPMS/gamin-0.0.10-1.src.rpm When I build omake, I get: omake.a(omake_cnotify.o)(.text+0x11e): In function `om_notify_suspend': /home/aleksey/metaprl/omake/omake_cnotify.c:180: undefined reference to `FAMSuspendMonitor' omake.a(omake_cnotify.o)(.text+0x15a): In function `om_notify_resume': /home/aleksey/metaprl/omake/omake_cnotify.c:197: undefined reference to `FAMResumeMonitor' collect2: ld returned 1 exit status Error during linking If I try to use a binary that is compiled against the "real" FAM, I get omake: Symbol `FamErrlist' has different size in shared object, consider re-linking and then it runs fine (which I do not understand - nm on the binary does show these symbols with a "U").
Okay to get an idea of the FAM crappyness, see from the fam-2.6.10 sources include/fam.h (it's the latest version we ever shipped): -------------------------------------- /***************************************************************************** * ERROR HANDLING * * If an error occurs inside of libfam, a global named FAMErrno is set * to a non-zero value and the routine that the error occurred in will * return an error value (usually NULL). FAMErrlist is a global * string array (indexed by FAMErrno) that describes the last error * that happened; * * NOTE: currently FAMErrno and FamErrList are unused *****************************************************************************/ extern int FAMErrno; extern char *FamErrlist[]; /* *[NOTE: Eventually, there will be a bunch of defines right here defining what * errors can happen in using libfam ] */ -------------------------------------- I.e. basically thy put unimplemented work in progress API definitions in the public headers, with an object which size could not be defined clearly. I doubt there is any way to avoid the size message. The good point is that nobody (except your program apparently uses those). For FAMSuspendMonitor() and FAMResumeMonitor() they look very dubious to me from a semantic perspective, only an event lossy implementation makes any sense to me, that's why I didn't put an implementation yet. I could at least put an entry point returning -1 and signalling it's not implemented. Accepted, Daniel
Actually, in omake, the calls to FAM{Suspend,Resume} are there so that the FAM API in OCaml is complete. However, we never call the functions. I agree, they are dubious, and the better plan is probably just to delete them from omake. We use FamErrlist[] in the hope that someday we will get sensible error messages. I'm not sure of the corresponding error mechanism in gamin, but it sure would be nice to get proper error reporting. For our Win32 FAM-like implementation, the FAMErrno is set properly, so we actually get better error reporting on Win32 than Linux:/ Jason
The current versions in rawhide should fix that bug (0.0.14). I made sure FAMErrno is set on errors, provided strings (not localized though) and provided entry points for FAM{Suspend,Resume} returning a non-implemented status. Daniel