summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgps.xml6
-rw-r--r--libgps_shm.c2
-rw-r--r--ntpshmread.c8
3 files changed, 11 insertions, 5 deletions
diff --git a/libgps.xml b/libgps.xml
index d9f82db8..6d47282a 100644
--- a/libgps.xml
+++ b/libgps.xml
@@ -150,7 +150,11 @@ function is a convenience wrapper around a
<citerefentry><refentrytitle>select</refentrytitle><manvolnum>2</manvolnum></citerefentry>
call, and zeros <varname>errno</varname> on entry; you can test
<varname>errno</varname> after exit to get more information about
-error conditions.</para>
+error conditions. Warning: under the shared-memory interface there is
+a tiny race window between <function>gps_waiting()</function> and a
+following <function>gps_read()</function>; in that context, beause the
+latter does not block, it is probably better to write a simple read
+loop.</para>
<para><function>gps_unpack()</function> parses JSON from the argument
buffer into the target of the session structure pointer argument.
diff --git a/libgps_shm.c b/libgps_shm.c
index 9cb23e19..f55877bf 100644
--- a/libgps_shm.c
+++ b/libgps_shm.c
@@ -1,7 +1,7 @@
/****************************************************************************
NAME
- libgps_shm.c - reasder access to shared-memory export
+ libgps_shm.c - reader access to shared-memory export
DESCRIPTION
This is a very lightweight alternative to JSON-over-sockets. Clients
diff --git a/ntpshmread.c b/ntpshmread.c
index 7ca18f2b..d230f663 100644
--- a/ntpshmread.c
+++ b/ntpshmread.c
@@ -85,9 +85,11 @@ enum segstat_t shm_query(/*@null@*/struct shmTime *shm_in, /*@out@*/struct shm_s
cnt = shm->count;
/*
- * This is proof against concurrency issues if either
- * (a) the memory_barrier() call works on this host, or
- * (b) memset compiles to an uninterruptible single-instruction bitblt.
+ * This is proof against concurrency issues if either (a) the
+ * memory_barrier() call works on this host, or (b) memset
+ * compiles to an uninterruptible single-instruction bitblt (this
+ * will probably cease to be true if the structure exceeds your VM
+ * page size).
*/
memory_barrier();
memcpy((void *)&shmcopy, (void *)shm, sizeof(struct shmTime));