Re: Trying to build incron on Debian

From: <lukas_at_aiken.cz>
Date: Tue, 26 Aug 2008 00:08:24 +0200

I was doing a little bit larger inspection and found out that is is NOT
a compiler bug. It is caused by the fact that Debian has header files
(/usr/include/asm-i486/unistd.h etc.) which contain the syscall numbers
like __NR_inotify_init but there are no function prototypes for these
syscalls.

How to resolve this? I don't know. Yes, there is one way: to use
autotools or something similar for detecting the system environment. But
this leads to very complex solution and I would like to avoid it. Do you
have any better ideas? Thanks.

Lukas

> Hmmm, this seems to be a compiler bug. I made a test now (on Debian
> with GCC 4.1.2) and can confirm this error. Additionaly, it is
> probably the same as reported as the issue #0000114 which is still
> open. It occurs because "#ifdef __NR_inotify_init" is evaluated as
> "TRUE" but __NR_inotify_init (which defined the syscall number for
> inotify_init()) is really not defined at this point. As a work-around,
> you can remove or "comment" these conditional preprocessor directives
> and use only the line inside (#include <sys/inotify-syscalls.h>). This
> is the only way which can be done with this problem now.
>
> Lukas
>
>>
>> I am writing an article on inotify and tools based on its kernel
>> functions (inotify-tools, incron).
>>
>> I am trying to build incron on Debian 4.0, but get these errors after
>> installing inotify.h and inotify-syscalls.h in /usr/include/sys.
>>
>> server1% make
>> g++ -c -O2 -g0 -Wall -pipe -o icd-main.o icd-main.cpp
>> g++ -c -O2 -g0 -Wall -pipe -o incrontab.o incrontab.cpp
>> g++ -c -O2 -g0 -Wall -pipe -o inotify-cxx.o inotify-cxx.cpp
>> inotify-cxx.cpp: In member function ‘void
>> InotifyWatch::SetMask(uint32_t)’:
>> inotify-cxx.cpp:228: error: ‘inotify_add_watch’ was not declared in
>> this scope
>> inotify-cxx.cpp: In member function ‘void
>> InotifyWatch::SetEnabled(bool)’:
>> inotify-cxx.cpp:251: error: ‘inotify_add_watch’ was not declared in
>> this scope
>> inotify-cxx.cpp:259: error: ‘inotify_rm_watch’ was not declared in
>> this scope
>> inotify-cxx.cpp: In constructor ‘Inotify::Inotify()’:
>> inotify-cxx.cpp:297: error: ‘inotify_init’ was not declared in this
>> scope
>> inotify-cxx.cpp: In member function ‘void Inotify::Add(InotifyWatch*)’:
>> inotify-cxx.cpp:344: error: ‘inotify_add_watch’ was not declared in
>> this scope
>> inotify-cxx.cpp: In member function ‘void
>> Inotify::Remove(InotifyWatch*)’:
>> inotify-cxx.cpp:392: error: ‘inotify_rm_watch’ was not declared in
>> this scope
>> inotify-cxx.cpp: In member function ‘void Inotify::RemoveAll()’:
>> inotify-cxx.cpp:414: error: ‘inotify_rm_watch’ was not declared in
>> this scope
>>
>> Any ideas?
>>
>> Martin
>>
>
Received on Tue Aug 26 2008 - 00:08:52 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST