I think we still don’t understand what you mean by “generate two temprerary
identifing share memory and message queue in hard disk” ? Can you privide a
program or explain more detail in how these files are created, and how they
are using them?
When you say “my program will stop”, do you mean a perticular function
call in your program is returning error (what function? what error code)?
Or do you mean your program just crashed ? (where? why? )
Being said that, I had a very wide guess…
Are you trying to create “/dev/shmem” and “/dev/mqueue” ? Let me point
out that these are not “FILES on HARD DISK”. These are “path names managed
by resource managers”. Namely, /dev/shmem is managed by procnto,
and /dev/mqueue is managed by “mqueue” (/sbin/mqueue).
The “/dev/shmem” and “/dev/mqueue” usually is not "ls"able. You have to
create something uder them first to “see” them appear. shm_open() usually
used to create “objects” under /dev/shmem, and mq_open() usually used
to create “queues” under /dev/mqueue.
So, is mq_open() failed on you when you run your program from EPROM?
Make sure /sbin/mqueue is also running.
niuxin <firstname.lastname@example.org> wrote in message
Mario Charest wrote:
“niuxin” <> email@example.com> > wrote in message
news:b6b2g6$v3t$> firstname.lastname@example.org> …
The two file are not to survive while power shutdown ,and They are
generated when my program which use message queue and share memory is
running ,I want to write my program to EPROM,so I must write the two
temperly files to RAM,my program is such:
fd = shm_open("/dev/shmem/mem", O_RDWR | O_CREAT, 0777 );
This is not create a file in ram it’s creating share memory object
very different. You are not clear on exactly want you want to acheive.
filename you are giving in your example is wrong, you don’t need to
/dev/shmem. I asume the \ before the first " is a typo? The filename
should be “\mem”.
when my progran is running in EPROM,it will stop here .Is somewhere
Stop? What do you mean by stop; function shm_open returns an error (if
look at the value of errno) or it never returns?
Yes,when my program is running ,it will generate two temprerary file
identifying share memory and message queues in my hard disk,but they can’t
be written to EPROM,so it will stop!
I recommend you read the documention on shm_open.
Xiaodan Tang wrote:
Are these 2 files have to survive power cycle ?
If not, can you put them (create/read/write/close them) in
fd = open("/dev/shmem/file1", O_RDWR | O_CREAT);
niuxin <> email@example.com> > wrote in message
news:b6av2v$usg$> firstname.lastname@example.org> …
Following is the detail about what I met in my work and I hope
more help from someone. My platform is X86,and OS is QNX OS 6.2.My
is OK while runinng in the harddisk , but when it is written to
can’t run properly.I think,for my program use message queue and
memory which follow the standard of POSIX API,when my program is
,it will generate two temporary files.But for the special
EPROM,Ican’t write to EPROM when it running.So I want to know if
select RAM rather than EPROM,and save the two files generated in
I have no more information about RAM files,so I hope that anyone
me more advice. thanks a lot .