All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Re: [Socketcan-users] Select on a RTCAN socket
       [not found] <DD39B5C3F4963040ADC9768BE7E430CB01081D6B@is-hdq-exchange.marel.net>
@ 2006-08-23 17:07 ` Wolfgang Grandegger
  2006-08-23 17:21   ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Grandegger @ 2006-08-23 17:07 UTC (permalink / raw)
  To: Daniel Schnell; +Cc: Haukur Hafsteinsson, xenomai-help, socketcan-users

Hi Daniel,

Daniel Schnell wrote:
> Hi,
> 
>  
> 
> I wanted to use select() on a socket to find out how many messages are 
> available. I have opened this socket to access the RTCAN sockets under 
> Xenomai. According to /usr/xenomai/lib/posix.wrappers select is not 
> “supported” by the realtime kernel. Accordingly it doesn’t work. If i 
> start the according task under SCHED_FIFO, the task simply hangs when 
> initiating select(), in SCHED_OTHER it is simply returning: bad file 
> descriptor.

select is not supported and cannot be used, indeed.

> Any ideas ? Is there any other way to find out, how many messages are 
> waiting ?

Select returns the sockets which have data but it does not tell you how 
many messages are waiting. You could use separate threads to read from 
sockets.

BTW: this mail is off-topic on the socketcan MLs.

Wolfgang.


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

* [Xenomai-help] Re: [Socketcan-users] Select on a RTCAN socket
  2006-08-23 17:07 ` [Xenomai-help] Re: [Socketcan-users] Select on a RTCAN socket Wolfgang Grandegger
@ 2006-08-23 17:21   ` Jan Kiszka
  2006-08-23 17:59     ` Wolfgang Grandegger
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2006-08-23 17:21 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: Haukur Hafsteinsson, xenomai-help, socketcan-users,
	Daniel Schnell

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

Hi all,

Wolfgang Grandegger wrote:
> Hi Daniel,
> 
> Daniel Schnell wrote:
>> Hi,
>>
>>  
>>
>> I wanted to use select() on a socket to find out how many messages are 
>> available. I have opened this socket to access the RTCAN sockets under 
>> Xenomai. According to /usr/xenomai/lib/posix.wrappers select is not 
>> "supported" by the realtime kernel. Accordingly it doesn't work. If i 
>> start the according task under SCHED_FIFO, the task simply hangs when 
>> initiating select(), in SCHED_OTHER it is simply returning: bad file 
>> descriptor.
> 
> select is not supported and cannot be used, indeed.

And select is tricky to provide under hard-RT constraints.

> 
>> Any ideas ? Is there any other way to find out, how many messages are 
>> waiting ?
> 
> Select returns the sockets which have data but it does not tell you how 
> many messages are waiting. You could use separate threads to read from 
> sockets.
> 
> BTW: this mail is off-topic on the socketcan MLs.

Mmh, do you mean it the other way around?

Anyway, is there a mechanism of the standard socket API the obtain the
current incoming queue length? Don't think so actually, but it wouldn't
be the first time I'm blind.

Jan


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

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

* [Xenomai-help] Re: [Socketcan-users] Select on a RTCAN socket
  2006-08-23 17:21   ` Jan Kiszka
@ 2006-08-23 17:59     ` Wolfgang Grandegger
  2006-08-23 18:19       ` Wolfgang Grandegger
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Grandegger @ 2006-08-23 17:59 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Haukur Hafsteinsson, xenomai-help, socketcan-users,
	Daniel Schnell

Jan Kiszka wrote:
> Hi all,
> 
> Wolfgang Grandegger wrote:
>> Hi Daniel,
>>
>> Daniel Schnell wrote:
>>> Hi,
>>>
>>>  
>>>
>>> I wanted to use select() on a socket to find out how many messages are 
>>> available. I have opened this socket to access the RTCAN sockets under 
>>> Xenomai. According to /usr/xenomai/lib/posix.wrappers select is not 
>>> "supported" by the realtime kernel. Accordingly it doesn't work. If i 
>>> start the according task under SCHED_FIFO, the task simply hangs when 
>>> initiating select(), in SCHED_OTHER it is simply returning: bad file 
>>> descriptor.
>> select is not supported and cannot be used, indeed.
> 
> And select is tricky to provide under hard-RT constraints.
> 
>>> Any ideas ? Is there any other way to find out, how many messages are 
>>> waiting ?
>> Select returns the sockets which have data but it does not tell you how 
>> many messages are waiting. You could use separate threads to read from 
>> sockets.
>>
>> BTW: this mail is off-topic on the socketcan MLs.
> 
> Mmh, do you mean it the other way around?

Well, I think this is a RTDM/Xenomai related questions and sending it to 
xenomai-help is OK. CAN related questions should go to the 
socketcan-users maling-list. Am I wrong?

> Anyway, is there a mechanism of the standard socket API the obtain the
> current incoming queue length? Don't think so actually, but it wouldn't
> be the first time I'm blind.

Not that I know of. For normal file I/O I remember vague some ioctl() or 
fnctl(). Does POSIX define a function for this purpose?

Wolfgang.



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

* [Xenomai-help] Re: [Socketcan-users] Select on a RTCAN socket
  2006-08-23 17:59     ` Wolfgang Grandegger
@ 2006-08-23 18:19       ` Wolfgang Grandegger
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Grandegger @ 2006-08-23 18:19 UTC (permalink / raw)
  To: xenomai-help
  Cc: Haukur Hafsteinsson, socketcan-users, Jan Kiszka, Daniel Schnell

Wolfgang Grandegger wrote:
> Jan Kiszka wrote:
>> Hi all,
>>
>> Wolfgang Grandegger wrote:
>>> Hi Daniel,
>>>
>>> Daniel Schnell wrote:
>>>> Hi,
>>>>
>>>>  
>>>>
>>>> I wanted to use select() on a socket to find out how many messages are 
>>>> available. I have opened this socket to access the RTCAN sockets under 
>>>> Xenomai. According to /usr/xenomai/lib/posix.wrappers select is not 
>>>> "supported" by the realtime kernel. Accordingly it doesn't work. If i 
>>>> start the according task under SCHED_FIFO, the task simply hangs when 
>>>> initiating select(), in SCHED_OTHER it is simply returning: bad file 
>>>> descriptor.
>>> select is not supported and cannot be used, indeed.
>> And select is tricky to provide under hard-RT constraints.
>>
>>>> Any ideas ? Is there any other way to find out, how many messages are 
>>>> waiting ?
>>> Select returns the sockets which have data but it does not tell you how 
>>> many messages are waiting. You could use separate threads to read from 
>>> sockets.
>>>
>>> BTW: this mail is off-topic on the socketcan MLs.
>> Mmh, do you mean it the other way around?
> 
> Well, I think this is a RTDM/Xenomai related questions and sending it to 
> xenomai-help is OK. CAN related questions should go to the 
> socketcan-users maling-list. Am I wrong?
> 
>> Anyway, is there a mechanism of the standard socket API the obtain the
>> current incoming queue length? Don't think so actually, but it wouldn't
>> be the first time I'm blind.
> 
> Not that I know of. For normal file I/O I remember vague some ioctl() or 
> fnctl(). Does POSIX define a function for this purpose?

Got it! In Linux it can be done with ioctl FIONREAD, which returns the 
number of bytes that are immediately available to be read on a file 
descriptor. It could be implemented, if useful.

Wolfgang.


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

end of thread, other threads:[~2006-08-23 18:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <DD39B5C3F4963040ADC9768BE7E430CB01081D6B@is-hdq-exchange.marel.net>
2006-08-23 17:07 ` [Xenomai-help] Re: [Socketcan-users] Select on a RTCAN socket Wolfgang Grandegger
2006-08-23 17:21   ` Jan Kiszka
2006-08-23 17:59     ` Wolfgang Grandegger
2006-08-23 18:19       ` Wolfgang Grandegger

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.