On 29 August 2012 10:44, Erik de Castro Lopo <mle+to...@mega-nerd.com> 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