summaryrefslogtreecommitdiff
path: root/os_compat.h
Commit message (Collapse)AuthorAgeFilesLines
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* Enable Windows version of gpspipeRobert Norris2017-03-051-0/+6
| | | | | | | | | | | | | | | | Use recv() rather than read() for Windows compatibility. Disable serial port code not available on Windows. Add open flag that's not available on Windows. TESTED: Built gpspipe for Windows under cross compiler. Run gpspipe on a Windows system and successfully connects to an instance of gpsd and dumps NMEA output to the terminal or a specified output file. Still builds and runs on a Linux system including the daemon option. Signed-off-by: Fred Wright <fw@fwright.net>
* OS syslog compatibility fallback.Robert Norris2017-03-051-0/+32
| | | | | | | | | | | | | | | | Mainly for Windows systems which doesn't have syslog(). Implement simple fallback to print to stderr, rather than a more complicated use of Windows Event Log. Also basic fallbacks for openlog() and closelog() which don't really do anything. TESTED: Functions build on Windows cross build 'scons build-all check' passes on Linux Signed-off-by: Fred Wright <fw@fwright.net>
* Adds default SIGHUP/SIGQUIT defs for non-POSIX builds.Fred Wright2017-03-041-0/+9
| | | | | | | | | | | This avoids some build errors on platforms like Windows. Most likely signal() and sigaction() will fail for unsupported signals, but all the GPSD code ignores any such failures, anyway. The definitions match the POSIX values, so they won't collide with other signals on any platform that uses the POSIX numbers for the supported signals. TESTED: Ran "scons build-all" on OSX.
* Centralizes daemon() calls.Fred Wright2017-01-221-0/+13
| | | | | | | | | | | | | | | | This defines a new function os_daemon() (in os_compat.c), which is either the old replacement daemon() renamed, or a wrapper around the actual daemon() call. This allows any issues related to daemon() (which exist on some platforms) to be dealt with in one place. No such changes are present yet, so platforms giving warnings for the use of daemon() continue to do so, but now only in the compilation of os_compat.c. Unfortunately, the current build procedure typically compiles os_compat.c multiple times, so the warnings still appear multiple times. TESTED: Ran "scons build-all check" on OSX 10.9, OSX 10.12, Ubuntu 14, and FreeBSD 10.3.
* Initial creation of os_compat.h.Fred Wright2017-01-221-0/+67
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.