From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: arethe rtai <arethe.rtai@domain.hid>
Cc: Xenomai-core@domain.hid
Subject: Re: [Xenomai-core] why does not the share memory work well ?
Date: Thu, 12 May 2011 08:48:16 +0200 [thread overview]
Message-ID: <4DCB82B0.1090901@domain.hid> (raw)
In-Reply-To: <BANLkTi=Pa6FNiSWfp6PF-39mtAU8GgJcQQ@mail.gmail.com>
On 05/12/2011 06:15 AM, arethe rtai wrote:
> Hi all:
> I wirte a share memory program, but I found the share momory does
> not work while I try to take a communication between user space and
> kernel space.
> The task in kernel is OK, we can get the shared space. But the
> task in user space can not get the share memory.
> The code of the task in user space as follows:
What happens when the user-space tries to get the shared space?
>
> #include <stdio.h>
> #include <unistd.h>
> #include <sys/types.h>
> #include <sys/mman.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <rtai/rtai.h>
> #include <rtai/rtai_shm.h>
>
>
> int main(void)
> {
> unsigned int *adr;
>
> adr=(unsigned int *)rt_shm_alloc(0xaaaaa, sizeof(*adr), USE_VMALLOC);
>
> if (adr==NULL)
> printf("NULL pointer find \n");
>
> //rt_shm_free(0xaaaaa);
>
> printf("%d line \n",__LINE__);
>
> fflush(stdout);
>
> return 0;
>
> }
>
> BTW: I added some printf in file src/skins/rtai/shm.c, but they cannot
> be outputted to the console.
I doubt that very much. If printf did not work, a lot of application
would not work on your system.
--
Gilles.
next prev parent reply other threads:[~2011-05-12 6:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 4:15 [Xenomai-core] why does not the share memory work well ? arethe rtai
2011-05-12 6:48 ` Gilles Chanteperdrix [this message]
2011-05-12 8:41 ` arethe rtai
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=4DCB82B0.1090901@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=Xenomai-core@domain.hid \
--cc=arethe.rtai@domain.hid \
/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.