All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Sambasiva Rao Manchili <sambasiva.manchili@domain.hid>
Cc: Antonio Gambin <antonio.gambin@domain.hid>,
	"Xenomai-help@domain.hid" <Xenomai-help@domain.hid>
Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake
Date: Wed, 03 Aug 2011 17:19:09 +0200	[thread overview]
Message-ID: <4E3966ED.1030408@domain.hid> (raw)
In-Reply-To: <509DA52866E38F47878413CF102D751FD4207794FA@poseidon.nexus-ag.com>

On 08/03/2011 04:24 PM, Sambasiva Rao Manchili wrote:
> You want printErrno instead of strerror.
> 
>>> Samba: In the beginning days of our code porting from VxWorks to
>>> Linux,  Xenomai failed to create message Queue  that was working
>>> on VxWorks. When xenomai failed to create message queue it
>>> returned 0x110001===>1114113. After reading the Xenomai code a
>>> bit I understood it is S_memLib_NOT_ENOUGH_MEMORY. I therefore
>>> reduced the Queue size by 5 times and it was then successful.
>>> The way I extracted the errno in beginning days is same as I did
>>> today. So I epxected a value which >>tells the actual reason of
>>> semTake failure. But I got this huge value which is -1.  Am I
>>> missing something ?
> 

The thing is printErrno is a xenomai posix skin function which knows
S_memlib_NOT_ENOUGH_MEMORY, strerror is an unrelated glibc function, and
does not.

What you are missing is this comment in ksrc/skins/vxworks/syscall.c
/*
 * By convention, error codes are passed back through the syscall
 * return value:
 * - negative codes stand for internal (i.e. nucleus) errors;
 * - strictly positive values stand for genuine VxWorks errors.
 * - zero means success.
 *

Looking at the code, I think after a service returns an error, it may be
more reliable to use errno than to use errnoOfTaskGet.

> 1 is EPERM. Is the thread issuing the call a thread created by
> Xenomai?
> 
>>> Samba: Yes. I guess taskSpawn leads finally to Xenomai libraries
>>> to create thread.  All  our VxWorks code(with minor changes) as
>>> it is running on top of Xenomai. Please tell me,  What will you
>>> suggest me then ?

Trace the kernel code to know the reason for semTake to return -EPERM.
Another reason documented in txt/vxworks/skin.txt maybe that you are
calling semTake in a region where the scheduler has been locked (using
taskLock).

NOTE: it would be nice if you could formats your mails as everybody
does: quote the mail you reply to by prepending " >" to the beginning of
the lines you are quoting, and do not put ">" characters in front of the
lines you add.

-- 
					    Gilles.


  reply	other threads:[~2011-08-03 15:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 10:15 [Xenomai-help] Xenomai VxWorks Skin--->semTake Sambasiva Rao Manchili
2011-08-03 11:27 ` Philippe Gerum
2011-08-03 12:44   ` Sambasiva Rao Manchili
2011-08-03 13:17     ` Gilles Chanteperdrix
2011-08-03 13:31       ` Sambasiva Rao Manchili
2011-08-03 13:53         ` Philippe Gerum
2011-08-03 14:30           ` Sambasiva Rao Manchili
2011-08-03 14:40             ` Philippe Gerum
2011-08-03 14:03         ` Gilles Chanteperdrix
2011-08-03 14:24           ` Sambasiva Rao Manchili
2011-08-03 15:19             ` Gilles Chanteperdrix [this message]
2011-08-05  6:48               ` Sambasiva Rao Manchili

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=4E3966ED.1030408@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Xenomai-help@domain.hid \
    --cc=antonio.gambin@domain.hid \
    --cc=sambasiva.manchili@domain.hid \
    /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.