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

1992/0825/port/devcons.c (diff list | history)

1992/0814/sys/src/9/port/devcons.c:188,2021992/0825/sys/src/9/port/devcons.c:188,200 (short | long | prev | next)
1990/0321    
		return 0; 
1990/0227    
	n = sprint(buf, "%s %d: ", u->p->text, u->p->pid); 
1990/06111    
	n = doprint(buf+n, buf+sizeof(buf), fmt, (&fmt+1)) - buf; 
1991/0411    
	qlock(&c->wrl); 
1990/0227    
	if(waserror()){ 
1991/0411    
		qunlock(&c->wrl); 
1990/0321    
		return 0; 
1990/0227    
	} 
1992/0825    
 
1991/0411    
	(*devtab[c->type].write)(c, buf, n, c->offset); 
1992/0825    
 
	lock(c); 
1990/0227    
	c->offset += n; 
1991/0411    
	qunlock(&c->wrl); 
1990/0321    
	poperror(); 
1992/0825    
	unlock(c); 
 
1990/0227    
	return n; 
} 
 
1992/0814/sys/src/9/port/devcons.c:887,8941992/0825/sys/src/9/port/devcons.c:885,893
1991/0705    
			error(Egreg); 
		memmove(buf, va, n);	/* so we can NUL-terminate */ 
		buf[n] = 0; 
1992/0825    
		/* start a pager if not already started */ 
1992/0310    
		if(strncmp(buf, "start", 5) == 0){ 
			kickpager();		/* start a pager if not already started */ 
1992/0825    
			kickpager(); 
1992/0310    
			break; 
		} 
1992/0725    
		if(cpuserver && strcmp(u->p->user, eve) != 0) 
1992/0814/sys/src/9/port/devcons.c:896,9021992/0825/sys/src/9/port/devcons.c:895,901
1992/0310    
		if(buf[0]<'0' || '9'<buf[0]) 
1992/0228    
			error(Ebadarg); 
1991/0705    
		fd = strtoul(buf, 0, 0); 
1991/1011    
		swc = fdtochan(fd, -1, 1); 
1992/0825    
		swc = fdtochan(fd, -1, 1, 0); 
1991/0705    
		setswapchan(swc); 
1992/0321    
		break; 
 
1992/0814/sys/src/9/port/devcons.c:932,9411992/0825/sys/src/9/port/devcons.c:931,936
1990/11211    
	error(Eperm); 
1991/1127    
} 
 
/* 
1991/1206    
 *  Rand is huge and not worth it here.  Be small. 
 *  Borrowed from the white book. 
1991/1127    
 */ 
int 
nrand(int n) 
{ 


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