henesyinit from p9fce6d0435 years agoHistory
22 lines · 301 B · C
RawDownload
#include <u.h>#include <libc.h> intputenv(char *name, char *val){	int f;	char ename[NAMELEN+6];	long s; 	sprint(ename, "/env/%s", name);	f = create(ename, OWRITE, 0664);	if(f < 0)		return -1;	s = strlen(val);	if(write(f, val, s) != s){		close(f);		return -1;	}	close(f);	return 0;}