[Boost-bugs] [Boost C++ Libraries] #10644: BOOST_IPC_SHARED_DIR env variable to be used for get_shared_dir()

Subject: [Boost-bugs] [Boost C++ Libraries] #10644: BOOST_IPC_SHARED_DIR env variable to be used for get_shared_dir()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-10 17:02:02


#10644: BOOST_IPC_SHARED_DIR env variable to be used for get_shared_dir()
------------------------------+--------------------------
 Reporter: qba.szymanski@… | Owner: igaztanaga
     Type: Feature Requests | Status: new
Milestone: Boost 1.57.0 | Component: interprocess
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
------------------------------+--------------------------
 Hi,

 Will it be possible to have shared_dir not hardcoded?
 Currently it is determine by some tricks (some involve event log parsing
 on windows, which fails a lot).
 The only practical solution for us was to use
 BOOST_INTERPROCESS_SHARED_DIR_PATH define.

 boost/interprocess/detail/shared_dir_helpers.hpp


 inline void get_shared_dir(std::string &shared_dir)
 {
    #if defined(BOOST_INTERPROCESS_SHARED_DIR_PATH)
       shared_dir = BOOST_INTERPROCESS_SHARED_DIR_PATH;
    #else
       get_shared_dir_root(shared_dir);
       #if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME)
          shared_dir += "/";
          get_bootstamp(shared_dir, true);
       #endif
    #endif
 }

 That has limitations tough as it makes it very difficult to test software
 in isolation (it requires access to the same folder).
 Similarly it makes is difficult to run program of machines with different
 file structure.

 Can it be configurable by some environment variable ?

 ----
 Ion Gaztañaga :

 This seems a good idea. I guess we won't support changing the value of the
 variable while the program is running, right? For performance reasons, I
 guess we could just cache the value the first time we access to the
 environment variable (or maybe in program startup).

 "BOOST_INTERPROCESS_SHARED_DIR_PATH" is too long for that environment
 variable name?

 ---------
 BOOST_IPC_SHARED_DIR is good name for env variable
 It should be read just at the start of the process (no need to change it
 during running of the program)

 thanks a lot!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10644>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC