c - 如何使用 mmap(2) 从子进程修改父进程的环境?

标签 c unix process environment-variables memory-address

我正在尝试让子进程修改其父进程的环境列表。 搜索周围指向 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/

相关文章:

c - C编程中在图形中输入文字

c - malloc() 函数分配的内存的生命周期

linux - shell脚本不同运行方式的区别

android - 如何杀死Android应用程序启动的logcat进程?

python : fork and exec a process to run on different terminal

c - "implementation"中的 "implementation (in)dependent"是什么意思?

万一无法完成除法计算。商为0.0。有没有办法可以将 int 更改为 float?

unix - 在 Unix 脚本中将密码传递给 ssh 提示符

linux - Node JS : node-shedule parser bug

java - 是否可以将 "tail -f"命令的输出获取到 java 程序?