Subject: signalvar.h - compilation problem
To: None <netbsd-users@netbsd.org>
From: Florian Stoehr <netbsd@wolfnode.de>
List: netbsd-users
Date: 02/18/2005 14:50:34
Hi,

I try to compile ettercap (non-pkgsrc)

It fails in /usr/include/sys/signalvar.h - and I have no idea why:

In file included from /usr/include/sys/proc.h:52,
                  from /usr/include/sys/sysctl.h:46,
                  from ec_bsd.c:25:
/usr/include/sys/signalvar.h:69: error: parse error before "CIRCLEQ_HEAD"
/usr/include/sys/signalvar.h:83: error: parse error before '}' token
In file included from /usr/include/sys/sysctl.h:46,
                  from ec_bsd.c:25:
/usr/include/sys/proc.h:239: error: field `p_sigctx' has incomplete type
gmake: *** [libec_os_a-ec_bsd.o] Error 1


The corresponding code in signalvar.h is

/*
  * Process signal state.
  */
struct sigctx {
 	/* This needs to be zeroed on fork */
 	sigset_t ps_siglist;		/* Signals arrived but not 
delivered. */
 	char	ps_sigcheck;		/* May have deliverable signals. 
*/
 	struct ksiginfo *ps_sigwaited;	/* Delivered signal from wait set 
*/
 	const sigset_t *ps_sigwait;	/* Signals being waited for */
 	struct simplelock ps_silock;	/* Lock for ps_siginfo */
###Line 69###	CIRCLEQ_HEAD(, ksiginfo) ps_siginfo;/* for SA_SIGINFO */

 	/* This should be copied on fork */
#define	ps_startcopy	ps_sigstk
 	struct	sigaltstack ps_sigstk;	/* sp & on stack state variable */
 	sigset_t ps_oldmask;		/* saved mask from before sigpause 
*/
 	int	ps_flags;		/* signal flags, below */
 	int	ps_signo;		/* for core dump/debugger XXX */
 	int	ps_code;		/* for core dump/debugger XXX */
 	int	ps_lwp;			/* for core dump/debugger XXX */
 	void	*ps_sigcode;		/* address of signal trampoline */
 	sigset_t ps_sigmask;		/* Current signal mask. */
 	sigset_t ps_sigignore;		/* Signals being ignored. */
 	sigset_t ps_sigcatch;		/* Signals being caught by user. 
*/
###Line 83###};


a gcc run with -E shows that the CIRCLEQ_HEAD(, ksiginfo) did NOT expand - 
strange, this shoud be a macro; Here's the gcc -E output:

struct sigctx {

         sigset_t ps_siglist;
         char ps_sigcheck;
         struct ksiginfo *ps_sigwaited;
         const sigset_t *ps_sigwait;
         struct simplelock ps_silock;
         CIRCLEQ_HEAD(, ksiginfo) ps_siginfo;



         struct sigaltstack ps_sigstk;
         sigset_t ps_oldmask;
         int ps_flags;
         int ps_signo;
         int ps_code;
         int ps_lwp;
         void *ps_sigcode;
         sigset_t ps_sigmask;
         sigset_t ps_sigignore;
         sigset_t ps_sigcatch;
};

Being confuesd..

Thanks for help.
Florian