From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6f1i-000663-BQ for qemu-devel@nongnu.org; Wed, 29 Aug 2012 05:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6f1c-0003zJ-9P for qemu-devel@nongnu.org; Wed, 29 Aug 2012 05:57:34 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:60793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6f1c-0003z9-54 for qemu-devel@nongnu.org; Wed, 29 Aug 2012 05:57:28 -0400 Received: by iakx26 with SMTP id x26so711647iak.4 for ; Wed, 29 Aug 2012 02:57:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120829194430.0cec30cc66e47d679a4bc8c9@mega-nerd.com> References: <20120829194430.0cec30cc66e47d679a4bc8c9@mega-nerd.com> Date: Wed, 29 Aug 2012 10:57:27 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] Posix timer syscalls [Bug 1042388] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 29 August 2012 10:44, Erik de Castro Lopo 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