The documentation (https://www.haiku-os.org/docs/api/libroot.html) says that BSD extensions are enabled by default, but somehow this does not seem to be the case on my system. With _DEFAULT_SOURCE defined, though, src/files.c now compiles fine.