mailing list of musl libc
 help / color / mirror / code / Atom feed
36cc60535562aeabaa5c865fab60fa87c2153b86 blob 982 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
 
#include "time32.h"
#include <time.h>
#include <sys/time.h>
#include <sys/timex.h>
#include <string.h>
#include <stddef.h>

struct oldtimex {
	unsigned modes;
	long offset, freq, maxerror, esterror;
	int status;
	long constant, precision, tolerance;
	long time_sec, time_usec;
	long tick, ppsfreq, jitter;
	int shift;
	long stabil, jitcnt, calcnt, errcnt, stbcnt;
	int tai;
	int __padding[11];
};

int __clock_adjtime32(clockid_t clock_id, struct timex *tx32)
{
	struct timex utx;
	memcpy(&utx, tx32, sizeof(struct oldtimex));
	utx.time.tv_sec =
		*(long *)((char *)tx32 + offsetof(struct oldtimex,time_sec));
	utx.time.tv_usec =
		*(long *)((char *)tx32 + offsetof(struct oldtimex,time_usec));
	int r = clock_adjtime(clock_id, &utx);
	if (r<0) return r;
	memcpy(tx32, &utx, sizeof(struct oldtimex));
	*(long *)((char *)tx32 + offsetof(struct oldtimex,time_sec)) =
		utx.time.tv_sec;
	*(long *)((char *)tx32 + offsetof(struct oldtimex,time_usec)) =
		utx.time.tv_usec;
	return r;
}
debug log:

solving 36cc6053 ...
found 36cc6053 in https://inbox.vuxu.org/musl/20190802214433.GA25193@brightrain.aerifal.cx/

applying [1/1] https://inbox.vuxu.org/musl/20190802214433.GA25193@brightrain.aerifal.cx/
diff --git a/compat/time32/clock_adjtime32.c b/compat/time32/clock_adjtime32.c
new file mode 100644
index 00000000..36cc6053

Checking patch compat/time32/clock_adjtime32.c...
Applied patch compat/time32/clock_adjtime32.c cleanly.

index at:
100644 36cc60535562aeabaa5c865fab60fa87c2153b86	compat/time32/clock_adjtime32.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).