I downloaded the examped.c program and when I trying to compile it I
keep getting the following error message (since we don't have the C
compiler installed I had to use gcc compiler). The UNIX OS that I am
using is Sun 5.9
Start of error message
-----------------------------------------------------------------------------------------------------------------------------------------------------
In file included from
/tool/depot/cygnus-95q4/lib/gcc-lib/sparc-sun-solaris2.5/2.7-95q4/include/time.h:90,
from /usr/include/sys/time.h:418,
from /usr/include/sys/select.h:20,
from
/tool/depot/cygnus-95q4/lib/gcc-lib/sparc-sun-solaris2.5/2.7-95q4/include/sys/types.h:278,
from /usr/include/fcntl.h:23,
from examped.c:14:
/usr/include/sys/siginfo.h:74: syntax error before `pthread_attr_t'
In file included from
/tool/depot/cygnus-95q4/lib/gcc-lib/sparc-sun-solaris2.5/2.7-95q4/include/time.h:90,
from /usr/include/sys/time.h:418,
from /usr/include/sys/select.h:20,
from
/tool/depot/cygnus-95q4/lib/gcc-lib/sparc-sun-solaris2.5/2.7-95q4/include/sys/types.h:278,
from /usr/include/fcntl.h:23,
from examped.c:14:
/usr/include/sys/siginfo.h:284: syntax error before `int32_t'
/usr/include/sys/siginfo.h:415: syntax error before `int32_t'
-----------------------------------------------------------------------------------------------------------------------------------------------------
End of error message
I am essentially trying to build a daemon that can sense changes made
to a particular file and then do some actions based on the type of
change made to that file.
Any help in this matter is greatly appreciated.
Thanks,
NS
If you get syntax errors in system include files, it probably means
that you forgot to include a prerequesite include file FIRST that
defines some typedefs. <sys/types.h> is often a prerequesite for <sys/*.h>.
What include file defines int32_t (<inttypes.h>?) and pthread_attr_t?
Gordon L. Burditt
http://www.opengroup.org/onlinepubs/000095399/basedefs/stdint.h.html
> and pthread_attr_t?
http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html
Start of error message
--------------------------------------------------------------------------------
examped.c:17: stdint.h: No such file or directory
--------------------------------------------------------------------------------
End of error message
Does this mean that I don't have the stdint.h file or am I not
including any prerequisites?
Thanks and really appreciate your help.
Thanks,
NS
#include </usr/include/sys/types.h>
#include </usr/include/sys/int_types.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
Now I am trying to see if I create my own daemon program based on this
example.
As I mentioned earlier, what I am trying to do is to create a daemon
that will watch a specific file and upon any edits to that file, the
daemon will spawn a child process to execute certain tasks based on the
type of modification done the file and then report back to the daemon
server.
Since I am very new to writing daemons, if you could give me some
pointers or examples on how to achieve what I described, it would have
great help.
Thanks again,
NS