All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Daniel Simon <Daniel.Simon@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Posix skin illegal seek on sem_wait
Date: Tue, 25 Apr 2006 18:04:53 +0200	[thread overview]
Message-ID: <17486.18597.13702.446671@domain.hid> (raw)
In-Reply-To: <20060425165423.7b7d231b@domain.hid>

Daniel Simon wrote:
 > Anyway, my threads are created with the SCHED_FIFO flag; may be there
 > is a conflict with main() which, as I understand, can be only a regular
 > thread?

A thread may only shadow itself, so, pthread_setschedparam has to be
called from the threads that need to be shadowed. Alternatively you may
pass scheduling parameters when pthread_create is called. Your threads
are not really created real-time, this is the reason why the Xenomai
posix skin services you call return an error of EPERM. Note however that
calling pthread_setschedparam is more portable than passing thread
creation attributes to pthread_create.

 > 
 > I notice that timer_settime(...) also returns an error (perror
 > says "Operation not permitted" while errno is set to 29 "illegal
 > seek", as for the sem_wait)
 > 

The reason why you see errno set to ESPIPE, is because you call perror
before printing errno, and perror seems to overwrite errno. In order to
access errno safely, you should store its value immediately after a
service returning an error.

Another issue is that signals sent by Xenomai posix skin are directed to
the thread that issued the call to timer_settime, regardless of threads
signal mask, so timer_settime should be moved to the clock_it()
thread.

A last issue is that pthread_sigmask errors are returned directly, and
not through errno.

-- 


					    Gilles Chanteperdrix.


      parent reply	other threads:[~2006-04-25 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25 11:43 [Xenomai-help] Posix skin illegal seek on sem_wait Daniel Simon
2006-04-25 13:44 ` Gilles Chanteperdrix
2006-04-25 14:54   ` Daniel Simon
2006-04-25 15:12     ` Gilles Chanteperdrix
2006-04-25 16:04     ` Gilles Chanteperdrix [this message]

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=17486.18597.13702.446671@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Daniel.Simon@domain.hid \
    --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.