rt_heap_create failure in user space
Zhang Yuchen
y.zhang-4 at student.utwente.nl
Fri Aug 12 14:33:30 CEST 2005
Problem solved!
Thanks!
Yuchen
_____
From: Dmitry Adamushko [mailto:dmitry.adamushko at datacon.at]
Sent: Friday, August 12, 2005 1:52 PM
To: Zhang Yuchen
Cc: rtai at rtai.org
Subject: Re: rt_heap_create failure in user space
> Hi, list,
>
> I am trying to create shared memory in user space by using rt_heap_create,
> but it fails with errno: No such file or directory.
> The returned error code is -2 (ENOENT), which is very strange since it
> should not be returned by the function according to API doc.
> Nothing special in my code, see below
skins/rtai/lib/heap.c:
static int __map_heap_memory (RT_HEAP *heap, RT_HEAP_PLACEHOLDER *php)
{
int err, heapfd;
/* Open the heap device to share the heap memory with the
in-kernel skin and bound clients. */
heapfd = open(XNHEAP_DEV_NAME,O_RDWR);
if (heapfd < 0)
return -ENOENT;
...
This routine, in turn, is called from rt_heap_create() in the same file.
That's how -ENOENT comes.
The reason, as you might have already guessed, is the absence of the proper
character device file.
#define XNHEAP_DEV_NAME "/dev/rtheap"
At first, run "make devices" from a fusion's source directory or extract the
corresponding code and run it manualy in case there is no source directory
on the target system. Then run your program.
> Best regards,
> Zhang Yuchen
> MSc Student
> Control Engineering Group
> University of Twente
> The Netherlands
>
---
Best regards,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.rtai.org/pipermail/rtai/attachments/20050812/c8993c13/attachment.htm
More information about the Rtai
mailing list