plan 9 kernel history: overview | file list | diff list

1992/0625/port/devenv.c (diff list | history)

1992/0623/sys/src/9/port/devenv.c:76,821992/0625/sys/src/9/port/devenv.c:76,82 (short | long | prev | next)
1992/0623    
	Evalue *e; 
	 
	eg = u->p->egrp; 
1991/1018    
	if(c->qid.path & CHDIR){ 
1992/0625    
	if(c->qid.path & CHDIR) { 
1991/1018    
		if(omode != OREAD) 
1990/11211    
			error(Eperm); 
1992/0623    
	} 
1992/0623/sys/src/9/port/devenv.c:254,2591992/0625/sys/src/9/port/devenv.c:254,299
1992/0623    
	memmove(e->value+offset, a, n); 
	qunlock(eg); 
	return n; 
1992/0625    
} 
 
void 
envcpy(Egrp *to, Egrp *from) 
{ 
	Evalue **l, *ne, *e; 
 
	l = &to->entries; 
	qlock(from); 
	for(e = from->entries; e; e = e->link) { 
		ne = smalloc(sizeof(Evalue)); 
		ne->name = smalloc(strlen(e->name)+1); 
		strcpy(ne->name, e->name); 
		if(e->value) { 
			ne->value = smalloc(e->len); 
			memmove(ne->value, e->value, e->len); 
			ne->len = e->len; 
		} 
		ne->path = ++to->path; 
		*l = ne; 
		l = &ne->link; 
	} 
	qunlock(from); 
} 
 
void 
closeegrp(Egrp *eg) 
{ 
	Evalue *e, *next; 
 
	if(decref(eg) == 0) { 
		for(e = eg->entries; e; e = next) { 
			next = e->link; 
			free(e->name); 
			if(e->value) 
				free(e->value); 
			free(e); 
		} 
		free(eg); 
	} 
1991/1022    
} 
 
1991/0927    
/* 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)