From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Konstantinos Chalas <konchalas@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] timer_create( ) invalid argument
Date: Fri, 28 Aug 2015 01:49:40 +0200 [thread overview]
Message-ID: <20150827234940.GE20679@hermes.click-hack.org> (raw)
In-Reply-To: <55DF83E0.1060006@gmail.com>
On Thu, Aug 27, 2015 at 11:40:48PM +0200, Konstantinos Chalas wrote:
> Hello,
>
> I have been trying to port some code from the Linux Kernel to the Cobalt
> Kernel, with no success.
>
> When trying to call timer_create( ), i am getting the error timer_create:
> Invalid argument
>
> I made the code snippet as small as possible.
>
> #include <time.h>
> #include <signal.h>
> #include <stdio.h>
>
> void timerfunction(union sigval handler)
> {
> printf("timerfunction hello\n");
> }
>
> int main(int argc, char** argv)
> {
> timer_t t;
>
> struct sigevent se;
>
> se.sigev_value.sival_ptr = 0;
> se.sigev_signo = 0;
> se.sigev_notify = SIGEV_THREAD_ID;
>
> se.sigev_notify_attributes = 0;
> se.sigev_notify_function = timerfunction;
>
> if (timer_create(CLOCK_REALTIME, &se, &t) != 0) {
> perror("timer_create");
> }
> return 0;
> }
I never tried using SIGEV_THREAD_ID with Xenomai, but I would expect
a valid thread id to be required when doing this.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2015-08-27 23:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-27 21:40 [Xenomai] timer_create( ) invalid argument Konstantinos Chalas
2015-08-27 23:49 ` Gilles Chanteperdrix [this message]
2015-08-28 6:34 ` Philippe Gerum
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=20150827234940.GE20679@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=konchalas@gmail.com \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.