mailing list of musl libc
 help / color / mirror / code / Atom feed
bfc753ee79e787a03e483241c3c197eb65f276bd blob 1098 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
#include <time.h>

/* There is no other implemented value than TIME_UTC; all other values
 * are considered erroneous. */
int timespec_get(struct timespec * ts, int base)
{
	clockid_t clockid = -1;
	switch (base) {
	default:
		return 0;
	case TIME_UTC:
		clockid = CLOCK_REALTIME;
		break;
	case TIME_MONOTONIC:
		clockid = CLOCK_MONOTONIC;
		break;
	case TIME_PROCESS_CPUTIME_ID:
		clockid = CLOCK_PROCESS_CPUTIME_ID;
		break;
	case TIME_THREAD_CPUTIME_ID:
		clockid = CLOCK_THREAD_CPUTIME_ID;
		break;
	case TIME_MONOTONIC_RAW:
		clockid = CLOCK_MONOTONIC_RAW;
		break;
	case TIME_REALTIME_COARSE:
		clockid = CLOCK_REALTIME_COARSE;
		break;
	case TIME_MONOTONIC_COARSE:
		clockid = CLOCK_MONOTONIC_COARSE;
		break;
	case TIME_BOOTTIME:
		clockid = CLOCK_BOOTTIME;
		break;
	case TIME_REALTIME_ALARM:
		clockid = CLOCK_REALTIME_ALARM;
		break;
	case TIME_BOOTTIME_ALARM:
		clockid = CLOCK_BOOTTIME_ALARM;
		break;
	case TIME_SGI_CYCLE:
		clockid = CLOCK_SGI_CYCLE;
		break;
	case TIME_TAI:
		clockid = CLOCK_TAI;
		break;
	}
	int ret = __clock_gettime(clockid, ts);
	return ret < 0 ? 0 : base;
}
debug log:

solving bfc753ee ...
found bfc753ee in https://inbox.vuxu.org/musl/20230620002507.796-4-luoyonggang@gmail.com/
found 40ea9c1c in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 40ea9c1c32682d25b9f51279588d73f4f170e2a0	src/time/timespec_get.c

applying [1/1] https://inbox.vuxu.org/musl/20230620002507.796-4-luoyonggang@gmail.com/
diff --git a/src/time/timespec_get.c b/src/time/timespec_get.c
index 40ea9c1c..bfc753ee 100644

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

index at:
100644 bfc753ee79e787a03e483241c3c197eb65f276bd	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).