Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64336 - in trunk/boost/interprocess: . detail
From: igaztanaga_at_[hidden]
Date: 2010-07-25 12:47:06


Author: igaztanaga
Date: 2010-07-25 12:47:05 EDT (Sun, 25 Jul 2010)
New Revision: 64336
URL: http://svn.boost.org/trac/boost/changeset/64336

Log:
Changes for Boost 1.45
Text files modified:
   trunk/boost/interprocess/creation_tags.hpp | 4 ++++
   trunk/boost/interprocess/detail/file_wrapper.hpp | 19 ++++++++++---------
   2 files changed, 14 insertions(+), 9 deletions(-)

Modified: trunk/boost/interprocess/creation_tags.hpp
==============================================================================
--- trunk/boost/interprocess/creation_tags.hpp (original)
+++ trunk/boost/interprocess/creation_tags.hpp 2010-07-25 12:47:05 EDT (Sun, 25 Jul 2010)
@@ -30,6 +30,10 @@
 struct open_read_only_t {};
 
 //!Tag to indicate that the resource must
+//!be only opened privately for reading
+struct open_read_private_t {};
+
+//!Tag to indicate that the resource must
 //!be only opened for reading
 struct open_copy_on_write_t {};
 

Modified: trunk/boost/interprocess/detail/file_wrapper.hpp
==============================================================================
--- trunk/boost/interprocess/detail/file_wrapper.hpp (original)
+++ trunk/boost/interprocess/detail/file_wrapper.hpp 2010-07-25 12:47:05 EDT (Sun, 25 Jul 2010)
@@ -35,19 +35,19 @@
 
    //!Creates a file object with name "name" and mode "mode", with the access mode "mode"
    //!If the file previously exists, throws an error.
- file_wrapper(create_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoCreate, name, mode); }
+ file_wrapper(create_only_t, const char *name, mode_t mode, const permissions &perm = permissions())
+ { this->priv_open_or_create(detail::DoCreate, name, mode, perm); }
 
    //!Tries to create a file with name "name" and mode "mode", with the
    //!access mode "mode". If the file previously exists, it tries to open it with mode "mode".
    //!Otherwise throws an error.
- file_wrapper(open_or_create_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode); }
+ file_wrapper(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions())
+ { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode, perm); }
 
    //!Tries to open a file with name "name", with the access mode "mode".
    //!If the file does not previously exist, it throws an error.
    file_wrapper(open_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpen, name, mode); }
+ { this->priv_open_or_create(detail::DoOpen, name, mode, permissions()); }
 
    //!Moves the ownership of "moved"'s file to *this.
    //!After the call, "moved" does not represent any file.
@@ -100,7 +100,7 @@
    //!Closes a previously opened file mapping. Never throws.
    void priv_close();
    //!Closes a previously opened file mapping. Never throws.
- bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode);
+ bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm);
 
    file_handle_t m_handle;
    mode_t m_mode;
@@ -136,7 +136,8 @@
 inline bool file_wrapper::priv_open_or_create
    (detail::create_enum_t type,
     const char *filename,
- mode_t mode)
+ mode_t mode,
+ const permissions &perm = permissions())
 {
    m_filename = filename;
 
@@ -151,10 +152,10 @@
          m_handle = open_existing_file(filename, mode);
       break;
       case detail::DoCreate:
- m_handle = create_new_file(filename, mode);
+ m_handle = create_new_file(filename, mode, perm);
       break;
       case detail::DoOpenOrCreate:
- m_handle = create_or_open_file(filename, mode);
+ m_handle = create_or_open_file(filename, mode, perm);
       break;
       default:
          {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk