top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What are the preconditions on C++ type that allows its use in shared memory or read from a file descriptor?

+3 votes
194 views

What are the preconditions on C++ type that allows its use in shared memory or read from a file descriptor?

posted Jan 24, 2014 by Muskan

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

I have a need for certain functions in a shared library to know the path to that library in order to find various resources. What I have in source.cpp:

#include 
#include 
static std::string myPath;

__attribute__((constructor))
void SetPath() {
 Dl_info dl_info;
 dladdr((void*)SetPath, 
 myPath = dl_info.dli_fname; // 

As the comment shows, when built with optimizations enabled, that line produces a segfault. With no optimizations, it works just fine. What magic must be done in order to ensure that this variable exists before the "constructor" function is called when loading the shared library?

+3 votes

I need a free firewall app that allows any free vpn app to run or a free vpn app that includes a firewall from the Google Play Store. Must not keep logs and no DNS leaks.

Can any Android expert help?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...