How to create an environment variable in BSP startup file ?

Hi everybody !

I want to create an environment variable in startup in order to retrieve it
in a QNX program.
Startup will read the value in a EEPROM, store it in an environment variable
and so my QNX program will retrieve it.

I saw that function add_typed_string can set predefined variable but I want
to create a new one. The function add_string could be OK but how my QNX
program can retrieve the index returned ?

Thanks for your help !

You may want to take a look at confstr()in the Library Reference, getconf,
setconf in the Utilities Reference and “Configuration strings” in the
Configuring Your Environment chapter of the Neutrino User’s Guide.

“metais” <laurent.metais@cp.com> wrote in message
news:e9g45a$s61$1@inn.qnx.com

Hi everybody !

I want to create an environment variable in startup in order to retrieve
it in a QNX program.
Startup will read the value in a EEPROM, store it in an environment
variable and so my QNX program will retrieve it.

I saw that function add_typed_string can set predefined variable but I
want to create a new one. The function add_string could be OK but how my
QNX program can retrieve the index returned ?

Thanks for your help !

metais <laurent.metais@cp.com> wrote:

Hi everybody !

I want to create an environment variable in startup in order to retrieve it
in a QNX program.
Startup will read the value in a EEPROM, store it in an environment variable
and so my QNX program will retrieve it.

I saw that function add_typed_string can set predefined variable but I want
to create a new one. The function add_string could be OK but how my QNX
program can retrieve the index returned ?

I think add_typed_string() will stick it in the system page, there may be
some macros or functions in <sys/syspage.h> that will allow you to retrieve
it.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com