qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Helge Deller <deller@gmx.de>, Laurent Vivier <laurent@vivier.eu>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 03/13] linux-user: Add faccessat2() syscall
Date: Fri, 26 Aug 2022 08:17:59 -0700	[thread overview]
Message-ID: <186a174e-e37e-c5b1-b02a-efe31efdba79@linaro.org> (raw)
In-Reply-To: <20220826141853.419564-4-deller@gmx.de>

On 8/26/22 07:18, Helge Deller wrote:
> Add implementation and strace output for faccessat2().
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/strace.c    |  2 +-
>   linux-user/strace.list |  3 +++
>   linux-user/syscall.c   | 12 ++++++++++++
>   3 files changed, 16 insertions(+), 1 deletion(-)

I've done this one, and cleaned up the code a bit too:

https://lore.kernel.org/qemu-devel/20220729201414.29869-1-richard.henderson@linaro.org/


r~

> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 27309f1106..e8c63aa4c2 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -1962,7 +1962,7 @@ print_execv(CPUArchState *cpu_env, const struct syscallname *name,
>   }
>   #endif
> 
> -#ifdef TARGET_NR_faccessat
> +#if defined(TARGET_NR_faccessat) || defined(TARGET_NR_faccessat2)
>   static void
>   print_faccessat(CPUArchState *cpu_env, const struct syscallname *name,
>                   abi_long arg0, abi_long arg1, abi_long arg2,
> diff --git a/linux-user/strace.list b/linux-user/strace.list
> index a78cdf3cdf..6e88da7fad 100644
> --- a/linux-user/strace.list
> +++ b/linux-user/strace.list
> @@ -177,6 +177,9 @@
>   #ifdef TARGET_NR_faccessat
>   { TARGET_NR_faccessat, "faccessat" , NULL, print_faccessat, NULL },
>   #endif
> +#ifdef TARGET_NR_faccessat2
> +{ TARGET_NR_faccessat2, "faccessat2" , NULL, print_faccessat, NULL },
> +#endif
>   #ifdef TARGET_NR_fadvise64
>   { TARGET_NR_fadvise64, "fadvise64" , NULL, NULL, NULL },
>   #endif
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index f409121202..f51c4fbabd 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -399,6 +399,9 @@ _syscall3(int, ioprio_set, int, which, int, who, int, ioprio)
>   #if defined(TARGET_NR_getrandom) && defined(__NR_getrandom)
>   _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags)
>   #endif
> +#if defined(TARGET_NR_faccessat2) && defined(__NR_faccessat2)
> +_syscall4(int, faccessat2, int, dirfd, char *, pathname, int, mode, int, flags)
> +#endif
> 
>   #if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
>   _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type,
> @@ -9098,6 +9101,15 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
>           unlock_user(p, arg2, 0);
>           return ret;
>   #endif
> +#if defined(TARGET_NR_faccessat2) && defined(__NR_faccessat2)
> +    case TARGET_NR_faccessat2:
> +        if (!(p = lock_user_string(arg2))) {
> +            return -TARGET_EFAULT;
> +        }
> +        ret = get_errno(faccessat2(arg1, p, arg3, arg4));
> +        unlock_user(p, arg2, 0);
> +        return ret;
> +#endif
>   #ifdef TARGET_NR_nice /* not on alpha */
>       case TARGET_NR_nice:
>           return get_errno(nice(arg1));
> --
> 2.37.1
> 



  reply	other threads:[~2022-08-26 15:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 14:18 [PATCH 00/13] linux-user: Add more syscalls, enhance tracing & logging enhancements Helge Deller
2022-08-26 14:18 ` [PATCH 01/13] linux-user: Add missing signals in strace output Helge Deller
2022-08-26 15:13   ` Richard Henderson
2022-08-26 15:14   ` Richard Henderson
2022-08-26 17:19     ` Helge Deller
2022-08-29  5:01   ` Richard Henderson
2022-08-26 14:18 ` [PATCH 02/13] linux-user: Add missing clock_gettime64() syscall strace Helge Deller
2022-08-26 14:18 ` [PATCH 03/13] linux-user: Add faccessat2() syscall Helge Deller
2022-08-26 15:17   ` Richard Henderson [this message]
2022-08-26 16:18     ` Helge Deller
2022-08-26 14:18 ` [PATCH 04/13] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls Helge Deller
2022-08-26 14:18 ` [PATCH 05/13] linux-user: Log failing executable in EXCP_DUMP() Helge Deller
2022-08-26 14:18 ` [PATCH 06/13] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info Helge Deller
2022-08-26 14:18 ` [PATCH 07/13] linux-user/hppa: Dump IIR on register dump Helge Deller
2022-08-26 14:18 ` [PATCH 08/13] linux-user: Fix strace of chmod() if mode == 0 Helge Deller
2022-08-26 14:18 ` [PATCH 09/13] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch Helge Deller
2022-08-26 14:18 ` [PATCH 10/13] linux-user: Add strace for clock_nanosleep() Helge Deller
2022-08-26 14:18 ` [PATCH 11/13] linux-user: Show timespec on strace for futex() Helge Deller
2022-08-29  4:52   ` Richard Henderson
2022-08-26 14:18 ` [PATCH 12/13] linux-user: Add close_range() syscall Helge Deller
2022-08-26 14:18 ` [PATCH 13/13] linux-user: Add parameters of getrandom() syscall for strace Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=186a174e-e37e-c5b1-b02a-efe31efdba79@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=deller@gmx.de \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).