All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] rt_task_bind() and timeout values
@ 2008-07-14 17:22 Stefan Kisdaroczi
  2008-07-14 17:50 ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kisdaroczi @ 2008-07-14 17:22 UTC (permalink / raw)
  To: xenomai


[-- Attachment #1.1: Type: text/plain, Size: 768 bytes --]

Hi all,

If I call rt_task_bind() with a timeout value other than TM_NONBLOCK or TM_INFINITE
it works not as expected (by me).

System: Debian Lenny with Xenomai 2.4.3 and Kernel 2.6.24.

The attached example calls 3 times rt_task_bind() for a nonexistent task:

1. dont wait: rt_task_bind(&task,"SomeTaskName",TM_NONBLOCK)
   -> returns -11 (EWOULDBLOCK) -> OK

2. wait 5 secs: rt_task_bind(&task,"SomeTaskName",5000000000LL);
   -> returns immediately -13 (EACCES) without waiting -> ?
   -> I expected ETIMEDOUT after 5 seconds

3. wait forever: rt_task_bind(&task,"SomeTaskName",TM_INFINITE);
   -> blocks a expected -> OK

I have the same problem with rt_queue_bind() calls.

Do i expect something wrong?

Thanks for your help!

kisda


[-- Attachment #1.2: bind_task.c --]
[-- Type: text/plain, Size: 780 bytes --]

#include <sys/mman.h>
#include <native/task.h>

RT_TASK mtask,task;

int main (int argc, char *argv[])

{
    int err;

    mlockall(MCL_CURRENT|MCL_FUTURE);

    err = rt_task_shadow(&mtask, NULL, 10, 0);

    if (err)
        fprintf(stderr,"rt_task_shadow failed, code %d\n",err);

    // 1. dont wait
    err = rt_task_bind(&task,"SomeTaskName",TM_NONBLOCK);

    if (err)
        fprintf(stderr,"bind (1) failed, code %d\n",err);

    // 2. wait 5 secs
    err = rt_task_bind(&task,"SomeTaskName",5000000000LL);

    if (err)
        fprintf(stderr,"bind (2) failed, code %d\n",err);

    // 3. wait forever
    err = rt_task_bind(&task,"SomeTaskName",TM_INFINITE);

    if (err)
        fprintf(stderr,"bind (3) failed, code %d\n",err);
}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

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

end of thread, other threads:[~2008-07-17 21:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-14 17:22 [Xenomai-help] rt_task_bind() and timeout values Stefan Kisdaroczi
2008-07-14 17:50 ` Philippe Gerum
2008-07-14 19:03   ` Stefan Kisdaroczi
2008-07-14 20:35     ` Philippe Gerum
2008-07-15  0:38       ` Stefan Kisdaroczi
2008-07-15  6:25         ` Philippe Gerum
2008-07-16 10:25           ` Stefan Kisdaroczi
2008-07-16 21:17             ` Philippe Gerum
2008-07-17 11:01               ` Stefan Kisdaroczi
2008-07-17 21:58                 ` Philippe Gerum
2008-07-15 14:28         ` Stefan Kisdaroczi

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.