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)
 
 FILE_SECBOOT (PERMITTED)
 
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  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ ntp()

int ntp ( const char *  hostname)

Get time and date via NTP.

Parameters
hostnameHostname
Return values
rcReturn status code

Definition at line 46 of file ntpmgmt.c.

46  {
47  int rc;
48 
49  /* Start NTP client */
50  if ( ( rc = start_ntp ( &monojob, hostname ) ) != 0 )
51  return rc;
52 
53  /* Wait for NTP to complete */
54  if ( ( rc = monojob_wait ( NULL, 0 ) ) != 0 )
55  return rc;
56 
57  return 0;
58 }
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:82
int start_ntp(struct interface *job, const char *hostname)
Start NTP client.
Definition: ntp.c:238
struct interface monojob
Definition: monojob.c:57
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322

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().