summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--build.txt5
-rw-r--r--gpsctl.c2
-rw-r--r--gpsctl.xml10
-rw-r--r--gpsd.xml9
-rw-r--r--libgps.xml10
-rw-r--r--libgps_shm.c4
-rw-r--r--shmexport.c7
8 files changed, 43 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index df96be8d..2b31e649 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
GPSD project news
Repository head:
+ The daemon's power utilization has been reduced by changing from
+ non-blocking to blocking I/O; this may be significant on mobile devices.
Better protection against false matches of Inland AIS messages; this
required a libgps version bump to 22 (as a side effect, per-device
footprint has decreased). PPS feature is no longer marked
diff --git a/build.txt b/build.txt
index 2847be60..90a13a8f 100644
--- a/build.txt
+++ b/build.txt
@@ -174,6 +174,11 @@ These are listed in rough order of devices covered as of 2013; the
PL23203 by itself accounts for over 70% of deployed USB mice. We
recommend building with pl2303, ftdi_sio, cypress_m8, and cp210x.
+We've receive a bug report that suggests the Python test framework
+requires legacy PTY support (CONFIG_LEGACY_PTYS) from the Linux
+kernel. You should make sure you're in the 'dialout' group in order
+to have permission to use these devices.
+
== How to build the software from source ==
To build gpsd for your host platform from source, simply call 'scons'
diff --git a/gpsctl.c b/gpsctl.c
index 434be095..1e62cb27 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -296,7 +296,7 @@ int main(int argc, char **argv)
case 'R': /* remove the SHM export segment */
#ifdef SHM_EXPORT_ENABLE
/*@-nullpass@*/
- status = shmget(GPSD_KEY, 0, 0);
+ status = shmget(getenv("GPSD_SHM_KEY") ? atoi(getenv("GPSD_SHM_KEY")) : GPSD_KEY, 0, 0);
if (status == -1) {
gpsd_report(&context.errout, LOG_WARN,
"GPSD SHM segment does not exist.\n");
diff --git a/gpsctl.xml b/gpsctl.xml
index 7d6d167e..5dfa8c05 100644
--- a/gpsctl.xml
+++ b/gpsctl.xml
@@ -219,6 +219,16 @@ last.</para>
</refsect1>
+<refsect1 id='environment'><title>ENVIRONMENT VARIABLES</title>
+
+<para>By setting the environment variable <envar>GPSD_SHM_KEY</envar>,
+you can control the key value used to designate the shared-memory
+segment removed with the -R option. This will be useful mainly when
+isolating test instances of <application>gpsd</application> from
+production ones.</para>
+
+</refsect1>
+
<refsect1 id='examples'><title>EXAMPLES</title>
<variablelist>
diff --git a/gpsd.xml b/gpsd.xml
index 793dafbf..bb1fbde6 100644
--- a/gpsd.xml
+++ b/gpsd.xml
@@ -772,6 +772,15 @@ Text following # on a line is ignored. Blank lines are ignored.</para>
</variablelist>
</refsect1>
+<refsect1 id='environment'><title>ENVIRONMENT VARIABLES</title>
+
+<para>By setting the environment variable <envar>GPSD_SHM_KEY</envar>,
+you can control the key value used to create the shared-memory segment
+used for communication with the client library. This will be useful
+mainly when isolating test instances of
+<application>gpsd</application> from production ones.</para>
+
+</refsect1>
<refsect1 id='standards'><title>APPLICABLE STANDARDS</title>
<para>The official NMEA protocol standards for NMEA0183 and NMEA2000
diff --git a/libgps.xml b/libgps.xml
index d9abebd5..d9f82db8 100644
--- a/libgps.xml
+++ b/libgps.xml
@@ -261,6 +261,16 @@ as in the example given below. Resources within the session object
will be properly released when it is garbage-collected.</para>
</refsect1>
+<refsect1 id='environment'><title>ENVIRONMENT VARIABLES</title>
+
+<para>By setting the environment variable <envar>GPSD_SHM_KEY</envar>,
+you can control the key value used to create shared-memory segment
+used for communication with <application>gpsd</application>. This
+will be useful mainly when isolating test instances of
+<application>gpsd</application> from production ones.</para>
+
+</refsect1>
+
<refsect1 id='example'><title>CODE EXAMPLE</title>
<para>The following is an excerpted and simplified version of the
diff --git a/libgps_shm.c b/libgps_shm.c
index c489af09..5d37f628 100644
--- a/libgps_shm.c
+++ b/libgps_shm.c
@@ -41,12 +41,12 @@ struct privdata_t
int gps_shm_open(/*@out@*/struct gps_data_t *gpsdata)
/* open a shared-memory connection to the daemon */
{
- int shmid;
+ int shmid = getenv("GPSD_SHM_KEY") ? atoi(getenv("GPSD_SHM_KEY")) : GPSD_KEY;
libgps_debug_trace((DEBUG_CALLS, "gps_shm_open()\n"));
gpsdata->privdata = NULL;
- shmid = shmget((key_t)GPSD_KEY, sizeof(struct gps_data_t), 0);
+ shmid = shmget((key_t)shmid, sizeof(struct gps_data_t), 0);
if (shmid == -1) {
/* daemon isn't running or failed to create shared segment */
return -1;
diff --git a/shmexport.c b/shmexport.c
index 1d9549d9..d4dcf01d 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -21,6 +21,7 @@ PERMISSIONS
#include <stddef.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -33,13 +34,13 @@ PERMISSIONS
bool shm_acquire(struct gps_context_t *context)
/* initialize the shared-memory segment to be used for export */
{
- int shmid;
+ int shmid = getenv("GPSD_SHM_KEY") ? atoi(getenv("GPSD_SHM_KEY")) : GPSD_KEY;
- shmid = shmget((key_t)GPSD_KEY, sizeof(struct gps_data_t), (int)(IPC_CREAT|0666));
+ shmid = shmget((key_t)shmid, sizeof(struct gps_data_t), (int)(IPC_CREAT|0666));
if (shmid == -1) {
gpsd_report(&context->errout, LOG_ERROR,
"shmget(%ld, %zd, 0666) failed: %s\n",
- (long int)GPSD_KEY,
+ (long int)shmid,
sizeof(struct gps_data_t),
strerror(errno));
return false;