23 return rintern(getenv(get_c_string(name)));
29 strlen(get_c_string(value))+16);
30 sprintf(
entry,
"%s=%s",get_c_string(name),get_c_string(value));
45 cwd = getcwd(NULL,1024);
55 if (siod_llength(args) == 0)
57 home = getenv(
"HOME");
63 chdir(get_c_string(leval(car(args),env)));
68static LISP lgetpid(
void)
70 return flocons((
float)getpid());
82 ((
double)
tv.tv_usec/1000000));
88void init_subrs_sys(
void)
100 init_subr_0(
"getpid",lgetpid,
102 Return process id.");
103 init_fsubr(
"cd",lchdir,
105 Change directory to DIRNAME, if DIRNAME is nil or not specified \n\
106 change directory to user's HOME directory.");
107 init_subr_0(
"pwd",lpwd,
109 Returns current directory as a string.");
110 init_subr_1(
"getenv",lgetenv,
112 Returns value of UNIX environment variable VARNAME, or nil if VARNAME\n\
114 init_subr_2(
"setenv",lsetenv,
115 "(setenv VARNAME VALUE)\n\
116 Set the UNIX environment variable VARNAME to VALUE.");
117 init_subr_1(
"system",lsystem,
119 Execute COMMAND (a string) with the UNIX shell.");
120 init_subr_0(
"time", siod_time,
122 Returns number of seconds since start of epoch (if OS permits it\n\