Hi!

----

Taking a look at 
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/common/common/values-xpg6.c
- is it "legal" in Solaris to set the standard "selector" variables at
runtime, e.g.
-- snip --
extern unsigned int __xpg6;
extern int __xpg4;
unsigned int saved_xpg6;
int saved__xpg4;

/* some code */

/* save standard flags ... */
saved_xpg6 = __xpg6;
saved__xpg4 = __xpg4;

/* set standard flags to null (to emulate /usr/bin/getconf) */
__xpg6 = 0U;
__xpg4 = 0;

/* run query */
run_query_standard_function();

/* restore standard flags */
__xpg6 = saved_xpg6;
__xpg4 = saved__xpg4;
-- snip --

Is this "valid" usage, e.g. could this be used to create one unified
version of the native "getconf" command in Solaris instead of shipping
three different binaries (e.g. /usr/bin/getconf, /usr/xpg4/bin/getconf
and /usr/xpg6/bin/getconf) ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to