[time] Allow system clock to be adjusted at runtime
Provide a mechanism to allow an arbitrary adjustment to be applied to all subsequent calls to time(). Note that the underlying clock source (e.g. the RTC clock) will not be changed; only the time as reported within iPXE will be affected. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
+2
-2
@@ -39,10 +39,10 @@ struct tm {
|
||||
* @v t Time to fill in, or NULL
|
||||
* @ret time Current time
|
||||
*/
|
||||
static inline time_t time ( time_t *t ) {
|
||||
static inline __attribute__ (( always_inline )) time_t time ( time_t *t ) {
|
||||
time_t now;
|
||||
|
||||
now = time_now();
|
||||
now = ( time_now() + time_offset );
|
||||
if ( t )
|
||||
*t = now;
|
||||
return now;
|
||||
|
||||
Reference in New Issue
Block a user