[igt-dev] [PATCH i-g-t] tests/i915/gem_mmap_*: Add NULL to ptrace() calls

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Oct 11 09:00:28 UTC 2022


On 2022-10-07 at 17:02:21 -0500, Jake Freeland wrote:
> In FreeBSD, the ptrace() function cannot take a variable
> length list of arguments. This patch adds NULL in the @data
> parameter to allow for compilation on FreeBSD systems.
> 
> Signed-off-by: Jake Freeland <jfree at freebsd.org>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  tests/i915/gem_mmap_gtt.c    | 2 +-
>  tests/i915/gem_mmap_offset.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> index e39b9047..7cd1c5e3 100644
> --- a/tests/i915/gem_mmap_gtt.c
> +++ b/tests/i915/gem_mmap_gtt.c
> @@ -566,7 +566,7 @@ test_ptrace(int fd)
>  	for (int i = 0; i < sz / sizeof(long); i++) {
>  		long ret;
>  
> -		ret = ptrace(PTRACE_PEEKDATA, pid, gtt + i);
> +		ret = ptrace(PTRACE_PEEKDATA, pid, gtt + i, (void *) 0);
>  		igt_assert_eq_u64(ret, CC);
>  		cpy[i] = ret;
>  
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 2b416edd..c14398e2 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -520,7 +520,7 @@ static void test_ptrace(int i915)
>  				for (int i = 0; i < SZ / sizeof(long); i++) {
>  					long ret;
>  
> -					ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i);
> +					ret = ptrace(PTRACE_PEEKDATA, pid, ptr + i, (void *) 0);
>  					igt_assert_eq_u64(ret, CC);
>  					cpy[i] = ret;
>  
> -- 
> 2.37.3
> 


More information about the igt-dev mailing list