qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Erik de Castro Lopo <mle+tools@mega-nerd.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Posix timer syscalls [Bug 1042388]
Date: Wed, 29 Aug 2012 19:44:30 +1000	[thread overview]
Message-ID: <20120829194430.0cec30cc66e47d679a4bc8c9@mega-nerd.com> (raw)

Hi all,

I've spent some time messing about in linux-user/syscall.c and I have
stubs for all 5 posix timer syscalls:

    int timer_create(clockid_t clockid, struct sigevent *sevp,
                     timer_t *timerid);

    int timer_settime(timer_t timerid, int flags,
                      const struct itimerspec *new_value,
                      struct itimerspec * old_value);

    int timer_gettime(timer_t timerid, struct itimerspec *curr_value);

    int timer_getoverrun(timer_t timerid);

    int timer_delete(timer_t timerid);

Obviously all these parameters need to be converted between host and
target. I've already found struct target_itimerspec in
linux-user/syscall_defs.h and that looks like it will be useful.

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?

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/

             reply	other threads:[~2012-08-29  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29  9:44 Erik de Castro Lopo [this message]
2012-08-29  9:57 ` [Qemu-devel] Posix timer syscalls [Bug 1042388] Peter Maydell
2012-08-29 10:03   ` Erik de Castro Lopo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120829194430.0cec30cc66e47d679a4bc8c9@mega-nerd.com \
    --to=mle+tools@mega-nerd.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).