All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] timer_create( ) invalid argument
@ 2015-08-27 21:40 Konstantinos Chalas
  2015-08-27 23:49 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantinos Chalas @ 2015-08-27 21:40 UTC (permalink / raw)
  To: xenomai

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;
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-28  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-27 21:40 [Xenomai] timer_create( ) invalid argument Konstantinos Chalas
2015-08-27 23:49 ` Gilles Chanteperdrix
2015-08-28  6:34   ` Philippe Gerum

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.