home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
utilities
/
utilsp
/
psh
/
c
/
osgetenv
< prev
next >
Wrap
Text File
|
1995-05-08
|
577b
|
33 lines
/* vi:tabstop=4:shiftwidth=4:smartindent
*
* osgetenv.c - Get a variable value, using the OS calls, as
* UnixLib maintains copies of the env. when it
* starts up, so getenv can return wrong values.
*/
#include <sys/os.h>
#include "psh.h"
char *osgetenv(char *var)
{
static char p[MAXLEN];
int r[10];
/* getenv isn't good enough, as Unixlib reads the env.
* when it starts.
*/
r[0] = (int) var;
r[1] = (int) p;
r[2] = MAXLEN;
r[3] = 0;
r[4] = 3;
if (os_swi(OS_ReadVarVal, r))
{
return NULL;
}
p[r[2]] = '\0';
return p;
}