mailing list of musl libc
 help / color / mirror / code / Atom feed
20080a086d29fc14731ad867fd69958f07a28ec5 blob 817 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
#include <time.h>
#include "syscall.h"
#include "atomic.h"

static int syscall_clock_gettime(clockid_t clk, struct timespec *ts)
{
	return __syscall(SYS_clock_gettime, clk, ts);
}

void *__vdsosym(const char *, const char *);

/* There is no other implemented value than TIME_UTC, all other values
   are considered erroneous. */
int timespec_get(struct timespec * ts, int base)
{
	if (base != TIME_UTC) return 0;
	int ret;
#ifdef VDSO_CGT_SYM
	static int (*cgt)(clockid_t, struct timespec *);
	if (!cgt) {
		void *f = __vdsosym(VDSO_CGT_VER, VDSO_CGT_SYM);
		if (!f) f = (void *)syscall_clock_gettime;
		a_cas_p(&cgt, 0, f);
	}
	/* The vdso variants never fail, and thus never set errno. */
	ret = cgt(CLOCK_REALTIME, ts);
#else
	ret = syscall_clock_gettime(CLOCK_REALTIME, ts);
#endif
	return ret < 0 ? 0 : base;
}
debug log:

solving 20080a0 ...
found 20080a0 in https://inbox.vuxu.org/musl/aaebc5b34089d367a4fa1a9e8f35712bcaf3c8e5.1409423162.git.Jens.Gustedt@inria.fr/

applying [1/1] https://inbox.vuxu.org/musl/aaebc5b34089d367a4fa1a9e8f35712bcaf3c8e5.1409423162.git.Jens.Gustedt@inria.fr/
diff --git a/src/time/timespec_get.c b/src/time/timespec_get.c
new file mode 100644
index 0000000..20080a0

Checking patch src/time/timespec_get.c...
Applied patch src/time/timespec_get.c cleanly.

index at:
100644 20080a086d29fc14731ad867fd69958f07a28ec5	src/time/timespec_get.c

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).