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

#define IS32BIT(x) !((x)+0x80000000ULL>>32)
#define CLAMP(x) (int)(IS32BIT(x) ? (x) : 0x7fffffffU+((0ULL+(x))>>63))

static int do_sigtimedwait(const sigset_t *restrict mask, siginfo_t *restrict si, const struct timespec *restrict ts)
{
#ifdef SYS_rt_sigtimedwait_time64
	time_t s = ts ? ts->tv_sec : 0;
	long ns = ts ? ts->tv_nsec : 0;
	int r = __syscall_cp(SYS_rt_sigtimedwait_time64, mask, si,
		ts ? ((long long[]){s, ns}) : 0, _NSIG/8);
	if (SYS_rt_sigtimedwait == SYS_rt_sigtimedwait_time64 || r!=-ENOSYS)
		return r;
	return __syscall_cp(SYS_rt_sigtimedwait, mask, si,
		ts ? ((long[]){CLAMP(s), ns}) : 0, _NSIG/8);;
#else
	return __syscall_cp(SYS_rt_sigtimedwait, mask, si, ts, _NSIG/8);
#endif
}

int sigtimedwait(const sigset_t *restrict mask, siginfo_t *restrict si, const struct timespec *restrict timeout)
{
	int ret;
	do ret = do_sigtimedwait(mask, si, timeout);
	while (ret==-EINTR);
	return __syscall_ret(ret);
}
debug log:

solving 603ba912f78f ...
found 603ba912f78f in https://inbox.vuxu.org/musl/20201227184032.22413-16-alobakin@pm.me/
found 1287174ebafd in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 1287174ebafdf6114c60f1d703745e703cf28a1e	src/signal/sigtimedwait.c

applying [1/1] https://inbox.vuxu.org/musl/20201227184032.22413-16-alobakin@pm.me/
diff --git a/src/signal/sigtimedwait.c b/src/signal/sigtimedwait.c
index 1287174ebafd..603ba912f78f 100644

Checking patch src/signal/sigtimedwait.c...
Applied patch src/signal/sigtimedwait.c cleanly.

index at:
100644 603ba912f78fc32234335516e9b63234a10fe8f9	src/signal/sigtimedwait.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).