All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] using mq_receive and mq_send
@ 2005-11-30 13:46 Landau, Bracha
  2005-11-30 14:00 ` Philippe Gerum
  0 siblings, 1 reply; 7+ messages in thread
From: Landau, Bracha @ 2005-11-30 13:46 UTC (permalink / raw)
  To: xenomai

I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.

I've created an application that uses posix message queuing from xenomai.

When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.

When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).

I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).

Can anyone help?

Thanks,
Bracha

***********************************************************************************
This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@domain.hid and destroy the original message.
***********************************************************************************


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

* Re: [Xenomai-help] using mq_receive and mq_send
  2005-11-30 13:46 Landau, Bracha
@ 2005-11-30 14:00 ` Philippe Gerum
  0 siblings, 0 replies; 7+ messages in thread
From: Philippe Gerum @ 2005-11-30 14:00 UTC (permalink / raw)
  To: Landau, Bracha; +Cc: xenomai

Landau, Bracha wrote:
> I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.
> 
> I've created an application that uses posix message queuing from xenomai.
> 
> When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.
> 
> When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).
> 
> I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).
> 
> Can anyone help?
> 

You must link your app with the flags output by "xeno-config 
--posix-ldflags". Have a look at skins/posix/demos/Makefile for a 
working example.

-- 

Philippe.


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

* RE: [Xenomai-help] using mq_receive and mq_send
@ 2005-11-30 14:25 Landau, Bracha
  2005-11-30 14:36 ` Philippe Gerum
  0 siblings, 1 reply; 7+ messages in thread
From: Landau, Bracha @ 2005-11-30 14:25 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

I do link that way. The linking is fine, only the mq_receive and mq_send don't work. I don't even "own" the regular libmqueue library.

-----Original Message-----
From: Philippe Gerum [mailto:rpm@xenomai.org]
Sent: Wednesday, November 30, 2005 4:01 PM
To: Landau, Bracha
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] using mq_receive and mq_send


Landau, Bracha wrote:
> I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.
> 
> I've created an application that uses posix message queuing from xenomai.
> 
> When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.
> 
> When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).
> 
> I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).
> 
> Can anyone help?
> 

You must link your app with the flags output by "xeno-config 
--posix-ldflags". Have a look at skins/posix/demos/Makefile for a 
working example.

-- 

Philippe.
***********************************************************************************
This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@domain.hid and destroy the original message.
***********************************************************************************


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

* Re: [Xenomai-help] using mq_receive and mq_send
  2005-11-30 14:25 Landau, Bracha
@ 2005-11-30 14:36 ` Philippe Gerum
  0 siblings, 0 replies; 7+ messages in thread
From: Philippe Gerum @ 2005-11-30 14:36 UTC (permalink / raw)
  To: Landau, Bracha; +Cc: xenomai

Landau, Bracha wrote:
> I do link that way. The linking is fine, only the mq_receive and mq_send don't work. I don't even "own" the regular libmqueue library.
>

What does "nm <your_app>|grep wrap_mq_" says?

> -----Original Message-----
> From: Philippe Gerum [mailto:rpm@xenomai.org]
> Sent: Wednesday, November 30, 2005 4:01 PM
> To: Landau, Bracha
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] using mq_receive and mq_send
> 
> 
> Landau, Bracha wrote:
> 
>>I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.
>>
>>I've created an application that uses posix message queuing from xenomai.
>>
>>When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.
>>
>>When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).
>>
>>I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).
>>
>>Can anyone help?
>>
> 
> 
> You must link your app with the flags output by "xeno-config 
> --posix-ldflags". Have a look at skins/posix/demos/Makefile for a 
> working example.
> 


-- 

Philippe.


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

* RE: [Xenomai-help] using mq_receive and mq_send
@ 2005-11-30 15:42 Landau, Bracha
  2005-11-30 15:44 ` Jan Kiszka
  0 siblings, 1 reply; 7+ messages in thread
From: Landau, Bracha @ 2005-11-30 15:42 UTC (permalink / raw)
  To: Philippe Gerum, xenomai

it says:
         U __wrap_mq_close
         U __wrap_mq_open
         U __wrap_mq_receive
         U __wrap_mq_send
         U __wrap_mq_unlink

-----Original Message-----
From: Philippe Gerum [mailto:rpm@xenomai.org]
Sent: Wednesday, November 30, 2005 4:37 PM
To: Landau, Bracha
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] using mq_receive and mq_send


Landau, Bracha wrote:
> I do link that way. The linking is fine, only the mq_receive and mq_send don't work. I don't even "own" the regular libmqueue library.
>

What does "nm <your_app>|grep wrap_mq_" says?

> -----Original Message-----
> From: Philippe Gerum [mailto:rpm@xenomai.org]
> Sent: Wednesday, November 30, 2005 4:01 PM
> To: Landau, Bracha
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] using mq_receive and mq_send
> 
> 
> Landau, Bracha wrote:
> 
>>I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.
>>
>>I've created an application that uses posix message queuing from xenomai.
>>
>>When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.
>>
>>When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).
>>
>>I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).
>>
>>Can anyone help?
>>
> 
> 
> You must link your app with the flags output by "xeno-config 
> --posix-ldflags". Have a look at skins/posix/demos/Makefile for a 
> working example.
> 


-- 

Philippe.
***********************************************************************************
This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@domain.hid and destroy the original message.
***********************************************************************************


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

* Re: [Xenomai-help] using mq_receive and mq_send
  2005-11-30 15:42 [Xenomai-help] using mq_receive and mq_send Landau, Bracha
@ 2005-11-30 15:44 ` Jan Kiszka
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kiszka @ 2005-11-30 15:44 UTC (permalink / raw)
  To: Landau, Bracha; +Cc: xenomai-help

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

Landau, Bracha wrote:
> it says:
>          U __wrap_mq_close
>          U __wrap_mq_open
>          U __wrap_mq_receive
>          U __wrap_mq_send
>          U __wrap_mq_unlink

Are you calling send and receive from a xenomai thread? EPERM (1) is
typically related to non-RT invocations.

Jan

> 
> -----Original Message-----
> From: Philippe Gerum [mailto:rpm@xenomai.org]
> Sent: Wednesday, November 30, 2005 4:37 PM
> To: Landau, Bracha
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] using mq_receive and mq_send
> 
> 
> Landau, Bracha wrote:
>> I do link that way. The linking is fine, only the mq_receive and mq_send don't work. I don't even "own" the regular libmqueue library.
>>
> 
> What does "nm <your_app>|grep wrap_mq_" says?
> 
>> -----Original Message-----
>> From: Philippe Gerum [mailto:rpm@xenomai.org]
>> Sent: Wednesday, November 30, 2005 4:01 PM
>> To: Landau, Bracha
>> Cc: xenomai@xenomai.org
>> Subject: Re: [Xenomai-help] using mq_receive and mq_send
>>
>>
>> Landau, Bracha wrote:
>>
>>> I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.
>>>
>>> I've created an application that uses posix message queuing from xenomai.
>>>
>>> When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.
>>>
>>> When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).
>>>
>>> I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).
>>>
>>> Can anyone help?
>>>
>>
>> You must link your app with the flags output by "xeno-config 
>> --posix-ldflags". Have a look at skins/posix/demos/Makefile for a 
>> working example.
>>
> 
> 


-- 
Dipl.-Ing. Jan Kiszka

Institute for Systems Engineering, Real-Time Systems Group (RTS)
Appelstraße 9A, D-30167 Hannover
phone +49 511 762-3974 / fax +49 511 762-4012
http://www.rts.uni-hannover.de


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

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

* RE: [Xenomai-help] using mq_receive and mq_send
@ 2005-12-01  8:23 Landau, Bracha
  0 siblings, 0 replies; 7+ messages in thread
From: Landau, Bracha @ 2005-12-01  8:23 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-help

It is being called from a xenomai thread, as far as I can tell. Here is test code for mq_receive - the call to mq_receive returns with an error. When I run the same code with the lmqueue library (non-xenomai) that I downloaded I don't get an error.


void *MyThread (void *dummy)
{
 	char response [20];
	struct mq_attr buf;

	buf.mq_msgsize = sizeof (response);
	buf.mq_maxmsg = 5;
	mqd_t handle = mq_open ("/test", O_CREAT | O_RDONLY, 0, &buf);
	printf ("return from initialize_message_queue, handle=%08x\n", handle);

	int status = mq_receive (handle, (char *) &response, sizeof (response), 0);
	printf ("return from mq_receive, status = %08x, errno = %08x, %s\n", status, errno, strerror (errno) );

	return 0;
}

int main (int argc, char *argv[])
{

	pthread_attr_t attr;
	pthread_attr_init (&attr);
	pthread_create (&my_thread_id, &attr, MyThread, NULL); 

	pause ();

	
}


-----Original Message-----
From: Jan Kiszka [mailto:kiszka@domain.hid]
Sent: Wednesday, November 30, 2005 5:45 PM
To: Landau, Bracha
Cc: xenomai-help
Subject: Re: [Xenomai-help] using mq_receive and mq_send


Landau, Bracha wrote:
> it says:
>          U __wrap_mq_close
>          U __wrap_mq_open
>          U __wrap_mq_receive
>          U __wrap_mq_send
>          U __wrap_mq_unlink

Are you calling send and receive from a xenomai thread? EPERM (1) is
typically related to non-RT invocations.

Jan

> 
> -----Original Message-----
> From: Philippe Gerum [mailto:rpm@xenomai.org]
> Sent: Wednesday, November 30, 2005 4:37 PM
> To: Landau, Bracha
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] using mq_receive and mq_send
> 
> 
> Landau, Bracha wrote:
>> I do link that way. The linking is fine, only the mq_receive and mq_send don't work. I don't even "own" the regular libmqueue library.
>>
> 
> What does "nm <your_app>|grep wrap_mq_" says?
> 
>> -----Original Message-----
>> From: Philippe Gerum [mailto:rpm@xenomai.org]
>> Sent: Wednesday, November 30, 2005 4:01 PM
>> To: Landau, Bracha
>> Cc: xenomai@xenomai.org
>> Subject: Re: [Xenomai-help] using mq_receive and mq_send
>>
>>
>> Landau, Bracha wrote:
>>
>>> I am using Xenomai on the MPC8272ADS board with kernel 2.6.14.3.
>>>
>>> I've created an application that uses posix message queuing from xenomai.
>>>
>>> When I call mq_open, mq_close, mq_setattr, mq_getattr, mq_unlink - the calls succeed.
>>>
>>> When I call mq_receive or mq_send, the call fails (returns -1) and errno is set to 1 (Operation not permited).
>>>
>>> I put some debugging printk's into the xenomai code and it seems it doesn't even get to the call to __mq_receive or __mq_send from syscall.c (it does get to printk's that I put in  the other __mq_* functions).
>>>
>>> Can anyone help?
>>>
>>
>> You must link your app with the flags output by "xeno-config 
>> --posix-ldflags". Have a look at skins/posix/demos/Makefile for a 
>> working example.
>>
> 
> 


-- 
Dipl.-Ing. Jan Kiszka

Institute for Systems Engineering, Real-Time Systems Group (RTS)
Appelstraße 9A, D-30167 Hannover
phone +49 511 762-3974 / fax +49 511 762-4012
http://www.rts.uni-hannover.de

***********************************************************************************
This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@domain.hid and destroy the original message.
***********************************************************************************


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

end of thread, other threads:[~2005-12-01  8:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-30 15:42 [Xenomai-help] using mq_receive and mq_send Landau, Bracha
2005-11-30 15:44 ` Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2005-12-01  8:23 Landau, Bracha
2005-11-30 14:25 Landau, Bracha
2005-11-30 14:36 ` Philippe Gerum
2005-11-30 13:46 Landau, Bracha
2005-11-30 14:00 ` Philippe Gerum

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.