summaryrefslogtreecommitdiff
path: root/ntpshm.c
Commit message (Collapse)AuthorAgeFilesLines
* Try to move NTP link activation and deactivation up to the disparcher layer.Eric S. Raymond2011-03-241-4/+2
|
* Refactoring step. Hide the internals of NTPD communication better.Eric S. Raymond2011-03-231-4/+17
|
* Add some explanatory comments about where root privs are needed.Eric S. Raymond2011-03-231-3/+15
| | | | | Add conditioned-out code as a demonstration of how to spin the thread inexpensively until a device is open.
* Add missing include file needed for open().Gary E. Miller2011-03-231-0/+4
| | | | A side effect of the recent PPS restructuring.
* Move as much of the PPS support as possible to ntpshm.c.Eric S. Raymond2011-03-231-1/+553
| | | | All regression tests pass.
* Move a declaration so it doesn't follow executable code.Eric S. Raymond2011-03-211-1/+2
|
* Silence compiler warning about inconsistent use of volatile in ntp SHM.Gary E. Miller2011-03-211-13/+19
| | | | | | Since the ntp SHM is multithreaded we need to tell the C compiler not to optimize out our the SHM handshake. Still needs a memory barrier to be totally correct.
* thomas@mich.com pointed out that ntpd SHM needs to be volatile.Gary E. Miller2011-03-181-3/+3
| | | | | | I checked the ntpd source code and mirrored how they marked the SHM as volatile. This could prevent potential misoptimization by the C compile.
* More deheader testing. All regression tests pass.Eric S. Raymond2011-01-131-0/+1
|
* More header portability audting with a new version of deheader.Eric S. Raymond2010-12-221-1/+0
|
* More configure simplification.Eric S. Raymond2010-12-141-12/+3
|
* Unused-header removals by deheader. All regression tests pass.Eric S. Raymond2010-12-011-2/+0
|
* Good news and bad news about kernel PPS.Gary E. Miller2010-07-201-2/+5
|
* FIXME -> FIX-ME, so I can walk through these without tripping over autotools.Eric S. Raymond2010-04-261-2/+2
|
* ntpshm.c reindented. Requires live testing.Eric S. Raymond2010-04-141-66/+68
|
* Dial back logging a tadGary E. Miller2010-04-121-1/+1
|
* More ntpshm_put() changes.Gary E. Miller2010-04-121-0/+1
|
* Add some debugging and fixes to new ntpshm_pps() wrapper.Gary E. Miller2010-04-121-1/+3
|
* Vanish away Id and Rev $ keywords, git won't expand them to anything useful.Eric S. Raymond2010-03-131-1/+0
|
* Copyright stamps everywhere. No code changes.Eric S. Raymond2010-03-111-0/+3
|
* A bit more shared memory debug info in the comments.Gary E. Miller2010-02-191-0/+3
|
* Add a bit more shm debug info in the commentsGary E. Miller2010-02-191-1/+11
|
* Use %zd to print size_t value rather than assuming size_t is long.Greg Troxel2010-02-011-2/+2
| | | | | Adapted from report/patch by Hakan Johansson (sorry, no UTF-8 in commit messages it seems).
* Patch to allow gpsd to reliably work with ntpd when gpsd is not run as root. Gary E. Miller2010-01-251-18/+44
| | | | | | Plus doc improvements. >From Hakan Johansson.
* David Ludlow's housekeeping and type-cleanup patch.Eric S. Raymond2010-01-021-3/+8
| | | | All regression tests pass,
* Get rid of u_char, and some splint cleanup.Eric S. Raymond2009-12-311-1/+1
|
* Add a good comment that gpsd CAN talk to ntpd as non-root.Gary E. Miller2009-12-231-2/+14
|
* Try to be smarter about SHM permissions when starting as non-root.Gary E. Miller2009-12-231-3/+19
| | | | Improve the error message.
* WHoops, make last patch compile.Gary E. Miller2009-12-221-1/+1
|
* Remove unneccessary root test. Gary E. Miller2009-12-221-3/+10
| | | | | gpsd should be able to attach to SHM as a simple user if the perms are correct.
* Include the whole config file in gpsd.h.Eric S. Raymond2009-11-201-1/+0
| | | | | | | That is, instead of sectioning out two little config defines and putting them in. This makes gpsd.h self-copntained (e.g. in case it gets installed as a library header) and means we can get rid of most inclusions of it.
* Sorry, make the last patch compile.Gary E. Miller2009-11-181-2/+3
|
* Fix PPS precision at -16.Gary E. Miller2009-11-181-4/+7
| | | | | ntpd ignores it anyway and it saves a lot of floating point calculation.
* Make fudge explicit in ntpshm_put(), and log it..Gary E. Miller2009-11-171-3/+9
|
* Splint cleanup.Eric S. Raymond2009-11-161-1/+3
|
* Tweak a log message.Gary E. Miller2009-11-151-1/+1
|
* Shut up splint. Per Hakan Johansson.Gary E. Miller2009-11-151-2/+3
|
* Get current second from the last GPS timestamp.Gary E. Miller2009-11-141-13/+24
| | | | | | | | | ntpshm_pps was guessing the current second for the PPS from the system clock, yet we have zero trust in the system clock. So instead grab the current second from the last GPS serial timestamp. A radical change for the better, but someone will surely find improvements with experience on the code.
* More PPS cleanupGary E. Miller2009-11-141-32/+18
| | | | | | Better logs. Add errno.h to fix an earlier commit. Remove an over aggressive check.
* Improve error messages for shmget() failures.Gary E. Miller2009-11-131-3/+3
| | | | Patch from Don Weeks.
* Change logging in ntpshm_pps() so now all PPS logs are prefixed with PPS.Gary E. Miller2009-11-131-4/+5
| | | | | | | | Getting PPS logging is now this easy: gpsd -nN /dev/ttyS0 | fgrep PPS Expanded PPS capture range from 0.5S to 1S. Still more work to do in ntpshm_pps()
* Added some comments to explain the ntpd algorithmGary E. Miller2009-11-121-0/+29
| | | | | | After staring that the ->valid patch I can see no harm and a less than several billion chance that this might actually stop sending a corrupt value to ntpd.
* Håkan Johansson writes:Eric S. Raymond2009-11-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I believe the bug report 15348 and fix to be correct. What one may append to the discussion is that the variable 'valid' is dual-use: - make sure that the same measurement is not used twice, ensured as ntpd clears it after each use. - make sure that ntpd cannot read values while gpsd is making an update. (this is new) A sequence of events which realistically (but with low probability) could trigger such a thing: - NTPD makes a full read, sets valid = 0. (shortly thereafter:) - GPSD writes a new value, finishing by setting valid = 1 (almost 1 s passes...) (then by chance, GPSD makes it before NTPD:) - GPSD starts to write values, increases count, valid is still 1 (during the write operation, the write is interrupted:) - NTPD makes a full read. it can, as valid is 1 and count does not change sets valid = 0. - GPSD gets back, and finishes the write, increases count, sets valid to 1 and from this point, it can actually continue, goto 'almost 1 s passes'. ntpd could thus get a continous stream of bad, but correlated, data.
* Merge Håkan Johansson's patch to allow ntpsh as non-root.Eric S. Raymond2009-11-111-1/+4
|
* Revert Miroslav Lichvar's PPS patch of 27 Aug on Gary Miller's advice.Eric S. Raymond2009-11-041-18/+24
|
* Bride Of the Son Of Splint Cleanup.Eric S. Raymond2009-09-101-1/+5
| | | | This warning appears to actually reflect a minor bug in splint.
* Son of the Splint Cleanup.Eric S. Raymond2009-09-101-1/+1
| | | | | Major change in this set is enforcong consistency about the data type of serial parity information.
* Continuing the splint cleanup.Eric S. Raymond2009-09-101-1/+1
|
* Miroslav Lichvar <mlichvar@redhat.com> had this to say:Eric S. Raymond2009-08-271-24/+14
| | | | | | | | | | | | | | | | | | | | > I was implementing a SHM refclock for chrony (an NTP client/server) > and came across a few issues in gpsd PPS support. > > The attached patch: > - checks duration in 1Hz PPS to avoid reporting both edges > - increases the percentages of duration and cycle tolerances to 10 % > to continue reporting pulses even when chrony does fast slewing > - makes PPS samples based on previous time message instead of local > clock > - adds support for 5Hz PPS (not tested) > > I did tests only with Garmin 18x LVC. Let me know if this breaks > anything or needs to be improved before accepting. Merged into head for testing; will be backed out if problems arise. Signed-off-by: esr
* fix format warningChris Kuethe2009-01-061-2/+2
|