Setting permission for shared memory created by boost

前端 未结 1 876
闹比i
闹比i 2020-12-31 09:26

We open a boost shared memory that was created by another process like this

  boost::interprocess::managed_shared_memory segment(boost::interprocess::open_on         


        
相关标签:
1条回答
  • 2020-12-31 10:04

    If you look at the shared_memory constructor, it takes a permissions object. boost::interprocess::permissions::set_unrestricted is probably what you are looking for

    void set_unrestricted();
    //Sets permissions to unrestricted access:
    //        A null DACL for windows or 0666 for UNIX.
    

    According to this, it was added in 1.45 version

    0 讨论(0)
提交回复
热议问题