Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

POSIX timer_create with SIGEV_THREAD

807567Apr 23 2003 — edited May 13 2003
I'm having trouble to get the timers working. Compiling is no problem, but I get a runtime error when I run the code (Code=22, Invalid argument).

Here is the code for creating the timer:

void timeoutHandler(union sigval arg)
{
// do something with arg.sival_ptr which should point to a function
}

void createTimer()
{
struct se sigevent;
se.sigev_notify = SIGEV_THREAD;
se.sigev_signo = SIGRTMIN;
se.sigev_value.sival_ptr = a_function_ptr; // pointer to function that should be passed to the thread routine (timeoutHandler)
se.sigev_notify_function = timeoutHandler;
timer_create(CLOCK_REALTIME, &se, &handle);
}

Does anyone know how to make this work?
I'm running on a Sparc station, Solaris 8, gcc-2.95.3.

Regards
sten.wallin@tietoenator.com
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2003
Added on Apr 23 2003
1 comment
1,475 views