gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Windows version of libgps


From: Fred Wright
Subject: Re: [gpsd-dev] Windows version of libgps
Date: Sun, 19 Feb 2017 13:09:53 -0800 (PST)

On Sun, 19 Feb 2017, Robert Norris wrote:

> Although Windows doesn't have unistd.h, the MingW system provides a
> minimal version but lacks a fork() function - so it doesn't build for
> me.

Ah OK.  I did Google unistd.h on Windows before doing this, but I don't
know anything about MingW.

> Thus it would be better if the os_daemon() versions are decided by a
> #ifdef HAVE_FORK instead.

OK.  I'll come up with an updated version.

> This then builds on my set up and I've made a couple of changes to
> gpxlogger.c to enable this to build on Windows (mostly disabling calls
> to syslog()).

Sounds like syslog() would be another good candidate for os_compat.  The
idea is to minimize the need for OS-related conditionals splattered
through the code.

> I've yet to test it running but should be a useful utility on Windows
> (although of course it will lack a daemonize option).

Yeah.  In fact, the usefulness of daemonization in utility programs is
what complicates fixing the daemon() deprecation warning in OSX.  The
reason for the warning is that "real daemons" (such as gpsd itself) are
not supposed to use old-school daemonization on OSX, but instead are
expected to be run as children of launchd.  If that were the only use,
then simply not having daemon() at all on OSX would be fine.  But it's
still useful to have the old-school approach for daemonizable utilities.

Fred Wright



reply via email to

[Prev in Thread] Current Thread [Next in Thread]