[LTP] [PATCH 1/3] include/faccessat.h: Add header file faccessat.h

Yang Xu (Fujitsu) xuyang2018.jy@fujitsu.com
Mon Aug 21 13:26:46 CEST 2023


Hi Cyril

> Hi!
>> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
>> ---
>>   include/lapi/faccessat.h | 21 +++++++++++++++++++++
>>   1 file changed, 21 insertions(+)
>>   create mode 100644 include/lapi/faccessat.h
>>
>> diff --git a/include/lapi/faccessat.h b/include/lapi/faccessat.h
>> new file mode 100644
>> index 000000000..f3318fd7a
>> --- /dev/null
>> +++ b/include/lapi/faccessat.h
>> @@ -0,0 +1,21 @@
>> +// SPDX-License-Identifier: GPL-2.0-or-later
>> +/*
>> + * Copyright (c) 2023 FUJITSU LIMITED. All rights reserved.
>> + * Copyright (c) Linux Test Project, 2003-2023
>> + * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
>> + */
>> +
>> +#ifndef FACCESSAT_H
>> +#define FACCESSAT_H
>> +
>> +#include <sys/types.h>
>> +#include "lapi/syscalls.h"
>> +
>> +#ifndef HAVE_FACCESSAT
>> +int faccessat(int dirfd, const char *pathname, int mode, int flags)
>> +{
>> +	return tst_syscall(__NR_faccessat, dirfd, pathname, mode, flags);
>> +}
>> +#endif
> 
> I guess that this will not work without:
> 
> diff --git a/configure.ac b/configure.ac
> index e4aa2cadf..7beca3d9f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -92,6 +92,7 @@ AC_CHECK_FUNCS_ONCE([ \
>       epoll_pwait \
>       epoll_pwait2 \
>       execveat \
> +    faccessat \
>       fallocate \
>       fchownat \
>       fsconfig \
> 
> 
> However looking at man faccessat, it was added into glibc 2.10 and since
> the oldest glibc we support is 2.17 (see
> doc/supported-kernel-libc-versions.txt) we can as well completely drop
> this fallback definition.
> 

I agree with your suggestion, and I will remove faccessat.h in the v2 
version. After this is merged, I will also drop those unnecessary 
fallback definition.


More information about the ltp mailing list