 4f294c247f
			
		
	
	
		4f294c247f
		
	
	
	
	
		
			
			This patch mainly copies and modifies files existing in the current libc implementing minix specific functions. To keep consisten with the NetBSD libc, we remove namespace stubs and we use "namespace.h" and weak links.
		
			
				
	
	
		
			28 lines
		
	
	
		
			393 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			393 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
| gettimeofday.c
 | |
| */
 | |
| 
 | |
| #include <sys/cdefs.h>
 | |
| #include "namespace.h"
 | |
| #include <lib.h>
 | |
| 
 | |
| #include <sys/time.h>
 | |
| 
 | |
| #ifdef __weak_alias
 | |
| __weak_alias(gettimeofday, _gettimeofday)
 | |
| #endif
 | |
| 
 | |
| int gettimeofday(struct timeval *_RESTRICT tp, void *_RESTRICT tzp)
 | |
| {
 | |
|   message m;
 | |
| 
 | |
|   if (_syscall(PM_PROC_NR, GETTIMEOFDAY, &m) < 0)
 | |
|   	return -1;
 | |
| 
 | |
|   tp->tv_sec = m.m2_l1;
 | |
|   tp->tv_usec = m.m2_l2;
 | |
| 
 | |
|   return 0;
 | |
| }
 | |
| 
 |