I am building LD_PRELOAD library that propagates itself by intercepting exec variants.
I addition, the LD_PRELOAD library does the same initialization code, including and parsing some fairly large config files, during its initialization as part of each subprocess. Infact the resulting list of variables are all statics that will be accessed readonly by the rest of the subprocess.
I am looking to do this config parsing and initialiation only once at the top level process. Put this static data into into a shared memory block, and share the share memory to all subprocesses and their children. So that when they startup, they only need to access this shared memory, as a readonly access and initialize their global read only statics.
The only option I am seeing so far is raw libc calls to API like
What options are available in RUST to initialize shared memory, share location with sub processes, and initialize subprocess static variables from this shared memory from the parent ?