mailing list of musl libc
 help / color / mirror / code / Atom feed
b8738189322240a706a4c7c5310abb377f1bdbbb blob 1072 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_ACTIVE:
		clockid = CLOCK_PROCESS_CPUTIME_ID;
		break;
	case TIME_THREAD_ACTIVE:
		clockid = CLOCK_THREAD_CPUTIME_ID;
		break;
	case TIME_MONOTONIC_RAW:
		clockid = CLOCK_MONOTONIC_RAW;
		break;
	case TIME_UTC_COARSE:
		clockid = CLOCK_REALTIME_COARSE;
		break;
	case TIME_MONOTONIC_COARSE:
		clockid = CLOCK_MONOTONIC_COARSE;
		break;
	case TIME_BOOTTIME:
		clockid = CLOCK_BOOTTIME;
		break;
	case TIME_UTC_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 b8738189 ...
found b8738189 in https://inbox.vuxu.org/musl/20230620074427.131-2-luoyonggang@gmail.com/ ||
	https://inbox.vuxu.org/musl/20230620143703.1415-5-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/2] https://inbox.vuxu.org/musl/20230620074427.131-2-luoyonggang@gmail.com/
diff --git a/src/time/timespec_get.c b/src/time/timespec_get.c
index 40ea9c1c..b8738189 100644

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

skipping https://inbox.vuxu.org/musl/20230620143703.1415-5-luoyonggang@gmail.com/ for b8738189
index at:
100644 b8738189322240a706a4c7c5310abb377f1bdbbb	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).