请教各位大虾,小虾,虾米,有没有可能在重起进程后保留dlopen打开的动态库的内存空间
程序大概是这样的:
int main()
{
void *lib_handel = dlopen(filename, RTLD_LAZY);
... //基于加载得动态库做一些运算,预算结果保留在动态库中
execvp(progname,argv); //replace the current process image with a new process image
//这之后,进程会重新加载上面得动态库,所以动态库中保留得数据就没有了
}
我想要得效果是在exec后不需要重新加载动态库,而是拿到第一次打开的动态库,里面有保存的数据.
大家帮忙想想,先谢谢了.