]> git.hungrycats.org Git - bees/commit
openat2: adjust prototype to match glibc declaration
authorZygo Blaxell <bees@furryterror.org>
Thu, 12 Feb 2026 03:23:35 +0000 (22:23 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sat, 14 Feb 2026 05:23:07 +0000 (00:23 -0500)
commit14c82dce8a7e9714d6f9cd03229e0fb55460aa25
treea959485e982a926c858b261c2317cb2761ae7efb
parent2e2d4d89435d57eeb2c8e51d5bdc70e52508296c
openat2: adjust prototype to match glibc declaration

glibc 2.43 has added a prototype for openat2 which conficts
with the interim prototype from the kernel commits:

 * glibc 2.43+r5+g856c426a7534-1
 * gcc 15.2.1+r604+g0b99615a8aef-1

```
In file included from /usr/include/bits/fcntl.h:61,
                 from /usr/include/fcntl.h:35,
                 from openat2.cc:18:
/usr/include/bits/fcntl-linux.h:484:12: error: conflicting declaration of C function ‘int openat2(int, const char*, const open_how*, long unsigned int)’
  484 | extern int openat2 (int __dfd, const char * __filename,
      |            ^~~~~~~
In file included from openat2.cc:1:
../include/crucible/openat2.h:48:5: note: previous declaration ‘int openat2(int, const char*, open_how*, size_t)’
   48 | int openat2(int dirfd, const char *pathname, struct open_how *how, size_t size) throw();
      |     ^~~~~~~
In file included from /usr/include/bits/fcntl-linux.h:492:
/usr/include/bits/fcntl-linux-fortify.h:36:1: error: conflicting declaration of C function ‘int openat2(int, const char*, const open_how*, size_t)’
   36 | openat2 (int __dfd, const char *__filename, const struct open_how *__how,
      | ^~~~~~~
../include/crucible/openat2.h:48:5: note: previous declaration ‘int openat2(int, const char*, open_how*, size_t)’
   48 | int openat2(int dirfd, const char *pathname, struct open_how *how, size_t size) throw();
      |     ^~~~~~~
make[1]: *** [Makefile:42: openat2.o] Error 1
make[1]: Leaving directory '/data/src/bees/lib'
make: *** [Makefile:35: lib] Error 2
```

Fix by adding the missing `const` on `open_how`.

Fixes: https://github.com/Zygo/bees/issues/333
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
include/crucible/openat2.h
lib/openat2.cc