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

2000/0516/mpc/devsac.c (diff list | history)

1999/1231/sys/src/9/mpc/devsac.c:6,182000/0516/sys/src/9/mpc/devsac.c:6,11 (short | long | prev | next)
1999/0608    
#include "io.h" 
1999/0609    
#include "../port/error.h" 
1999/0608    
 
/* 
 * Rather than reading /adm/users, which is a lot of work for 
 * a toy program, we assume all groups have the form 
 *	NNN:user:user: 
 * meaning that each user is the leader of his own group. 
 */ 
                 
enum 
{ 
	OPERM	= 0x3,		/* mask of all permission types in open mode */ 
1999/1231/sys/src/9/mpc/devsac.c:85,912000/0516/sys/src/9/mpc/devsac.c:78,85
1999/0608    
	Powner =	64, 
}; 
 
1999/0609    
static uchar *data = SACMEM; 
2000/0516    
static char *sacfs = "fs.sac"; 
static uchar *data; 
1999/0609    
static int blocksize; 
static Sac root; 
1999/0806    
static Cache cache[CacheSize]; 
1999/1231/sys/src/9/mpc/devsac.c:104,1122000/0516/sys/src/9/mpc/devsac.c:98,123
1999/0608    
{ 
	SacHeader *hdr; 
1999/0806    
	uchar *p; 
2000/0516    
	char *s; 
1999/0806    
	int i; 
 
1999/0609    
print("sacinit\n"); 
2000/0516    
	s = getconf("flash"); 
	if(s == nil) { 
		print("devsac: no flash file system\n"); 
		return; 
	} 
 
	p = (uchar*)strtoul(s, 0, 0); 
	if(p == 0) { 
		print("devsac: bad address for flash file system\n"); 
		return; 
	} 
	data = tarlookup(p, sacfs, &i); 
	if(data == 0) { 
		print("devsac: could not find file: %s\n", sacfs); 
		return; 
	} 
1999/0608    
	hdr = (SacHeader*)data; 
	if(getl(hdr->magic) != Magic) { 
1999/0609    
print("devsac: bad magic\n"); 


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