我正在尝试让子进程修改其父进程的环境列表。 搜索周围指向 mmap(2) 作为要走的路,
void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
但我不知道如何实际实现这一点。有什么想法吗?
最佳答案
你不能影响父进程的环境
通常,您只能影响当前进程和您调用的任何子进程的环境。
关于c - 如何使用 mmap(2) 从子进程修改父进程的环境?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27060246/