由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - How can we share system environment variable between two different process?
相关主题
Screen session 保持 environment variables小白问个csh的问题
命令行下咋回到历史目录啊?新手求教简单问题
Help, x server problemLinux/crossplatform GUI programming environments in C/C++(wxWindows, Qt)
Newbie questionGnome 2.28 beta1 。。。
请教: KDE 里面的terminal 没法用了求助:samba设置问题
设置环境变量求助。linux上面有没有轻量级的message queue? POSIX message queue不合适。
gdb cann't display variable valuea dummy OS question (转载)
TCSH里怎么用setenv把一个带有空格的路径加给$PATH? (转载)能否建立一个虚拟网卡并监听端口?
相关话题的讨论汇总
话题: process话题: input话题: eventx话题: variables
进入Linux版参与讨论
1 (共1页)
g***l
发帖数: 2753
1
sorry no Chinese input here.
The issue is:
1. A process will add new device with name as /dev/input/eventX
2. B process needs to know the new device name as /dev/input/eventX
Initially I thought A process can export a system environment variable via
setenv(), for example set INPUT_DEVICE=/dev/input/eventX, but I found this http://docstore.mik.ua/orelly/unix/upt/ch06_02.htm. It seems you cannot share the environment variables between two different processes.
"Sooner or later, almost everyone writes a shell script that gathers some
information, sets a few environment variables, and quits. The writer then
wonders why there's no trace of the "new" environment variables to be found.
The problem is simple. A UNIX process ( 38.3 ) cannot change its parent's
environment; a UNIX process gets its own copy of the parent's environment,
and any changes it makes it keeps to itself. A process can make changes and
pass them to its children, but there's no way of going in reverse."
Any good idea to solve this issue?
thanks
a9
发帖数: 21638
2
写到一个文件里不行吗?

process?
http://docstore.mik.ua/orelly/unix/upt/ch06_02.htm. It seems you cannot share the environment variables between two different processes.
found.
and

【在 g***l 的大作中提到】
: sorry no Chinese input here.
: The issue is:
: 1. A process will add new device with name as /dev/input/eventX
: 2. B process needs to know the new device name as /dev/input/eventX
: Initially I thought A process can export a system environment variable via
: setenv(), for example set INPUT_DEVICE=/dev/input/eventX, but I found this http://docstore.mik.ua/orelly/unix/upt/ch06_02.htm. It seems you cannot share the environment variables between two different processes.
: "Sooner or later, almost everyone writes a shell script that gathers some
: information, sets a few environment variables, and quits. The writer then
: wonders why there's no trace of the "new" environment variables to be found.
: The problem is simple. A UNIX process ( 38.3 ) cannot change its parent's

k****e
发帖数: 2758
3
so many many way to do IPC

http://docstore.mik.ua/orelly/unix/upt/ch06_02.htm. It seems you cannot share the environment variables between two different processes.
found.

【在 g***l 的大作中提到】
: sorry no Chinese input here.
: The issue is:
: 1. A process will add new device with name as /dev/input/eventX
: 2. B process needs to know the new device name as /dev/input/eventX
: Initially I thought A process can export a system environment variable via
: setenv(), for example set INPUT_DEVICE=/dev/input/eventX, but I found this http://docstore.mik.ua/orelly/unix/upt/ch06_02.htm. It seems you cannot share the environment variables between two different processes.
: "Sooner or later, almost everyone writes a shell script that gathers some
: information, sets a few environment variables, and quits. The writer then
: wonders why there's no trace of the "new" environment variables to be found.
: The problem is simple. A UNIX process ( 38.3 ) cannot change its parent's

S**********r
发帖数: 14
4
process b自己去sysfs/devfs/procfs里遍历查找出eventX.
怎么去遍历?有api或者直接system()调其他现成的程序
1 (共1页)
进入Linux版参与讨论
相关主题
能否建立一个虚拟网卡并监听端口?请教: KDE 里面的terminal 没法用了
how to count a pattern in vi?设置环境变量求助。
how to remove condition for a breakpoint in gdb?gdb cann't display variable value
using g1TCSH里怎么用setenv把一个带有空格的路径加给$PATH? (转载)
Screen session 保持 environment variables小白问个csh的问题
命令行下咋回到历史目录啊?新手求教简单问题
Help, x server problemLinux/crossplatform GUI programming environments in C/C++(wxWindows, Qt)
Newbie questionGnome 2.28 beta1 。。。
相关话题的讨论汇总
话题: process话题: input话题: eventx话题: variables