mailing list of musl libc
 help / color / mirror / code / Atom feed
aa137fa75e5018f8b6a0f64349d0201afdc66274 blob 756 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
 
#include <time.h>
#include <errno.h>
#include "syscall.h"

#define IS32BIT(x) !((x)+0x80000000ULL>>32)

int clock_settime(clockid_t clk, const struct timespec *ts)
{
#ifdef SYS_clock_settime64
	static int use_clock_settime64 = 1;
	time_t s = ts->tv_sec;
	long ns = ts->tv_nsec;
	int r = -ENOSYS;
	if (use_clock_settime64) {
		if (SYS_clock_settime == SYS_clock_settime64 || !IS32BIT(s))
			r = __syscall(SYS_clock_settime64, clk,
				((long long[]){s, ns}));
		if (SYS_clock_settime == SYS_clock_settime64 || r!=-ENOSYS)
			return __syscall_ret(r);
		else use_clock_settime64 = 0;
	}
	if (!IS32BIT(s))
		return __syscall_ret(-ENOTSUP);
	return syscall(SYS_clock_settime, clk, ((long[]){s, ns}));
#else
	return syscall(SYS_clock_settime, clk, ts);
#endif
}
debug log:

solving aa137fa7 ...
found aa137fa7 in https://inbox.vuxu.org/musl/CAHHiRUTn__COy59J78MMGSyU52Fyn7HBJdzrM6VvcuFq5Rj6HQ@mail.gmail.com/
found 1004ed15 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 1004ed15284621129789270d0f97e30c5c462095	src/time/clock_settime.c

applying [1/1] https://inbox.vuxu.org/musl/CAHHiRUTn__COy59J78MMGSyU52Fyn7HBJdzrM6VvcuFq5Rj6HQ@mail.gmail.com/
diff --git a/src/time/clock_settime.c b/src/time/clock_settime.c
index 1004ed15..aa137fa7 100644

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

index at:
100644 aa137fa75e5018f8b6a0f64349d0201afdc66274	src/time/clock_settime.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).