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

1990/11211/port/devlance.c (diff list | history)

1990/0912/sys/src/9/port/devlance.c:626,6411990/11211/sys/src/9/port/devlance.c:626,642 (short | long | prev | next)
1990/0227    
	 */ 
	for(i=0; i<Ntypes; i++) { 
		sprint(lancedir[i].name, "%d", i); 
		lancedir[i].qid = CHDIR|STREAMQID(i, Lchanqid); 
1990/11211    
		lancedir[i].qid.path = CHDIR|STREAMQID(i, Lchanqid); 
		lancedir[i].qid.vers = 0; 
1990/0227    
		lancedir[i].length = 0; 
		lancedir[i].perm = 0600; 
	} 
1990/03042    
	strcpy(lancedir[Ntypes].name, "trace"); 
	lancedir[Ntypes].qid = Ltraceqid; 
1990/11211    
	lancedir[Ntypes].qid.path = Ltraceqid; 
1990/03042    
	lancedir[Ntypes].length = 0; 
	lancedir[Ntypes].perm = 0600; 
1990/0911    
	strcpy(lancedir[Ntypes+1].name, "stats"); 
	lancedir[Ntypes+1].qid = Lstatsqid; 
1990/11211    
	lancedir[Ntypes+1].qid.path = Lstatsqid; 
1990/0911    
	lancedir[Ntypes+1].length = 0; 
	lancedir[Ntypes+1].perm = 0600; 
1990/0227    
} 
1990/0912/sys/src/9/port/devlance.c:668,6741990/11211/sys/src/9/port/devlance.c:669,675
1990/0227    
int	  
lancewalk(Chan *c, char *name) 
{ 
	if(c->qid == CHDIR) 
1990/11211    
	if(c->qid.path == CHDIR) 
1990/03042    
		return devwalk(c, name, lancedir, Ndir, devgen); 
1990/0227    
	else 
		return devwalk(c, name, 0, 0, streamgen); 
1990/0912/sys/src/9/port/devlance.c:677,6831990/11211/sys/src/9/port/devlance.c:678,684
1990/0227    
void	  
lancestat(Chan *c, char *dp) 
{ 
1990/0911    
	if(c->qid==CHDIR || c->qid==Ltraceqid || c->qid==Lstatsqid) 
1990/11211    
	if(c->qid.path==CHDIR || c->qid.path==Ltraceqid || c->qid.path==Lstatsqid) 
1990/03042    
		devstat(c, dp, lancedir, Ndir, devgen); 
1990/0227    
	else 
		devstat(c, dp, 0, 0, streamgen); 
1990/0912/sys/src/9/port/devlance.c:691,7021990/11211/sys/src/9/port/devlance.c:692,703
1990/0227    
{ 
	extern Qinfo nonetinfo; 
 
1990/03042    
	switch(c->qid){ 
1990/11211    
	switch(c->qid.path){ 
1990/03042    
	case CHDIR: 
	case Ltraceqid: 
1990/0911    
	case Lstatsqid: 
1990/0227    
		if(omode != OREAD) 
			error(0, Eperm); 
1990/11211    
			error(Eperm); 
1990/03042    
		break; 
	default: 
1990/0227    
		streamopen(c, &lanceinfo); 
1990/0912/sys/src/9/port/devlance.c:711,7171990/11211/sys/src/9/port/devlance.c:712,718
1990/0227    
void	  
lancecreate(Chan *c, char *name, int omode, ulong perm) 
{ 
	error(0, Eperm); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
void	  
1990/0912/sys/src/9/port/devlance.c:718,7241990/11211/sys/src/9/port/devlance.c:719,725
1990/0227    
lanceclose(Chan *c) 
{ 
	/* real closing happens in lancestclose */ 
1990/03042    
	switch(c->qid){ 
1990/11211    
	switch(c->qid.path){ 
1990/03042    
	case CHDIR: 
	case Ltraceqid: 
1990/0911    
	case Lstatsqid: 
1990/0912/sys/src/9/port/devlance.c:767,7731990/11211/sys/src/9/port/devlance.c:768,774
1990/0227    
{ 
1990/0911    
	char buf[256]; 
 
1990/03042    
	switch(c->qid){ 
1990/11211    
	switch(c->qid.path){ 
1990/03042    
	case CHDIR: 
		return devdirread(c, a, n, lancedir, Ndir, devgen); 
1990/0911    
	case Lstatsqid: 
1990/0912/sys/src/9/port/devlance.c:791,8151990/11211/sys/src/9/port/devlance.c:792,804
1990/0227    
void	  
lanceremove(Chan *c) 
{ 
	error(0, Eperm); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
void	  
lancewstat(Chan *c, char *dp) 
{ 
	error(0, Eperm); 
} 
                 
void	  
lanceerrstr(Error *e, char *buf) 
{ 
	rooterrstr(e, buf); 
} 
                 
void	  
lanceuserstr(Error *e, char *buf) 
{ 
	consuserstr(e, buf); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
/* 


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