mailing list of musl libc
 help / color / mirror / code / Atom feed
04d7dc64278c856ba58a166a082c093e66de7955 blob 1077 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
51
52
53
54
55
 
#include <sys/wait.h>
#include "syscall.h"

#ifndef SYS_wait4
hidden pid_t __wait4(pid_t pid, int *status, int options, void *kru, int cp)
{
	idtype_t t;
	int r;
	siginfo_t info;

	info.si_pid = 0;
	if (pid < -1) {
		t = P_PGID;
		pid = -pid;
	} else if (pid == -1) {
		t = P_ALL;
	} else if (pid == 0) {
		t = P_PGID;
	} else {
		t = P_PID;
	}

	if (cp) r = __syscall_cp(SYS_waitid, t, pid, &info, options|WEXITED, kru);
	else r = __syscall(SYS_waitid, t, pid, &info, options|WEXITED, kru);

	if (r<0) return r;

	if (info.si_pid && status) {
		int sw=0;
		switch (info.si_code) {
		case CLD_CONTINUED:
			sw = 0xffff;
			break;
		case CLD_DUMPED:
			sw = info.si_status&0x7f | 0x80;
			break;
		case CLD_EXITED:
			sw = (info.si_status&0xff) << 8;
			break;
		case CLD_KILLED:
			sw = info.si_status&0x7f;
			break;
		case CLD_STOPPED:
		case CLD_TRAPPED:
			/* see ptrace(2); the high bits of si_status can contain */
			/* PTRACE_EVENT_ values which must be preserved */
			sw = (info.si_status << 8) + 0x7f;
			break;
		}
		*status = sw;
	}

	return info.si_pid;
}
#endif
debug log:

solving 04d7dc64 ...
found 04d7dc64 in https://inbox.vuxu.org/musl/e792658a-fbaa-48bd-8704-7f9d2ec5a4ef@www.fastmail.com/

applying [1/1] https://inbox.vuxu.org/musl/e792658a-fbaa-48bd-8704-7f9d2ec5a4ef@www.fastmail.com/
diff --git a/src/internal/__wait4.c b/src/internal/__wait4.c
new file mode 100644
index 00000000..04d7dc64

Checking patch src/internal/__wait4.c...
Applied patch src/internal/__wait4.c cleanly.

index at:
100644 04d7dc64278c856ba58a166a082c093e66de7955	src/internal/__wait4.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).