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

1990/0918/gnot/sysfile.c (diff list | history)

1990/0918/sys/src/9/gnot/sysfile.c:31,421990/0928/sys/src/9/gnot/sysfile.c:31,42 (short | long | prev | next)
1990/03091    
 
	if(fd<0 || NFD<=fd || (c=u->fd[fd])==0) 
		error(0, Ebadfd); 
	if(mode<0 || c->mode == 2) 
1990/0928    
	if(mode<0 || c->mode==ORDWR) 
1990/03091    
		return c; 
	if((mode&16) && c->mode==0) 
1990/0928    
	if((mode&OTRUNC) && c->mode==OREAD) 
1990/03091    
    err: 
		error(0, Ebadusefd); 
	if((mode&~16) != c->mode) 
1990/0928    
	if((mode&~OTRUNC) != c->mode) 
1990/03091    
		goto err; 
	return c; 
} 


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