ntpshm

package
v0.0.0-...-49e71f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const IPC_CREAT = 00001000

IPC_CREAT create if key is nonexistent https://man7.org/linux/man-pages/man0/sys_ipc.h.0p.html

View Source
const NTPSHMSize = 96

NTPSHMSize is a size of NTPSHM struct

View Source
const SHMKEY = 0x4e545030

SHMKEY is a key of the first NTPD SHM segment http://doc.ntp.org/current-stable/drivers/driver28.html

Variables

This section is empty.

Functions

func Create

func Create() (uintptr, error)

Create a segment in SHM and return the ID

func Time

func Time() (time.Time, error)

Time returns time from SHM

Types

type NTPSHM

type NTPSHM struct {
	Mode                 int32
	Count                int32
	ClockTimeStampSec    int64
	ClockTimeStampUSec   int32
	ReceiveTimeStampSec  int64
	ReceiveTimeStampUSec int32
	Leap                 int32
	Precision            int32
	Nsamples             int32
	Valid                int32
	ClockTimeStampNSec   int32
	ReceiveTimeStampNSec int32
	Dummy                [8]int32
}

NTPSHM Declaration of the SHM segment from ntp (ntpd/refclock_shm.c)

func Read

func Read() (*NTPSHM, error)

Read SHM segment

func ReadID

func ReadID(id uintptr) (*NTPSHM, error)

ReadID reads SHM segment by ID

func (*NTPSHM) ClockTimeStamp

func (n *NTPSHM) ClockTimeStamp() time.Time

ClockTimeStamp returns the clock time

func (*NTPSHM) ReceiveTimeStamp

func (n *NTPSHM) ReceiveTimeStamp() time.Time

ReceiveTimeStamp returns the receive time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL