Re: [chrony-dev] [PATCH] macOS - weak linkage of clock_gettime (fixed missing include) |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH] macOS - weak linkage of clock_gettime (fixed missing include)
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Thu, 12 Mar 2020 13:00:54 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584014460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TsZpI6JMBQg/Bl38oWE6mFKjovt2Iej8M4kBVTBBEXc=; b=EQmioBW9OIUBdYUq6rtqxzOlvHPTFuRBuK3zrVP1hUeRufqxXjryR341F0j4W2pPtqQMmB e6Rr5Bfn3ChWW6xWcQ2PVtJLcMTMQ+1OvlvoBwhjC1hB+WV6UMR9Pyb3+g7IZDNw/h9IoQ qxP2hrtFGYxVwGPgqn6XYYwVz2jV90U=
On Thu, Mar 12, 2020 at 01:23:33PM +1300, Bryan Christianson wrote:
> Earlier versions of macOS do not provide clock_gettime(). This patch checks for clock_gettime() at run-time and falls back to gettimeofday() if the symbol is not present.
> LCL_ReadRawTime(struct timespec *ts)
> {
> #if HAVE_CLOCK_GETTIME
> +#ifdef MACOSX
> + SYS_MacOSX_GetTime(CLOCK_REALTIME, ts);
> + return;
> +#endif
> if (clock_gettime(CLOCK_REALTIME, ts) < 0)
> LOG_FATAL("clock_gettime() failed : %s", strerror(errno));
Hm, I don't like this system-specific code here.
How about renaming the SYS_MacOSX_GetTime to clock_gettime and keeping
the semantics so the local code can stay as it is?
--
Miroslav Lichvar
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.