iPXE
Functions
ntpmgmt.c File Reference

NTP management. More...

#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <ipxe/ntp.h>
#include <ipxe/monojob.h>
#include <usr/ntpmgmt.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
int ntp (const char *hostname)
 Get time and date via NTP.

Detailed Description

NTP management.

Definition in file ntpmgmt.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
int ntp ( const char *  hostname)

Get time and date via NTP.

Parameters:
hostnameHostname
Return values:
rcReturn status code

Definition at line 45 of file ntpmgmt.c.

References monojob, monojob_wait(), NULL, rc, and start_ntp().

Referenced by ntp_exec(), ntp_expired(), and start_ntp().

                                 {
        int rc;

        /* Start NTP client */
        if ( ( rc = start_ntp ( &monojob, hostname ) ) != 0 )
                return rc;

        /* Wait for NTP to complete */
        if ( ( rc = monojob_wait ( NULL, 0 ) ) != 0 )
                return rc;

        return 0;
}