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. More...
 

Detailed Description

NTP management.

Definition in file ntpmgmt.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ ntp()

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.

45  {
46  int rc;
47 
48  /* Start NTP client */
49  if ( ( rc = start_ntp ( &monojob, hostname ) ) != 0 )
50  return rc;
51 
52  /* Wait for NTP to complete */
53  if ( ( rc = monojob_wait ( NULL, 0 ) ) != 0 )
54  return rc;
55 
56  return 0;
57 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
Definition: monojob.c:81
int start_ntp(struct interface *job, const char *hostname)
Start NTP client.
Definition: ntp.c:237
struct interface monojob
Definition: monojob.c:56
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

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

Referenced by ntp_close(), ntp_deliver(), ntp_exec(), ntp_expired(), ntp_request(), ntp_window_changed(), and start_ntp().