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

1992/0226/port/devroot.c (diff list | history)

1990/0227/sys/src/9/port/devroot.c:16,261990/11211/sys/src/9/port/devroot.c:16,26 (short | long)
1990/0227    
}; 
 
Dirtab rootdir[]={ 
	"bin",		Qbin|CHDIR,	0,			0700, 
	"boot",		Qboot,		0,			0700, 
	"dev",		Qdev|CHDIR,	0,			0700, 
	"env",		Qenv|CHDIR,	0,			0700, 
	"proc",		Qproc|CHDIR,	0,			0700, 
1990/11211    
	"bin",		{Qbin|CHDIR},	0,			0700, 
	"boot",		{Qboot},	0,			0700, 
	"dev",		{Qdev|CHDIR},	0,			0700, 
	"env",		{Qenv|CHDIR},	0,			0700, 
	"proc",		{Qproc|CHDIR},	0,			0700, 
1990/0227    
}; 
 
#define	NROOT	(sizeof rootdir/sizeof(Dirtab)) 
1990/0227/sys/src/9/port/devroot.c:68,741990/11211/sys/src/9/port/devroot.c:68,74
1990/0227    
void	  
rootcreate(Chan *c, char *name, int omode, ulong perm) 
{ 
	error(0, Eperm); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
/* 
1990/0227/sys/src/9/port/devroot.c:85,911990/11211/sys/src/9/port/devroot.c:85,91
1990/0227    
rootread(Chan *c, void *buf, long n) 
{ 
 
	switch(c->qid & ~CHDIR){ 
1990/11211    
	switch(c->qid.path & ~CHDIR){ 
1990/0227    
	case Qdir: 
		return devdirread(c, buf, n, rootdir, NROOT, devgen); 
 
1990/0227/sys/src/9/port/devroot.c:100,1061990/11211/sys/src/9/port/devroot.c:100,106
1990/0227    
	case Qdev: 
		return 0; 
	} 
	error(0, Egreg); 
1990/11211    
	error(Egreg); 
1990/0227    
	return 0; 
} 
 
1990/0227/sys/src/9/port/devroot.c:107,1401990/11211/sys/src/9/port/devroot.c:107,123
1990/0227    
long	  
rootwrite(Chan *c, void *buf, long n) 
{ 
	error(0, Egreg); 
1990/11211    
	error(Egreg); 
1990/0227    
} 
 
void	  
rootremove(Chan *c) 
{ 
	error(0, Eperm); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
void	  
rootwstat(Chan *c, char *dp) 
{ 
	error(0, Eperm); 
} 
                 
void 
rootuserstr(Error *e, char *buf) 
{ 
	consuserstr(e, buf); 
} 
                 
#include "errstr.h" 
                 
void	  
rooterrstr(Error *e, char *buf) 
{ 
	if(e->code<0 || e->code>=sizeof errstrtab/sizeof(char*)) 
		strcpy(buf, "no such error"); 
	else 
		strcpy(buf, errstrtab[e->code]); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
1990/11211/sys/src/9/port/devroot.c:94,1001991/0110/sys/src/9/port/devroot.c:94,102 (short | long)
1990/0227    
			return 0; 
		if(c->offset+n > sizeof bootcode) 
			n = sizeof bootcode - c->offset; 
1991/0110    
ck("1"); 
1990/0227    
		memcpy(buf, ((char*)bootcode)+c->offset, n); 
1991/0110    
ck("2"); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0110/sys/src/9/port/devroot.c:94,1021991/0111/sys/src/9/port/devroot.c:94,100 (short | long)
1990/0227    
			return 0; 
		if(c->offset+n > sizeof bootcode) 
			n = sizeof bootcode - c->offset; 
1991/0110    
ck("1"); 
1990/0227    
		memcpy(buf, ((char*)bootcode)+c->offset, n); 
1991/0110    
ck("2"); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0111/sys/src/9/port/devroot.c:10,201991/0214/sys/src/9/port/devroot.c:10,25 (short | long)
1990/0227    
	Qdir, 
	Qbin, 
	Qboot, 
1991/0214    
	Qcfs, 
1990/0227    
	Qdev, 
	Qenv, 
	Qproc, 
}; 
 
1991/0214    
extern long	cfslen; 
extern ulong	*cfscode; 
 
 
1990/0227    
Dirtab rootdir[]={ 
1990/11211    
	"bin",		{Qbin|CHDIR},	0,			0700, 
	"boot",		{Qboot},	0,			0700, 
1991/0111/sys/src/9/port/devroot.c:21,331991/0214/sys/src/9/port/devroot.c:26,41
1990/11211    
	"dev",		{Qdev|CHDIR},	0,			0700, 
	"env",		{Qenv|CHDIR},	0,			0700, 
	"proc",		{Qproc|CHDIR},	0,			0700, 
1991/0214    
	"cfs",		{Qcfs},		0,			0700, 
1990/0227    
}; 
 
#define	NROOT	(sizeof rootdir/sizeof(Dirtab)) 
1991/0214    
int	nroot; 
1990/0227    
 
void 
rootreset(void) 
{ 
1991/0214    
	nroot = (cfslen > 0) ? NROOT : NROOT-1; 
1990/0227    
} 
 
void 
1991/0111/sys/src/9/port/devroot.c:50,681991/0214/sys/src/9/port/devroot.c:58,76
1990/0227    
int	  
rootwalk(Chan *c, char *name) 
{ 
	return devwalk(c, name, rootdir, NROOT, devgen); 
1991/0214    
	return devwalk(c, name, rootdir, nroot, devgen); 
1990/0227    
} 
 
void	  
rootstat(Chan *c, char *dp) 
{ 
	devstat(c, dp, rootdir, NROOT, devgen); 
1991/0214    
	devstat(c, dp, rootdir, nroot, devgen); 
1990/0227    
} 
 
Chan* 
rootopen(Chan *c, int omode) 
{ 
	return devopen(c, omode, rootdir, NROOT, devgen); 
1991/0214    
	return devopen(c, omode, rootdir, nroot, devgen); 
1990/0227    
} 
 
void	  
1991/0111/sys/src/9/port/devroot.c:87,931991/0214/sys/src/9/port/devroot.c:95,101
1990/0227    
 
1990/11211    
	switch(c->qid.path & ~CHDIR){ 
1990/0227    
	case Qdir: 
		return devdirread(c, buf, n, rootdir, NROOT, devgen); 
1991/0214    
		return devdirread(c, buf, n, rootdir, nroot, devgen); 
1990/0227    
 
	case Qboot:		/* boot */ 
		if(c->offset >= sizeof bootcode) 
1991/0111/sys/src/9/port/devroot.c:95,1001991/0214/sys/src/9/port/devroot.c:103,116
1990/0227    
		if(c->offset+n > sizeof bootcode) 
			n = sizeof bootcode - c->offset; 
		memcpy(buf, ((char*)bootcode)+c->offset, n); 
1991/0214    
		return n; 
 
	case Qcfs:		/* boot */ 
		if(c->offset >= cfslen) 
			return 0; 
		if(c->offset+n > cfslen) 
			n = cfslen - c->offset; 
		memcpy(buf, ((char*)cfscode)+c->offset, n); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0214/sys/src/9/port/devroot.c:17,231991/0216/sys/src/9/port/devroot.c:17,23 (short | long)
1990/0227    
}; 
 
1991/0214    
extern long	cfslen; 
extern ulong	*cfscode; 
1991/0216    
extern ulong	cfscode[]; 
1991/0214    
 
 
1990/0227    
Dirtab rootdir[]={ 
1991/0216/sys/src/9/port/devroot.c:105,1111991/0312/sys/src/9/port/devroot.c:105,111 (short | long)
1990/0227    
		memcpy(buf, ((char*)bootcode)+c->offset, n); 
1991/0214    
		return n; 
 
	case Qcfs:		/* boot */ 
1991/0312    
	case Qcfs:		/* cfs */ 
1991/0214    
		if(c->offset >= cfslen) 
			return 0; 
		if(c->offset+n > cfslen) 
1991/0312/sys/src/9/port/devroot.c:102,1081991/0318/sys/src/9/port/devroot.c:102,108 (short | long)
1990/0227    
			return 0; 
		if(c->offset+n > sizeof bootcode) 
			n = sizeof bootcode - c->offset; 
		memcpy(buf, ((char*)bootcode)+c->offset, n); 
1991/0318    
		memmove(buf, ((char*)bootcode)+c->offset, n); 
1991/0214    
		return n; 
 
1991/0312    
	case Qcfs:		/* cfs */ 
1991/0312/sys/src/9/port/devroot.c:110,1161991/0318/sys/src/9/port/devroot.c:110,116
1991/0214    
			return 0; 
		if(c->offset+n > cfslen) 
			n = cfslen - c->offset; 
		memcpy(buf, ((char*)cfscode)+c->offset, n); 
1991/0318    
		memmove(buf, ((char*)cfscode)+c->offset, n); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0318/sys/src/9/port/devroot.c:90,961991/0411/sys/src/9/port/devroot.c:90,96 (short | long)
1990/0227    
#include	"boot.h" 
 
long	  
rootread(Chan *c, void *buf, long n) 
1991/0411    
rootread(Chan *c, void *buf, long n, ulong offset) 
1990/0227    
{ 
 
1990/11211    
	switch(c->qid.path & ~CHDIR){ 
1991/0318/sys/src/9/port/devroot.c:98,1161991/0411/sys/src/9/port/devroot.c:98,116
1991/0214    
		return devdirread(c, buf, n, rootdir, nroot, devgen); 
1990/0227    
 
	case Qboot:		/* boot */ 
		if(c->offset >= sizeof bootcode) 
1991/0411    
		if(offset >= sizeof bootcode) 
1990/0227    
			return 0; 
		if(c->offset+n > sizeof bootcode) 
			n = sizeof bootcode - c->offset; 
1991/0318    
		memmove(buf, ((char*)bootcode)+c->offset, n); 
1991/0411    
		if(offset+n > sizeof bootcode) 
			n = sizeof bootcode - offset; 
		memmove(buf, ((char*)bootcode)+offset, n); 
1991/0214    
		return n; 
 
1991/0312    
	case Qcfs:		/* cfs */ 
1991/0214    
		if(c->offset >= cfslen) 
1991/0411    
		if(offset >= cfslen) 
1991/0214    
			return 0; 
		if(c->offset+n > cfslen) 
			n = cfslen - c->offset; 
1991/0318    
		memmove(buf, ((char*)cfscode)+c->offset, n); 
1991/0411    
		if(offset+n > cfslen) 
			n = cfslen - offset; 
		memmove(buf, ((char*)cfscode)+offset, n); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0318/sys/src/9/port/devroot.c:121,1271991/0411/sys/src/9/port/devroot.c:121,127
1990/0227    
} 
 
long	  
rootwrite(Chan *c, void *buf, long n) 
1991/0411    
rootwrite(Chan *c, void *buf, long n, ulong offset) 
1990/0227    
{ 
1990/11211    
	error(Egreg); 
1990/0227    
} 
1991/0411/sys/src/9/port/devroot.c:61,661991/0419/sys/src/9/port/devroot.c:61,72 (short | long)
1991/0214    
	return devwalk(c, name, rootdir, nroot, devgen); 
1990/0227    
} 
 
1991/0419    
Chan* 
rootclwalk(Chan *c, char *name) 
{ 
	return devclwalk(c, name); 
} 
 
1990/0227    
void	  
rootstat(Chan *c, char *dp) 
{ 
1991/0419/sys/src/9/port/devroot.c:61,721991/0427/sys/src/9/port/devroot.c:61,66 (short | long)
1991/0214    
	return devwalk(c, name, rootdir, nroot, devgen); 
1990/0227    
} 
 
1991/0419    
Chan* 
rootclwalk(Chan *c, char *name) 
{ 
	return devclwalk(c, name); 
} 
                 
1990/0227    
void	  
rootstat(Chan *c, char *dp) 
{ 
1991/0427/sys/src/9/port/devroot.c:11,161991/0613/sys/src/9/port/devroot.c:11,17 (short | long)
1990/0227    
	Qbin, 
	Qboot, 
1991/0214    
	Qcfs, 
1991/0613    
	Qcryptfs, 
1990/0227    
	Qdev, 
	Qenv, 
	Qproc, 
1991/0427/sys/src/9/port/devroot.c:19,251991/0613/sys/src/9/port/devroot.c:20,29
1991/0214    
extern long	cfslen; 
1991/0216    
extern ulong	cfscode[]; 
1991/0214    
 
1991/0613    
extern long	cryptfslen; 
extern ulong	cryptfscode[]; 
1991/0214    
 
1991/0613    
 
1990/0227    
Dirtab rootdir[]={ 
1990/11211    
	"bin",		{Qbin|CHDIR},	0,			0700, 
	"boot",		{Qboot},	0,			0700, 
1991/0427/sys/src/9/port/devroot.c:26,311991/0613/sys/src/9/port/devroot.c:30,36
1990/11211    
	"dev",		{Qdev|CHDIR},	0,			0700, 
	"env",		{Qenv|CHDIR},	0,			0700, 
	"proc",		{Qproc|CHDIR},	0,			0700, 
1991/0613    
	"cryptfs",	{Qcryptfs},	0,			0700, 
1991/0214    
	"cfs",		{Qcfs},		0,			0700, 
1990/0227    
}; 
 
1991/0427/sys/src/9/port/devroot.c:111,1161991/0613/sys/src/9/port/devroot.c:116,129
1991/0411    
		if(offset+n > cfslen) 
			n = cfslen - offset; 
		memmove(buf, ((char*)cfscode)+offset, n); 
1991/0613    
		return n; 
 
	case Qcryptfs:		/* cryptfs */ 
		if(offset >= cryptfslen) 
			return 0; 
		if(offset+n > cryptfslen) 
			n = cryptfslen - offset; 
		memmove(buf, ((char*)cryptfscode)+offset, n); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0613/sys/src/9/port/devroot.c:19,291991/0615/sys/src/9/port/devroot.c:19,27 (short | long)
1990/0227    
 
1991/0214    
extern long	cfslen; 
1991/0216    
extern ulong	cfscode[]; 
1991/0214    
                 
1991/0613    
extern long	cryptfslen; 
extern ulong	cryptfscode[]; 
1991/0214    
 
1991/0613    
                 
1990/0227    
Dirtab rootdir[]={ 
1990/11211    
	"bin",		{Qbin|CHDIR},	0,			0700, 
	"boot",		{Qboot},	0,			0700, 
1991/0613/sys/src/9/port/devroot.c:30,461991/0615/sys/src/9/port/devroot.c:28,66
1990/11211    
	"dev",		{Qdev|CHDIR},	0,			0700, 
	"env",		{Qenv|CHDIR},	0,			0700, 
	"proc",		{Qproc|CHDIR},	0,			0700, 
1991/0613    
	"cryptfs",	{Qcryptfs},	0,			0700, 
1991/0214    
	"cfs",		{Qcfs},		0,			0700, 
1990/0227    
}; 
                 
#define	NROOT	(sizeof rootdir/sizeof(Dirtab)) 
1991/0615    
Dirtab rootpdir[]={ 
	"cfs",		{Qcfs},		0,			0700, 
	"cryptfs",	{Qcryptfs},	0,			0700, 
}; 
Dirtab *rootmap[sizeof rootpdir/sizeof(Dirtab)]; 
1991/0214    
int	nroot; 
1990/0227    
 
1991/0615    
int 
rootgen(Chan *c, Dirtab *tab, int ntab, int i, Dir *dp) 
{ 
	if(tab==0 || i>=ntab) 
		return -1; 
	if(i < NROOT) 
		tab += i; 
	else 
		tab = rootmap[i - NROOT]; 
	devdir(c, tab->qid, tab->name, tab->length, tab->perm, dp); 
	return 1; 
} 
 
1990/0227    
void 
rootreset(void) 
{ 
1991/0214    
	nroot = (cfslen > 0) ? NROOT : NROOT-1; 
1991/0615    
	int i; 
 
	i = 0; 
	if(cfslen) 
		rootmap[i++] = &rootpdir[0]; 
	if(cryptfslen) 
		rootmap[i++] = &rootpdir[1]; 
	nroot = NROOT + i; 
1990/0227    
} 
 
void 
1991/0613/sys/src/9/port/devroot.c:63,811991/0615/sys/src/9/port/devroot.c:83,101
1990/0227    
int	  
rootwalk(Chan *c, char *name) 
{ 
1991/0214    
	return devwalk(c, name, rootdir, nroot, devgen); 
1991/0615    
	return devwalk(c, name, rootdir, nroot, rootgen); 
1990/0227    
} 
 
void	  
rootstat(Chan *c, char *dp) 
{ 
1991/0214    
	devstat(c, dp, rootdir, nroot, devgen); 
1991/0615    
	devstat(c, dp, rootdir, nroot, rootgen); 
1990/0227    
} 
 
Chan* 
rootopen(Chan *c, int omode) 
{ 
1991/0214    
	return devopen(c, omode, rootdir, nroot, devgen); 
1991/0615    
	return devopen(c, omode, rootdir, nroot, rootgen); 
1990/0227    
} 
 
void	  
1991/0613/sys/src/9/port/devroot.c:100,1061991/0615/sys/src/9/port/devroot.c:120,126
1990/0227    
 
1990/11211    
	switch(c->qid.path & ~CHDIR){ 
1990/0227    
	case Qdir: 
1991/0214    
		return devdirread(c, buf, n, rootdir, nroot, devgen); 
1991/0615    
		return devdirread(c, buf, n, rootdir, nroot, rootgen); 
1990/0227    
 
	case Qboot:		/* boot */ 
1991/0411    
		if(offset >= sizeof bootcode) 
1991/0615/sys/src/9/port/devroot.c:14,241991/0910/sys/src/9/port/devroot.c:14,27 (short | long)
1991/0613    
	Qcryptfs, 
1990/0227    
	Qdev, 
	Qenv, 
1991/0910    
	Qkfs, 
1990/0227    
	Qproc, 
}; 
 
1991/0214    
extern long	cfslen; 
1991/0216    
extern ulong	cfscode[]; 
1991/0910    
extern long	kfslen; 
extern ulong	kfscode[]; 
1991/0613    
extern long	cryptfslen; 
extern ulong	cryptfscode[]; 
1991/0214    
 
1991/0615/sys/src/9/port/devroot.c:33,381991/0910/sys/src/9/port/devroot.c:36,42
1991/0615    
Dirtab rootpdir[]={ 
	"cfs",		{Qcfs},		0,			0700, 
	"cryptfs",	{Qcryptfs},	0,			0700, 
1991/0910    
	"kfs",		{Qkfs},		0,			0700, 
1991/0615    
}; 
Dirtab *rootmap[sizeof rootpdir/sizeof(Dirtab)]; 
1991/0214    
int	nroot; 
1991/0615/sys/src/9/port/devroot.c:60,651991/0910/sys/src/9/port/devroot.c:64,71
1991/0615    
		rootmap[i++] = &rootpdir[0]; 
	if(cryptfslen) 
		rootmap[i++] = &rootpdir[1]; 
1991/0910    
	if(kfslen) 
		rootmap[i++] = &rootpdir[2]; 
1991/0615    
	nroot = NROOT + i; 
1990/0227    
} 
 
1991/0615/sys/src/9/port/devroot.c:136,1411991/0910/sys/src/9/port/devroot.c:142,155
1991/0411    
		if(offset+n > cfslen) 
			n = cfslen - offset; 
		memmove(buf, ((char*)cfscode)+offset, n); 
1991/0910    
		return n; 
 
	case Qkfs:		/* kfs */ 
		if(offset >= kfslen) 
			return 0; 
		if(offset+n > kfslen) 
			n = kfslen - offset; 
		memmove(buf, ((char*)kfscode)+offset, n); 
1991/0613    
		return n; 
 
	case Qcryptfs:		/* cryptfs */ 
1991/0910/sys/src/9/port/devroot.c:11,171991/0913/sys/src/9/port/devroot.c:11,16 (short | long)
1990/0227    
	Qbin, 
	Qboot, 
1991/0214    
	Qcfs, 
1991/0613    
	Qcryptfs, 
1990/0227    
	Qdev, 
	Qenv, 
1991/0910    
	Qkfs, 
1991/0910/sys/src/9/port/devroot.c:22,291991/0913/sys/src/9/port/devroot.c:21,26
1991/0216    
extern ulong	cfscode[]; 
1991/0910    
extern long	kfslen; 
extern ulong	kfscode[]; 
1991/0613    
extern long	cryptfslen; 
extern ulong	cryptfscode[]; 
1991/0214    
 
1990/0227    
Dirtab rootdir[]={ 
1990/11211    
	"bin",		{Qbin|CHDIR},	0,			0700, 
1991/0910/sys/src/9/port/devroot.c:35,411991/0913/sys/src/9/port/devroot.c:32,37
1990/0227    
#define	NROOT	(sizeof rootdir/sizeof(Dirtab)) 
1991/0615    
Dirtab rootpdir[]={ 
	"cfs",		{Qcfs},		0,			0700, 
	"cryptfs",	{Qcryptfs},	0,			0700, 
1991/0910    
	"kfs",		{Qkfs},		0,			0700, 
1991/0615    
}; 
Dirtab *rootmap[sizeof rootpdir/sizeof(Dirtab)]; 
1991/0910/sys/src/9/port/devroot.c:62,711991/0913/sys/src/9/port/devroot.c:58,65
1991/0615    
	i = 0; 
	if(cfslen) 
		rootmap[i++] = &rootpdir[0]; 
	if(cryptfslen) 
		rootmap[i++] = &rootpdir[1]; 
1991/0910    
	if(kfslen) 
		rootmap[i++] = &rootpdir[2]; 
1991/0913    
		rootmap[i++] = &rootpdir[1]; 
1991/0615    
	nroot = NROOT + i; 
1990/0227    
} 
 
1991/0910/sys/src/9/port/devroot.c:150,1631991/0913/sys/src/9/port/devroot.c:144,149
1991/0910    
		if(offset+n > kfslen) 
			n = kfslen - offset; 
		memmove(buf, ((char*)kfscode)+offset, n); 
1991/0613    
		return n; 
                 
	case Qcryptfs:		/* cryptfs */ 
		if(offset >= cryptfslen) 
			return 0; 
		if(offset+n > cryptfslen) 
			n = cryptfslen - offset; 
		memmove(buf, ((char*)cryptfscode)+offset, n); 
1990/0227    
		return n; 
 
	case Qdev: 
1991/0913/sys/src/9/port/devroot.c:46,521991/1109/sys/src/9/port/devroot.c:46,52 (short | long)
1991/0615    
		tab += i; 
	else 
		tab = rootmap[i - NROOT]; 
	devdir(c, tab->qid, tab->name, tab->length, tab->perm, dp); 
1991/1109    
	devdir(c, tab->qid, tab->name, tab->length, eve, tab->perm, dp); 
1991/0615    
	return 1; 
} 
 
1991/1109/sys/src/9/port/devroot.c:23,381991/1112/sys/src/9/port/devroot.c:23,38 (short | long)
1991/0910    
extern ulong	kfscode[]; 
1991/0214    
 
1990/0227    
Dirtab rootdir[]={ 
1990/11211    
	"bin",		{Qbin|CHDIR},	0,			0700, 
	"boot",		{Qboot},	0,			0700, 
	"dev",		{Qdev|CHDIR},	0,			0700, 
	"env",		{Qenv|CHDIR},	0,			0700, 
	"proc",		{Qproc|CHDIR},	0,			0700, 
1991/1112    
	"bin",		{Qbin|CHDIR},	0,			0777, 
	"boot",		{Qboot},	0,			0777, 
	"dev",		{Qdev|CHDIR},	0,			0777, 
	"env",		{Qenv|CHDIR},	0,			0777, 
	"proc",		{Qproc|CHDIR},	0,			0777, 
1990/0227    
}; 
#define	NROOT	(sizeof rootdir/sizeof(Dirtab)) 
1991/0615    
Dirtab rootpdir[]={ 
	"cfs",		{Qcfs},		0,			0700, 
1991/0910    
	"kfs",		{Qkfs},		0,			0700, 
1991/1112    
	"cfs",		{Qcfs},		0,			0777, 
	"kfs",		{Qkfs},		0,			0777, 
1991/0615    
}; 
Dirtab *rootmap[sizeof rootpdir/sizeof(Dirtab)]; 
1991/0214    
int	nroot; 
1991/1112/sys/src/9/port/devroot.c:101,1061991/1115/sys/src/9/port/devroot.c:101,107 (short | long)
1990/0227    
void	  
rootcreate(Chan *c, char *name, int omode, ulong perm) 
{ 
1991/1115    
	USED(c, name, omode, perm); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
1991/1112/sys/src/9/port/devroot.c:110,1151991/1115/sys/src/9/port/devroot.c:111,117
1990/0227    
void	  
rootclose(Chan *c) 
{ 
1991/1115    
	USED(c); 
1990/0227    
} 
 
#include	"boot.h" 
1991/1112/sys/src/9/port/devroot.c:156,1611991/1115/sys/src/9/port/devroot.c:158,164
1990/0227    
long	  
1991/0411    
rootwrite(Chan *c, void *buf, long n, ulong offset) 
1990/0227    
{ 
1991/1115    
	USED(c, buf, n, offset); 
1990/11211    
	error(Egreg); 
1990/0227    
} 
 
1991/1112/sys/src/9/port/devroot.c:162,1671991/1115/sys/src/9/port/devroot.c:165,171
1990/0227    
void	  
rootremove(Chan *c) 
{ 
1991/1115    
	USED(c); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
 
1991/1112/sys/src/9/port/devroot.c:168,1721991/1115/sys/src/9/port/devroot.c:172,177
1990/0227    
void	  
rootwstat(Chan *c, char *dp) 
{ 
1991/1115    
	USED(c, dp); 
1990/11211    
	error(Eperm); 
1990/0227    
} 
1991/1115/sys/src/9/port/devroot.c:9,201991/1206/sys/src/9/port/devroot.c:9,21 (short | long)
1990/0227    
enum{ 
	Qdir, 
	Qbin, 
	Qboot, 
1991/0214    
	Qcfs, 
1990/0227    
	Qdev, 
	Qenv, 
1991/0910    
	Qkfs, 
1990/0227    
	Qproc, 
1991/1206    
 
	Qboot, 
	Qcfs, 
	Qkfs, 
1990/0227    
}; 
 
1991/0214    
extern long	cfslen; 
1991/1115/sys/src/9/port/devroot.c:21,261991/1206/sys/src/9/port/devroot.c:22,29
1991/0216    
extern ulong	cfscode[]; 
1991/0910    
extern long	kfslen; 
extern ulong	kfscode[]; 
1991/1206    
extern ulong	bootlen; 
extern ulong	bootcode[]; 
1991/0214    
 
1990/0227    
Dirtab rootdir[]={ 
1991/1112    
	"bin",		{Qbin|CHDIR},	0,			0777, 
1991/1115/sys/src/9/port/devroot.c:83,881991/1206/sys/src/9/port/devroot.c:86,95
1990/0227    
int	  
rootwalk(Chan *c, char *name) 
{ 
1991/1206    
	if(strcmp(name, "..") == 0) { 
		c->qid.path = Qdir|CHDIR; 
		return 1; 
	} 
1991/0615    
	return devwalk(c, name, rootdir, nroot, rootgen); 
1990/0227    
} 
 
1991/1115/sys/src/9/port/devroot.c:114,1211991/1206/sys/src/9/port/devroot.c:121,126
1991/1115    
	USED(c); 
1990/0227    
} 
 
#include	"boot.h" 
                 
long	  
1991/0411    
rootread(Chan *c, void *buf, long n, ulong offset) 
1990/0227    
{ 
1991/1115/sys/src/9/port/devroot.c:125,1341991/1206/sys/src/9/port/devroot.c:130,139
1991/0615    
		return devdirread(c, buf, n, rootdir, nroot, rootgen); 
1990/0227    
 
	case Qboot:		/* boot */ 
1991/0411    
		if(offset >= sizeof bootcode) 
1991/1206    
		if(offset >= bootlen) 
1990/0227    
			return 0; 
1991/0411    
		if(offset+n > sizeof bootcode) 
			n = sizeof bootcode - offset; 
1991/1206    
		if(offset+n > bootlen) 
			n = bootlen - offset; 
1991/0411    
		memmove(buf, ((char*)bootcode)+offset, n); 
1991/0214    
		return n; 
 
1991/1206/sys/src/9/port/devroot.c:3,91992/0111/sys/src/9/port/devroot.c:3,9 (short | long)
Move error.h to ../port. Change errors to actual strings.
rsc Fri Mar 4 12:44:25 2005
1990/0227    
#include	"mem.h" 
#include	"dat.h" 
#include	"fns.h" 
#include	"errno.h" 
1992/0111    
#include	"../port/error.h" 
1990/0227    
#include	"devtab.h" 
 
enum{ 
1992/0111/sys/src/9/port/devroot.c:12,171992/0213/sys/src/9/port/devroot.c:12,18 (short | long)
1990/0227    
	Qdev, 
	Qenv, 
	Qproc, 
1992/0213    
	Qnet, 
1991/1206    
 
	Qboot, 
	Qcfs, 
1992/0111/sys/src/9/port/devroot.c:31,361992/0213/sys/src/9/port/devroot.c:32,38
1991/1112    
	"dev",		{Qdev|CHDIR},	0,			0777, 
	"env",		{Qenv|CHDIR},	0,			0777, 
	"proc",		{Qproc|CHDIR},	0,			0777, 
1992/0213    
	"net",		{Qnet|CHDIR},	0,			0777, 
1990/0227    
}; 
#define	NROOT	(sizeof rootdir/sizeof(Dirtab)) 
1991/0615    
Dirtab rootpdir[]={ 
1992/0213/sys/src/9/port/devroot.c:158,1641992/0215/sys/src/9/port/devroot.c:158,163 (short | long)
1990/0227    
	case Qdev: 
		return 0; 
	} 
1990/11211    
	error(Egreg); 
1990/0227    
	return 0; 
} 
 
1992/0215/sys/src/9/port/devroot.c:45,561992/0225/sys/src/9/port/devroot.c:45,58 (short | long)
1991/0615    
int 
rootgen(Chan *c, Dirtab *tab, int ntab, int i, Dir *dp) 
{ 
	if(tab==0 || i>=ntab) 
1992/0225    
	if(i >= nroot) 
1991/0615    
		return -1; 
1992/0225    
 
1991/0615    
	if(i < NROOT) 
		tab += i; 
1992/0225    
		tab = &rootdir[i]; 
1991/0615    
	else 
		tab = rootmap[i - NROOT]; 
1992/0225    
 
1991/1109    
	devdir(c, tab->qid, tab->name, tab->length, eve, tab->perm, dp); 
1991/0615    
	return 1; 
} 
1992/0215/sys/src/9/port/devroot.c:92,971992/0225/sys/src/9/port/devroot.c:94,101
1991/1206    
		c->qid.path = Qdir|CHDIR; 
		return 1; 
	} 
1992/0225    
	if((c->qid.path & ~CHDIR) != Qdir) 
		error(Enonexist); 
1991/0615    
	return devwalk(c, name, rootdir, nroot, rootgen); 
1990/0227    
} 
 
1992/0225/sys/src/9/port/devroot.c:95,1011992/0226/sys/src/9/port/devroot.c:95,101 (short | long)
1991/1206    
		return 1; 
	} 
1992/0225    
	if((c->qid.path & ~CHDIR) != Qdir) 
		error(Enonexist); 
1992/0226    
		return 0; 
1991/0615    
	return devwalk(c, name, rootdir, nroot, rootgen); 
1990/0227    
} 
 
1992/0226/sys/src/9/port/devroot.c:1,51992/0321/sys/src/9/port/devroot.c:1,5 (short | long)
Move lib.h to ../port.
rsc Fri Mar 4 12:44:25 2005
1990/0227    
#include	"u.h" 
#include	"lib.h" 
1992/0321    
#include	"../port/lib.h" 
1990/0227    
#include	"mem.h" 
#include	"dat.h" 
#include	"fns.h" 
1992/0321/sys/src/9/port/devroot.c:170,1751992/0520/sys/src/9/port/devroot.c:170,176 (short | long)
1990/0227    
{ 
1991/1115    
	USED(c, buf, n, offset); 
1990/11211    
	error(Egreg); 
1992/0520    
	return 0;	/* not reached */ 
1990/0227    
} 
 
void	  
Too many diffs (26 > 25). Stopping.


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