LibC: Define timezone structure
This commit is contained in:
		
							parent
							
								
									a10ca47657
								
							
						
					
					
						commit
						11b6ee423e
					
				|  | @ -22,6 +22,12 @@ struct itimerval | |||
| #define ITIMER_VIRTUAL	1 | ||||
| #define ITIMER_PROF		2 | ||||
| 
 | ||||
| struct timezone | ||||
| { | ||||
| 	int tz_minuteswest;	/* minutes west of Greenwich */ | ||||
| 	int tz_dsttime;		/* type of DST correction */ | ||||
| }; | ||||
| 
 | ||||
| int getitimer(int which, struct itimerval* value); | ||||
| int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp); | ||||
| int setitimer(int which, const struct itimerval* __restrict value, struct itimerval* __restrict ovalue); | ||||
|  |  | |||
|  | @ -6,7 +6,8 @@ | |||
| int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp) | ||||
| { | ||||
| 	// If tzp is not a null pointer, the behavior is unspecified.
 | ||||
| 	(void)tzp; | ||||
| 	if (tzp != nullptr) | ||||
| 		*static_cast<struct timezone*>(tzp) = {}; | ||||
| 
 | ||||
| 	timespec ts; | ||||
| 	clock_gettime(CLOCK_REALTIME, &ts); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue