Problems Creating POSIX Timers SIGEV_THREAD notification
Sam Lost
slostuk at gmail.com
Fri Dec 3 09:24:46 UTC 2010
I am having some problems with POSIX Timers under RTEMS.
I am currently evaluating the RTEMS Operating System to access it's
suitability.
I have a module written to the POSIX API I have been able to compile an run
the code under Linux and under a number of COTS RTOS's.
However I am unable to create a Timer using the timer_create() function
when setting event.sigev_notify = SIGEV_THREAD.
The following document has been unable to help as the timer_create
information is limited
http://www.rtems.com/onlinedocs/doc-current/share/rtems/pdf/posix_users.pdf
I notice from the following document:
http://www.rtems.com/onlinedocs/doc-current/share/rtems/pdf/posix1003_1.pdf
that the POSIX timer_create() function is implemented as opposed to a
partial implementation
Below is the section of code that I am attempting to run
{
ts_device_configuration *device_configuration =
device_configuration_table;
tGDEF_UINT8 loop_count = 0;
struct sigevent event = {0};
int status =
EERROR;
event.sigev_notify = SIGEV_THREAD;
event.sigev_notify_attributes = NULL;
event.sigev_signo = SIGALRM;
event.sigev_notify_function = device_alarm_signal_handler;
event.sigev_value.sival_ptr = (void*)device_configuration;
for(loop_count = 0; loop_count < DEVICE_TASK_NUMBER_OF_DEVICES_SUPPORTED;
loop_count++, device_configuration++)
{
/*lint --e(506) Constant value Boolean */
assert(device_configuration != NULL);
status = timer_create(CLOCK_REALTIME, &event,
&device_configuration->device_posix_timer_id);
if(status == EERROR)
{
(void)printf("Timer Create Error: %s\r\n",strerror(errno));
}
/*lint --e(792) void cast of void expression */
assert(status == EOK);
}
}
I receive a Invalid argument error number.
I noticed the following within the timer_create function (timercreate.c)
which appear to suggest that RTMES does not support SIGEV_THREAD
notification.
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
Am I missing something or is SIGEV_THREAD notification from POSIX timers not
supported?
Regards
Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20101203/92d7f52b/attachment.html>
More information about the users
mailing list