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

2001/0527/boot/settime.c (diff list | history)

2001/0527/sys/src/9/boot/settime.c:12,182001/0819/sys/src/9/boot/settime.c:12,18 (short | long | prev | next)
1992/0909    
char *timeserver = "#s/boot"; 
 
1992/0318    
void 
settime(int islocal) 
2001/0819    
settime(int islocal, int afd) 
1992/0318    
{ 
	int n, f; 
	int timeset; 
2001/0527/sys/src/9/boot/settime.c:44,602001/0819/sys/src/9/boot/settime.c:44,60
1992/0909    
		f = open(timeserver, ORDWR); 
1992/0318    
		if(f < 0) 
			return; 
2000/0310    
		if(mount(f, "/mnt", MREPL, "") < 0){ 
2001/0819    
		if(mount(f, afd, "/tmp", MREPL, "") < 0){ 
1993/0501    
			warning("settime mount"); 
1993/0330    
			close(f); 
			return; 
		} 
1992/0318    
		close(f); 
2001/0527    
		if(stat("/mnt", statbuf, sizeof statbuf) < 0) 
2001/0819    
		if(stat("/tmp", statbuf, sizeof statbuf) < 0) 
1992/0318    
			fatal("stat"); 
2001/0527    
		convM2D(statbuf, sizeof statbuf, &dir[0], (char*)&dir[1]); 
		sprint(timebuf, "%ld", dir[0].atime); 
2000/0310    
		unmount(0, "/mnt"); 
2001/0819    
		unmount(0, "/tmp"); 
1992/0318    
	} 
 
	f = open("#c/time", OWRITE); 


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