[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] linux-user: make getcpu optional
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v2] linux-user: make getcpu optional |
Date: |
Sat, 17 Feb 2018 11:35:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
Le 17/02/2018 à 03:02, Mike Frysinger a écrit :
> Not all arches implement this, and the kernel doesn't require them to.
> Add ifdef logic to disable it when not available.
>
> Signed-off-by: Mike Frysinger <address@hidden>
> ---
> linux-user/syscall.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 799c8e2800ea..a9904fac791f 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -290,8 +290,10 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid,
> unsigned int, len,
> #define __NR_sys_sched_setaffinity __NR_sched_setaffinity
> _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
> unsigned long *, user_mask_ptr);
> +#ifdef TARGET_NR_getcpu
> #define __NR_sys_getcpu __NR_getcpu
> _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *,
> tcache);
> +#endif
I didn't find any arch that doesn't have it in linux-user/*/syscall_nr.h
Which arches are you speaking about?
As it can be also undefined for the host arch, you should use:
#if defined(TARGET_NR_getcpu) && defined(__NR_getcpu)
Thanks,
Laurent