python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / security / afl / qemu-patches / syscall-glibc2_30.diff
blobaa2950bf157c76c50314098822d260c514ebd21c
1 --- qemu-2.10.0-clean/linux-user/syscall.c 2020-03-12 18:47:47.898592169 +0100
2 +++ qemu-2.10.0/linux-user/syscall.c 2020-03-13 09:13:42.461809699 +0100
3 @@ -34,6 +34,7 @@
4 #include <sys/resource.h>
5 #include <sys/swap.h>
6 #include <linux/capability.h>
7 +#include <linux/sockios.h> // https://lkml.org/lkml/2019/6/3/988
8 #include <sched.h>
9 #include <sys/timex.h>
10 #ifdef __ia64__
11 @@ -256,7 +257,9 @@ static type name (type1 arg1,type2 arg2,
12 #endif
14 #ifdef __NR_gettid
15 -_syscall0(int, gettid)
16 +// taken from https://patchwork.kernel.org/patch/10862231/
17 +#define __NR_sys_gettid __NR_gettid
18 +_syscall0(int, sys_gettid)
19 #else
20 /* This is a replacement for the host gettid() and must return a host
21 errno. */
22 @@ -6219,7 +6222,7 @@ static void *clone_func(void *arg)
23 cpu = ENV_GET_CPU(env);
24 thread_cpu = cpu;
25 ts = (TaskState *)cpu->opaque;
26 - info->tid = gettid();
27 + info->tid = sys_gettid();
28 task_settid(ts);
29 if (info->child_tidptr)
30 put_user_u32(info->tid, info->child_tidptr);
31 @@ -6363,9 +6366,9 @@ static int do_fork(CPUArchState *env, un
32 mapping. We can't repeat the spinlock hack used above because
33 the child process gets its own copy of the lock. */
34 if (flags & CLONE_CHILD_SETTID)
35 - put_user_u32(gettid(), child_tidptr);
36 + put_user_u32(sys_gettid(), child_tidptr);
37 if (flags & CLONE_PARENT_SETTID)
38 - put_user_u32(gettid(), parent_tidptr);
39 + put_user_u32(sys_gettid(), parent_tidptr);
40 ts = (TaskState *)cpu->opaque;
41 if (flags & CLONE_SETTLS)
42 cpu_set_tls (env, newtls);
43 @@ -11402,7 +11405,7 @@ abi_long do_syscall(void *cpu_env, int n
44 break;
45 #endif
46 case TARGET_NR_gettid:
47 - ret = get_errno(gettid());
48 + ret = get_errno(sys_gettid());
49 break;
50 #ifdef TARGET_NR_readahead
51 case TARGET_NR_readahead: