Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Using PHINSTANCE environment variable
Ref. No. QNX.000009928
Category(ies) Utilities
Issue Whenever runinng phditto or phindows, we notice the environment variable PHINSTANCE set to 1  (i.e.if PHINSTANCE == 1, then we must have been called through phditto to phrelay).

Could you provide us with the correct usage of the environmant variable: PHINSTANCE?



Solution PHINSTANCE will also be set in Photon if it is started from sysinit. In general, Photon sets this variable whenever it starts phlogin (or whatever is specified in the -l option).

The value gets incremented each time Photon starts a new instance of phlogin. If you have phlogin the -O option, it will terminate Photon unless PHINSTANCE is 1.

Typically,
if ph is run from sysinit, phlogin does not get the -O. A shutdown just brings up another phlogin without killing Photon or the graphics driver.

Photon started from Phindows or phditto launches phlogin with the -O option, so a shutdown terminates Photon together with phditto/phwindows.