QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Determining whether the currently executing process is Dev or Dev.ser |
Ref. No. |
QNX.000006671 |
Category(ies) |
Character I/O |
Issue |
Dev communicates with Dev.ser by doing far calls directly into Dev.ser's code segment. In some implementations of these drivers the same code can be executed by either Dev or Dev.ser. How do we determine what the currently executing process is?
|
Solution |
There are two ways of determining whether Dev or Dev.ser is the currently executing process. One way would be to use a global flag in the modified Dev.ser code. Before Dev.ser makes a function call it would set the flag high, once it is done executing, the flag would be set low. The other way is to use the getpid() function in the modified Dev.ser code. The getpid() function allows the calling process to find out its identity.
|
|