gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] ✘XCode works again


From: Fred Wright
Subject: Re: [gpsd-dev] ✘XCode works again
Date: Tue, 16 Aug 2016 14:44:23 -0700 (PDT)

On Tue, 16 Aug 2016, Gary E. Miller wrote:
> I just pushed XCode fixes for OS X.  Some new errors, and old
> warnings are now gone.
>
> Last warning:
>
> gpsd.c:1997:6: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 
> - Use posix_spawn APIs instead. [-Wdeprecated-declarations]
>         if (daemon(0, 0) != 0)
>             ^
> /usr/include/stdlib.h:267:6: note: 'daemon' has been explicitly marked 
> deprecated here
> int      daemon(int, int) __DARWIN_1050(daemon) 
> __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, 
> __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED 
> __TVOS_PROHIBITED;
>
> daemon() is about the only portable thing, and all OS seem to hate
> it.
>
> I'd like it is someone that knows XCode could fix that for OS X.

That's been on my list of things to fix for a while, though it hasn't been
a high priority.

I'm not sure about the "posix_spawn" aspect, but in general, daemons on
OSX are expected to run as children of launchd, rather than as detached
processes, and hence daemon() wouldn't be used.  So the basic idea is to
have a build option to disable the whole daemonization feature,
essentially with -N being implied (but keeping the option for command-line
compatibility).  Right now, I think OSX is the only OS where that build
option would be appropriate, but one could imagine other OSes moving to a
"managed daemon" approach at some point.

A related cleanup would be to arrange to have only one place in the source
that calls daemon().

Fred Wright



reply via email to

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