summaryrefslogtreecommitdiff
path: root/shmexport.c
Commit message (Collapse)AuthorAgeFilesLines
* Initial creation of os_compat.h.Fred Wright2017-01-221-1/+0
| | | | | | | | | | | | | | | | | This creates a header for os_compat.c, and moves the related prototypes into it from gpsd_config.h (as created by SConstruct), after adding references to it to gpsd.h (via gpsd.h-tail) and a few other sources that need it but don't include gpsd.h. It also removes includes of <time.h> in the places where they were only needed for the code now removed from gpsd_config.h. TESTED: Ran "scons build-all check" on OSX 10.9 (with strlcat/strlcpy but no clock_gettime), OSX 10.12 (with strlcat/strlcpy and clock_gettime), and Ubuntu 14 (with clock_gettime but no strlcat/strlcpy). Also verified that fallback versions were not being included where unnecessary.
* sys/ipc.h needs XOPEN_SOURCE 500Gary E. Miller2016-08-151-0/+4
| | | | XOPEN_SOURCE 500 means X/Open 1995. Seems saef enough.
* Do not let the SHM linger forever.Gary E. Miller2016-04-151-0/+12
| | | | | If the SHM hangs around, and then the size increases, then the SHM can no longer be opened.
* Tweak a commment about SHMMEM handling.Gary E. Miller2015-10-051-0/+5
|
* Use correct size of segment for shared-mem exportZbigniew Chyla2015-04-281-3/+3
| | | | | | | | | | | The gpsd exports data to clients via shared-memory using struct shmexport_t, which contains both a copy of struct gps_data_t and additional fields. However, when allocating shared memory via shmget(), it was passing sizeof(struct gps_data_t) as size of the whole segment. The bug may cause gpsd crash in case the size of gps_data_t is equal to or slightly smaller than a multiple of PAGE_SIZE.
* Replace overly complex memcpy with struct assignmentZbigniew Chyla2015-04-281-3/+1
|
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-4/+0
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* OS X needs a lot of time.hGary E. Miller2015-03-081-0/+1
| | | | | | gpsd_config.h needs time_t which is in time.h OS X builds now. Untested.
* gpsd-report() -> gpsd_log()Eric S. Raymond2015-03-071-12/+13
| | | | | | | | | | | | | | | | This change is done so we can add a "log" hook to the pps_thread_t structure (this is not done yet) and harmonize with the name of the outer logging function. If that name had been left as gpsd_report() there would have been scope for bad confusion with the report_hook member. Also, remove two stray duplicative printf calls from the NMEA2000 driver (drivers shouldn't have printfs!) and fix one typo. This is a step towards factoring out ntplib. For that to happen, the PPS thread code needs to be decoupled from the core session structure. No logic changes. Object compatibility preserved. All regression tests pass.
* Repair the logic for setting a non-default SHM export segment.Eric S. Raymond2015-02-161-3/+3
| | | | | | Also, ensure this always happens within the regression-test driver. All regression tests pass.
* Tweak instrumentation to find out why alternate export segment isn't being set.Eric S. Raymond2015-02-161-4/+9
| | | | All regression tests pass. No logic changes.
* Instrument shm segment creation a bit better.Eric S. Raymond2015-02-111-3/+3
| | | | All regression tests pass.
* BSD compiler waening and splint cleanup.Eric S. Raymond2015-02-111-0/+2
|
* Implement and document GPSD_SHM_KEY environment variable.Eric S. Raymond2015-02-091-3/+4
|
* Fix clang's only warning in non-test code, about a cast in the shmexport code.Eric S. Raymond2015-01-271-2/+2
| | | | | | | All regression tests pass with both gcc- and clang-built binaries. One clang warning remains in the JSON test code.
* Now that the transition is done we can restore the gpsd_report name.Eric S. Raymond2014-08-271-3/+3
| | | | All regression tests pass.
* The big leap. Most instances of gpsd_report are replaced...Eric S. Raymond2014-08-271-3/+3
| | | | | | | | | | | | | | | | ...with calls to gps_notify(), which indirects to its output method through a slot in an errout structure. Usually the errout structure lives inside the session context, but because struct errout_t is its own thing this does not have to be the case. One large clique of gpsd_notify() calls, in packet.c and isgps.c, looks at a struct errout_t copy in a lexer control block This change is not complete. Remnant gpsd_report calls need to be changed, and gpsmon needs to be tweaked so that the struct_error_t in its context is a non-defaukt hook updating the cuses display rather than simply dumping to stderr. Also the report label functionality needs to be added. All regression tests pass.
* Introduce struct errout_t to encapsulate error-reporting hooks.Eric S. Raymond2014-08-271-3/+3
| | | | | | A major step towards eliminating reverse linkage. All regression tests pass.
* First part of Android port patches: deal with in_port_t. SUN_LEN, and getsid().Eric S. Raymond2014-08-181-2/+4
| | | | | | | | | Also, fix how configuratuin in libgps_shm.c and smexport.h is handled. Based on a patch by Samuel Cuella <samuel.cuella@supinfo.com>, but cleaned up some to obey local conventions better. All regression tests pass.
* Clarifying name change. All regression test pass. PPS is live.Eric S. Raymond2013-11-061-3/+3
|
* Repair outdated comment.Eric S. Raymond2013-11-011-2/+1
|
* Change gpsd_report to no longer use a global. All regression tests pass.Eric S. Raymond2013-09-291-3/+5
| | | | | | | | This is a large, ugly change. But without it we can't troubleshoot the ICP/IP-source initialization bug properly - colliding definitions of gpsd_report() were interfering with error reporting early in gpsd runs. More cleanup work remains to be done, but at least this is working.
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-5/+5
|
* First cut at implementing waiting test for shm export.Eric S. Raymond2011-10-031-2/+3
| | | | Timeout argument is presently ignored.
* Be extra careful about a USE_QT case.Eric S. Raymond2011-03-281-0/+4
|
* Improve the barrier code and beat GCC harder about not reordering operations.Eric S. Raymond2011-03-281-1/+1
|
* The shm transport finallly works through gps_open().Eric S. Raymond2011-03-281-0/+1
|
* Change return values in the shm interface to be more like socket export.Eric S. Raymond2011-03-271-2/+4
| | | | All regression tests pass. Code splints clean. shm live-testing works.
* Move the memory barrier instructions into the header fileBeat Bolli2011-03-271-6/+2
| | | | | | This allows adding other compilers and/or architectures later as needed. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Re-identify most *_IS flags with corresponding *_SET flags.Eric S. Raymond2011-03-271-1/+1
| | | | | | | | | | | Required so clients looking at flag masks in data exported via the shared-memory interface will see the right thing. These were separated originally in order to avoid pushing the reqyuired width of the gpsdata.set flag mask over 32 bits. It became 64 bits in the Version 5 API change, so that constraint went away. All regression tests pass.
* Startlingly, memcpy() is *less* of a problem for the seqlock than I thought.Eric S. Raymond2011-03-261-1/+1
|
* Casts can easily screw you up.Eric S. Raymond2011-03-251-5/+23
| | | | All regression tests pass, *with* shm export configured on.
* First cut at shared-memory export. Daemon-side only.Eric S. Raymond2011-03-251-0/+79
Not configured in by default yet because it produces a strange regression failure.