diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-06 07:14:40 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-06 07:14:40 -0500 |
commit | b852278f33d6b280eed4107301e73ece96080ee5 (patch) | |
tree | e854fc36fb0b8d073aa4b96c12fd0702af8503f4 | |
parent | 8ac5097c3f7c70788d175933fcbf6ca65788f16b (diff) | |
download | gpsd-b852278f33d6b280eed4107301e73ece96080ee5.tar.gz |
Comment and documentation polishing.
-rw-r--r-- | libgps.xml | 6 | ||||
-rw-r--r-- | libgps_shm.c | 2 | ||||
-rw-r--r-- | ntpshmread.c | 8 |
3 files changed, 11 insertions, 5 deletions
@@ -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)); |