[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0126e205-e11e-f107-24b8-3673b1c749e3@kernel.org>
Date: Thu, 13 Feb 2020 13:10:04 -0700
From: shuah <shuah@...nel.org>
To: Aleksa Sarai <cyphar@...har.com>
Cc: linux-kselftest@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, shuah <shuah@...nel.org>
Subject: Re: [PATCH] selftests: openat2: fix build error on newer glibc
On 2/13/20 12:26 AM, Aleksa Sarai wrote:
> It appears that newer glibcs check that openat(O_CREAT) was provided a
> fourth argument (rather than passing garbage), resulting in the
> following build error:
>
>> In file included from /usr/include/fcntl.h:301,
>> from helpers.c:9:
>> In function 'openat',
>> inlined from 'touchat' at helpers.c:49:11:
>> /usr/include/x86_64-linux-gnu/bits/fcntl2.h:126:4: error: call to
>> '__openat_missing_mode' declared with attribute error: openat with O_CREAT
>> or O_TMPFILE in third argument needs 4 arguments
>> 126 | __openat_missing_mode ();
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>
> Reported-by: Shuah Khan <shuah@...nel.org>
> Signed-off-by: Aleksa Sarai <cyphar@...har.com>
> ---
> tools/testing/selftests/openat2/helpers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/openat2/helpers.c b/tools/testing/selftests/openat2/helpers.c
> index e9a6557ab16f..5074681ffdc9 100644
> --- a/tools/testing/selftests/openat2/helpers.c
> +++ b/tools/testing/selftests/openat2/helpers.c
> @@ -46,7 +46,7 @@ int sys_renameat2(int olddirfd, const char *oldpath,
>
> int touchat(int dfd, const char *path)
> {
> - int fd = openat(dfd, path, O_CREAT);
> + int fd = openat(dfd, path, O_CREAT, 0700);
> if (fd >= 0)
> close(fd);
> return fd;
>
Thanks for a quick patch. It compiles now.
I will take this through kselftest tree.
thanks,
-- Shuah
Powered by blists - more mailing lists