ref: 1aa79968bbf19af6d6b9043b6fe841369550eff4
parent: d88bdc7d12310dee3e61978f386c12640852794b
author: 9ferno <[email protected]>
date: Sat Oct 16 14:19:39 EDT 2021
update devenv from 9front
--- a/os/pc/bootargs.c
+++ b/os/pc/bootargs.c
@@ -202,4 +202,4 @@
for(i = 0; i < nconf; i++){
print(" %s=%s\n", confname[i], confval[i]);
}
-}
\ No newline at end of file
+}
--- a/os/pc64/main.c
+++ b/os/pc64/main.c
@@ -289,7 +289,7 @@
o = p->env;
o->fgrp = newfgrp(nil);
-
+ o->egrp = newegrp();
o->pgrp = newpgrp();
kstrdup(&o->user, eve);
--- a/os/port/devenv.c
+++ b/os/port/devenv.c
@@ -318,20 +318,25 @@
qunlock(from);
}
+/*
+ * to let the kernel set environment variables
+ * TODO 9ferno shows both #ec and #e variables for ls '#e' and ls '#ec'
+ */
void
-ksetenv(char *var, char *val, int)
+ksetenv(char *ename, char *eval, int conf)
{
Chan *c;
char buf[2*KNAMELEN];
- snprint(buf, sizeof(buf), "#e/%s", var);
- if(waserror())
+ snprint(buf, sizeof(buf), "#e%s/%s", conf?"c":"", ename);
+ if(waserror()){
return;
- c = namec(buf, Acreate, OWRITE, 0600);
+ }
+ c = namec(buf, Acreate, OWRITE, 0666);
poperror();
if(!waserror()){
if(!waserror()){
- devtab[c->type]->write(c, val, strlen(val), 0);
+ devtab[c->type]->write(c, eval, strlen(eval), 0);
poperror();
}
poperror();