qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Posix timer syscalls [Bug 1042388]


From: Peter Maydell
Subject: Re: [Qemu-devel] Posix timer syscalls [Bug 1042388]
Date: Wed, 29 Aug 2012 10:57:27 +0100

On 29 August 2012 10:44, Erik de Castro Lopo <address@hidden> wrote:
> I'm having trouble struct sigevent pointer that is passed to
> timer_create() which is defined as:
>
>     typedef struct sigevent {
>         sigval_t sigev_value;
>         int sigev_signo;
>         int sigev_notify;
>         union {
>             int _pad[SIGEV_PAD_SIZE];
>             int _tid;
>
>             struct {
>                 void (*_function)(sigval_t);
>                 void *_attribute;       /* really pthread_attr_t */
>             } _sigev_thread;
>         } _sigev_un;
>     } sigevent_t;
>
> Any ideas on how to handle the union within this struct?

You need to look at how the kernel decides which of the
fields of the union is valid, and use the same logic to
decide how to convert it in qemu.

In this case I think that means that if
(sigev_notify & SIGEV_THREAD_ID) != 0, _tid is valid and
must be converted. Otherwise convert _sigev_thread.

-- PMM



reply via email to

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