mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Prefer monotonic clock for DNS lookup timeouts
@ 2022-12-01 11:24 Gregor Jasny
  2022-12-01 15:11 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Gregor Jasny @ 2022-12-01 11:24 UTC (permalink / raw)
  To: musl

Hello,

while looking for a reason for a failed DNS resolve I noticed that
the mtime function which is used to calculate and decide on the timeout 
uses the wall clock instead of a monotonic clock:

static unsigned long mtime()
{
	struct timespec ts;
	clock_gettime(CLOCK_REALTIME, &ts);
	return (unsigned long)ts.tv_sec * 1000
		+ ts.tv_nsec / 1000000;
}

http://git.musl-libc.org/cgit/musl/tree/src/network/res_msend.c#n28

Is this a bug or intentional?

Thanks,
Gregor

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-30  3:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 11:24 [musl] Prefer monotonic clock for DNS lookup timeouts Gregor Jasny
2022-12-01 15:11 ` Rich Felker
2022-12-30  3:20   ` A. Wilcox
2022-12-30  3:21     ` [musl] [PATCH] dns: " A. Wilcox

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).