From: Jan Kiszka <jan.kiszka@domain.hid>
To: Wolfgang Grandegger <wg@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 08:39:00 +0200 [thread overview]
Message-ID: <44EAA684.3060506@domain.hid> (raw)
In-Reply-To: <44EA9D22.5090301@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2934 bytes --]
Wolfgang Grandegger wrote:
> 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?
>
Exactly, that's how it works.
>> 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.
Yes, and one should try to keep the sources clean (though mixing is
technically fine): either go native and pick real-time related services
from this API (would include task creation here) or go POSIX and use
only that API. If unsure about the status of some particular function,
see the docs or <xeno-installation>/lib/posix.wrappers for the list of
available bindings. (*)
>
>> [1]https://lists.berlios.de/pipermail/socketcan-users/attachments/20060821/ff454f48/cantest_rt.obj
>>
>
> Thanks for clarifying things.
>
> Wolfgang.
>
Jan
(*) Native has the charm of being more explicit ("This is hard-RT, any
other service not.") and sometimes more handy to use. POSIX is
standard, thus far easier portable. And it may already be well known
to the programmer.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-08-22 6:39 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 ` [Socketcan-users] [Xenomai-help] " Wolfgang Grandegger
2006-08-22 6:39 ` Jan Kiszka [this message]
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=44EAA684.3060506@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=danielsch@domain.hid \
--cc=socketcan-users@domain.hid \
--cc=wg@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.