All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>,
	socketcan-users@domain.hid, Daniel Schnell <danielsch@domain.hid>
Subject: Re: [Socketcan-users] [Xenomai-help] Re: send error: permission	denied
Date: Tue, 22 Aug 2006 07:58:58 +0200	[thread overview]
Message-ID: <44EA9D22.5090301@domain.hid> (raw)
In-Reply-To: <44EA0DB4.1080302@domain.hid>

Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> Hi Daniel,
>>
>> Daniel Schnell wrote:
>>> Hi,
>>>
>>>  
>>>
>>> I am new to socket can.
>>>
>>>  
>>>
>>> I wanted to test the rtcan driver in combination with Linux and
>>> Xenomai and made a little program according to the rtcansend program
>>> but with some response time measurements.
>>>
>>>  
>>>
>>> However after setting up the socket I get –EPERM when trying to send a
>>> packet to the can device. As the documentation doesn’t state anything
>>> about this error when calling rt_dev_send() I wonder why the error if
>>> at all doesn’t appear earlier if I try to setup the socket. The test
>>> program already ran nicely when I tested the peak can drivers for
>>> linux. I just changed the driver specific calls.
>>>
>>>  
>>>
>>> Attached you find the complete test file, the function task() is the
>>> one to blame.
>>>
>>>  
>>>
>>> I am a bit stuck with this, so maybe someone can give me a slight hint
>>> in what i am doing wrong.
>> I tried your program on my system and got the same error. The problem
>> is, that rt_dev_send() is called from non-RT context, which is illegal.
> 
> ...but should not matter if the caller is a Xenomai thread in "Linux" mode.
> 
>> At a first glance, it's not obvious to me why. Therefore I added the
>> Xenomai Help ML to the CCs.
> 
> How did you all compile the program [1]? Using xeno-config
> --posix-cflags / --posix-ldflags?

No, ah, oh. It works using the above flags, indeed. I see, that it calls 
_rtdm_sendmsg in secondary execution mode (none-RT) first, which 
returned -ENOSYS (-38). Then I guess, the context is switch to primary 
mode and _rtdm_sendmsg is called again, correct?

> Jan
> 
> 
> PS: Daniel, if you go the POSIX way, you don't have to use rt_dev_, you
> can use the normal POSIX API directly. That services will be wrapped on
> the Xenomai core just like pthread&friends.

Cool. I was not yet aware of that.

> [1]https://lists.berlios.de/pipermail/socketcan-users/attachments/20060821/ff454f48/cantest_rt.obj

Thanks for clarifying things.

Wolfgang.



  reply	other threads:[~2006-08-22  5:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DD39B5C3F4963040ADC9768BE7E430CBFFAD9F@is-hdq-exchange.marel.net>
2006-08-21 19:28 ` [Xenomai-help] Re: [Socketcan-users] send error: permission denied Wolfgang Grandegger
2006-08-21 19:47   ` Jan Kiszka
2006-08-22  5:58     ` Wolfgang Grandegger [this message]
2006-08-22  6:39       ` [Socketcan-users] [Xenomai-help] " Jan Kiszka
2006-08-21 19:52   ` [Xenomai-help] Re: [Socketcan-users] " Sebastian Smolorz
     [not found] <DD39B5C3F4963040ADC9768BE7E430CBFFAEED@is-hdq-exchange.marel.net>
2006-08-22 10:29 ` [Socketcan-users] [Xenomai-help] Re: send error:permission denied Jan Kiszka

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=44EA9D22.5090301@domain.hid \
    --to=wg@domain.hid \
    --cc=danielsch@domain.hid \
    --cc=jan.kiszka@domain.hid \
    --cc=socketcan-users@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.