qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: Threads and win32


From: Teemu Nätkinniemi
Subject: [Qemu-devel] Re: Threads and win32
Date: Tue, 21 Jul 2009 06:22:41 -0700 (PDT)


> > Do the signal warnings make any sense??
> 
>   CC    i386-softmmu/vl.o
> vl.c: In function `qemu_cpu_kick':
> vl.c:3842: error: `SIGUSR1' undeclared (first use in this
> function)
> vl.c:3842: error: (Each undeclared identifier is reported
> only once
> vl.c:3842: error: for each function it appears in.)
> vl.c: In function `block_io_signals':
> vl.c:3859: error: storage size of 'sigact' isn't known
> vl.c:3861: warning: implicit declaration of function
> `sigemptyset'
> vl.c:3862: warning: implicit declaration of function
> `sigaddset'
> vl.c:3862: error: `SIGUSR2' undeclared (first use in this
> function)
> vl.c:3863: error: `SIGIO' undeclared (first use in this
> function)
> vl.c:3864: error: `SIGALRM' undeclared (first use in this
> function)
> vl.c:3865: warning: implicit declaration of function
> `pthread_sigmask'
> vl.c:3868: error: `SIGUSR1' undeclared (first use in this
> function)
> vl.c:3873: warning: implicit declaration of function
> `sigaction'
> vl.c:3859: warning: unused variable `sigact'
> vl.c: In function `unblock_io_signals':
> vl.c:3861: warning: redundant redeclaration of
> 'sigemptyset'
> vl.c:3861: warning: previous implicit declaration of
> 'sigemptyset' was here
> vl.c:3862: warning: redundant redeclaration of 'sigaddset'
> vl.c:3862: warning: previous implicit declaration of
> 'sigaddset' was here
> vl.c:3881: error: `SIGUSR2' undeclared (first use in this
> function)
> vl.c:3882: error: `SIGIO' undeclared (first use in this
> function)
> vl.c:3883: error: `SIGALRM' undeclared (first use in this
> function)
> vl.c:3865: warning: redundant redeclaration of
> 'pthread_sigmask'
> vl.c:3865: warning: previous implicit declaration of
> 'pthread_sigmask' was here
> vl.c:3887: error: `SIGUSR1' undeclared (first use in this
> function)
> vl.c: In function `qemu_signal_lock':
> vl.c:3896: error: `SIGUSR1' undeclared (first use in this
> function)
> vl.c: In function `pause_all_vcpus':
> vl.c:3937: error: `SIGUSR1' undeclared (first use in this
> function)
> vl.c: In function `resume_all_vcpus':
> vl.c:3959: error: `SIGUSR1' undeclared (first use in this
> function)
> make[1]: *** [vl.o] Error 1
> make: *** [subdir-i386-softmmu] Error 2

MinGW's signal support is very limited and it does not have these signals. One 
solution would be to use GnuWin32 support library 
(http://gnuwin32.sourceforge.net/) but I encounter following errors:

In file included from /mingw/lib/gcc/mingw32/../../../include/winx/signalx.h:5,
                 from D:/msys/src/qemu/vl.c:27:
/mingw/lib/gcc/mingw32/../../../include/winx/sys/signalx.h:57: error: expected 
specifier-qualifier-list before '__sigset_t'
/mingw/lib/gcc/mingw32/../../../include/winx/sys/signalx.h:64: error: expected 
specifier-qualifier-list before '__ptr_t'
/mingw/lib/gcc/mingw32/../../../include/winx/sys/signalx.h:72: error: expected 
specifier-qualifier-list before '__ptr_t'
D:/msys/src/qemu/vl.c: In function 'block_io_signals':
D:/msys/src/qemu/vl.c:3865: warning: implicit declaration of function 
'sigaddset'
D:/msys/src/qemu/vl.c:3868: warning: implicit declaration of function 
'pthread_sigmask'
D:/msys/src/qemu/vl.c:3876: warning: implicit declaration of function 
'sigaction'
D:/msys/src/qemu/vl.c: In function 'qemu_uuid_parse':
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: unknown conversion type character 'h' in 
format
D:/msys/src/qemu/vl.c:4664: warning: too many arguments for format
make[1]: *** [vl.o] Error 1
make: *** [subdir-i386-softmmu] Error 2

The actual include file winx/sys/signalx.h looks like this:

#ifndef __WINX_SYS_SIGNALX_H__
#define __WINX_SYS_SIGNALX_H__

#include <features.h>
#include <sys/types.h>
#include <bits/sigset.h>

/* Type of a signal handler.  */
typedef void (*__sighandler_t) (int);

#ifdef __USE_BSD
typedef __sighandler_t sig_t;
#endif

#  define SIGHUP      -1
#  define SIGQUIT     -3
#  define SIGTRAP     -5
#  define SIGIOT      -6
#  define SIGEMT      -7
#  define SIGKILL     -9
#  define SIGBUS      -10
#  define SIGSYS      -12
#  define SIGPIPE     -13
#  define SIGALRM     -14
#  define SIGURG      -16
#  define SIGSTOP     -17
#  define SIGTSTP     -18
#  define SIGCONT     -19
#  define SIGCHLD     -20
#  define SIGTTIN     -21
#  define SIGTTOU     -22
#  define SIGIO       -23
#  define SIGXCPU     -24
#  define SIGXFSZ     -25
#  define SIGVTALRM   -26
#  define SIGPROF     -27
#  define SIGWINCH    -28
#  define SIGLOST     -29
#  define SIGUSR1     -30
#  define SIGUSR2     -32

#define SIG_SETMASK 0   /* set mask with sigprocmask() */
#define SIG_BLOCK 1     /* set of signals to block */
#define SIG_UNBLOCK 2   /* set of signals to, well, unblock */

/* Type of a signal handler.  */
typedef void (*__sighandler_t) (int);

struct sigaction
  {
    /* Signal handler.  */
    __sighandler_t sa_handler;
    /* Additional set of signals to be blocked.  */
    __sigset_t sa_mask;
    /* Special flags.  */
    int sa_flags;
  };


/* Structure describing a signal stack (obsolete).  */
struct sigstack
  {
    __ptr_t ss_sp;       /* Signal stack pointer.  */
    int ss_onstack;      /* Nonzero if executing on this stack.  */
  };


/* Alternate, preferred interface.  */
typedef struct sigaltstack
  {
    __ptr_t ss_sp;
    size_t ss_size;
    int ss_flags;
  } stack_t;

/* POSIX sigsetjmp/siglongjmp macros */
#define sigjmp_buf jmp_buf

#define _SAVEMASK       _JBLEN
#define _SIGMASK        (_JBLEN+1)

/*
#define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
               sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
               setjmp (env))

#define siglongjmp(env, val) ((((env)[_SAVEMASK])?\
               sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 
0):0),\
               longjmp (env, val))


#define sigsetjmp(env, savemask) (1)
#define siglongjmp(env, val) (1)
*/
#ifndef sigemptyset
# define sigemptyset(s) (*(s) = 0)
#endif
#ifndef sigmask
# define sigmask(sig) (1 << ((sig) - 1))
#endif
/* # define sigaddset(s, sig) (*(s) |= sigmask (sig)) */

#endif /* __WINX_SYS_SIGNALX_H__ */

Teemu







reply via email to

[Prev in Thread] Current Thread [Next in Thread]