37 int shmid = shmget( (key_t) (
NTPD_BASE + unit ),
38 sizeof(
struct shmTime ), IPC_CREAT | 0644 );
42 syslog( LOG_ERR,
"shmget %i failed: %s", unit, strerror( errno ) );
47 p = (
struct shmTime *) shmat( shmid, 0, 0 );
49 if ( (
long) p == -1L )
51 syslog( LOG_ERR,
"shmat %i failed: %s", unit, strerror( errno ) );
75 syslog( LOG_WARNING,
"** Failed to initialize NTP SHM unit %i", u );
80 memset( p, 0,
sizeof( *p ) );
86 syslog( LOG_INFO,
"NTP SHM unit %i initialized successfully", u );
struct shmTime * getShmTime(int unit)
int ntpshm_init(struct shmTime **shmTime, int n_units, int n_unit0)
Structure of NTP's shared memory segment.
#define NTPD_BASE
Basic SHM unit identifier (unit 0)