Ongoing problems with openat2

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Jan 5 12:34:42 GMT 2026



On 04/01/26 16:22, Jeffrey Law wrote:
> 
> This has been going on for a little while since openat2 was added.  On alpha, hppa and possibly others I'm seeing this failure with the trunk:
> 
> In file included from <command-line>:
> ../sysdeps/unix/sysv/linux/openat2.c:29:24: error: conflicting types for 'openat2'; have 'int(int,  const char *, const struct open_how *, size_t)' {aka 'int(int,  const char *, const struct open_how *, long unsigned int)'}
>    29 | weak_alias (__openat2, openat2)
>       |                        ^~~~~~~
> ./../include/libc-symbols.h:156:26: note: in definition of macro '_weak_alias'
>   156 |   extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \
>       |                          ^~~~~~~~~
> ../sysdeps/unix/sysv/linux/openat2.c:29:1: note: in expansion of macro 'weak_alias'
>    29 | weak_alias (__openat2, openat2)
>       | ^~~~~~~~~~
> ../sysdeps/unix/sysv/linux/bits/fcntl-linux.h:484:12: note: previous declaration of 'openat2' with type 'int(int,  const char *, const struct open_how *, long unsigned int)'
>   484 | extern int openat2 (int __dfd, const char * __filename,
>       |            ^~~~~~~
> 
> Jeff

What are the gcc version and the configure options used? I haven't see any
build issue for any supported configuration with gcc-15 with a configuration
that should cover most of supported features [1].

And the openat2 on fcntl-linux.h is defined as __SIZE_TYPE__, which should
map to size_t on all ABIs (the __SIZE_TYPE__ is used to avoid namespace
pollution, but I will check if using size_t would ok).

[1] --enable-stack-protector=all --enable-bind-now=yes --enable-profile=yes --enable-fortify-source=2 --enable-hardcoded-path-in-tests


More information about the Libc-alpha mailing list