Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - shared memory persistence: (4 Items)
   
shared memory persistence  
Hello, qnx experts,

In qnx, dose the shared memory object(SMO) ever have a chance to be written to stable storage? 

We want to write some trash bytes to the SMO file and sync it before we unlink it to secure the information inside it, 
but fsync is not implemented for SMOs on QNX, so dose this mean that after the SMO is unlinked, the information it 
contains may still exist on some stable storage?

Thanks.

--david
Re: shared memory persistence  
> Hello, qnx experts,
> 
> In qnx, dose the shared memory object(SMO) ever have a chance to be written to
>  stable storage? 
> 
> We want to write some trash bytes to the SMO file and sync it before we unlink
>  it to secure the information inside it, but fsync is not implemented for SMOs
>  on QNX, so dose this mean that after the SMO is unlinked, the information it 
> contains may still exist on some stable storage?
> 
> Thanks.
> 
> --david


Yes, as long as someone as it open it will not be "unlinked".  Note that after it's unliked it becomes invisible an 
nobody else can open it, but it will still exists as long it is open by at least one client.
Re: shared memory persistence  
OK, then do I have any way to sync the shared memory object on qnx? I tried fsync, and turned out fsync is not 
implemented for shared memory object. Are there any other functions that I can use to sync the qnx shared memory object?


Thanks.
--david
Re: shared memory persistence  
If the shared memory object is backed by a file, and the filesystem supports mmap(), then
you can use msync() to flush the changes to the mapping back to the persistent file.

Note this was only supported in 6.3.2 and later.

Colin

David Zhao wrote:
> OK, then do I have any way to sync the shared memory object on qnx? I 
> tried fsync, and turned out fsync is not implemented for shared memory 
> object. Are there any other functions that I can use to sync the qnx 
> shared memory object?
> 
> Thanks.
> --david
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post5925
> 

-- 
cburgess@qnx.com