Lines Matching full:shm
35 # include <sys/shm.h>
50 * SHM interface definitions
53 #define REFID "SHM" /* reference ID */
54 #define DESCRIPTION "SHM/Shared memory interface"
111 struct shmTime *shm; /* pointer to shared memory segment */ member
145 msyslog(LOG_ERR, "SHM shmget (unit %d): %m", unit); in getShmTime()
150 msyslog(LOG_ERR, "SHM shmat (unit %d): %m", unit); in getShmTime()
168 msyslog(LOG_ERR, "SHM name too long (unit %d)", unit); in getShmTime()
173 msyslog(LOG_ERR,"SHM InitializeSecurityDescriptor (unit %d): %m", unit); in getShmTime()
177 msyslog(LOG_ERR, "SHM SetSecurityDescriptorDacl (unit %d): %m", unit); in getShmTime()
191 msyslog(LOG_ERR, "SHM CreateFileMapping (unit %d): %s", unit, buf); in getShmTime()
200 msyslog(LOG_ERR,"SHM MapViewOfFile (unit %d): %s", unit, buf); in getShmTime()
231 up->shm = getShmTime(unit, up->forall); in shm_start()
237 if (up->shm != 0) { in shm_start()
239 up->shm->precision = PRECISION; in shm_start()
240 peer->precision = up->shm->precision; in shm_start()
241 up->shm->valid = 0; in shm_start()
242 up->shm->nsamples = NSAMPLES; in shm_start()
306 (void)shmdt((char *)up->shm); in shm_shutdown()
310 UnmapViewOfFile(up->shm); in shm_shutdown()
345 } else if (NULL == up->shm) { /* is this possible at all? */ in shm_poll()
346 /* we're out of business without SHM access */ in shm_poll()
383 /* try to grab a sample from the specified SHM segment */ in shm_query()
386 volatile struct shmTime *shm = shm_in; in shm_query() local
392 * This is the main routine. It snatches the time from the shm in shm_query()
395 if (shm == NULL) { in shm_query()
410 if (shm->valid == 0) { in shm_query()
415 cnt = shm->count; in shm_query()
423 memcpy(&shmcopy, (void*)(uintptr_t)shm, sizeof(struct shmTime)); in shm_query()
424 shm->valid = 0; in shm_query()
432 if (shmcopy.mode > 0 && cnt != shm->count) { in shm_query()
514 * This tries to grab a sample from the SHM segment, filtering bad ones
525 volatile struct shmTime *shm; in shm_timer() local
540 if ((shm = up->shm) == NULL) { in shm_timer()
543 shm = up->shm = getShmTime(unit, up->forall); in shm_timer()
544 if (shm == NULL) { in shm_timer()
545 DPRINTF(1, ("%s: no SHM segment\n", in shm_timer()
552 status = shm_query(shm, &shm_stat); in shm_timer()
556 DPRINTF(2, ("%s: SHM type %d sample\n", in shm_timer()
563 DPRINTF(1, ("%s: SHM not ready\n",refnumtoa(&peer->srcadr))); in shm_timer()
567 DPRINTF(1, ("%s: SHM type blooper, mode=%d\n", in shm_timer()
568 refnumtoa(&peer->srcadr), shm->mode)); in shm_timer()
570 msyslog (LOG_ERR, "SHM: bad mode found in shared memory: %d", in shm_timer()
571 shm->mode); in shm_timer()
576 msyslog (LOG_NOTICE, "SHM: access clash in shared memory"); in shm_timer()
580 DPRINTF(1, ("%s: internal error, unknown SHM fetch status\n", in shm_timer()
582 msyslog (LOG_NOTICE, "internal error, unknown SHM fetch status"); in shm_timer()
609 DPRINTF(1, ("%s:SHM stale/bad receive time, delay=%llds\n", in shm_timer()
612 msyslog (LOG_ERR, "SHM: stale/bad receive time, delay=%llds", in shm_timer()
622 DPRINTF(1, ("%s: SHM diff limit exceeded, delta=%llds\n", in shm_timer()
625 msyslog (LOG_ERR, "SHM: difference limit exceeded, delta=%llds\n", in shm_timer()
631 DPRINTF(2, ("%s: SHM feeding data\n", in shm_timer()