Согласно справочной странице, я определил _GNU_SOURCE до включения :
#include
#define _GNU_SOURCE /* For Linux's fallocate(). */
#define HAVE_FALLOCATE 1
#include
int main(void)
{
printf("%d\n", FALLOC_FL_KEEP_SIZE);
}
который я скомпилировал:
gcc-13 -std=gnu2x c.c
Но это не удается:
error: `FALLOC_FL_KEEP_SIZE` undeclared (first use in this function)
Некоторые статистические данные об окружающей среде:
OS: Linux Mint 21.2 x86_64
Kernel: 5.15.0-112-generic
GLIBC Version: GNU C Library (Ubuntu GLIBC 2.35-0ubuntu3.8) stable release 2.35
Compiler: gcc version 13.1.0 (Ubuntu 13.1.0-8ubuntu1~22.04)
Выполнение команды grep -r FALLOC_FL_KEEP_SIZE /usr/include вернуло результат:
/usr/include/linux/falloc.h:#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
/usr/include/linux/falloc.h: * with fallocate. Flag FALLOC_FL_KEEP_SIZE should cause the inode
Подробнее здесь: https://stackoverflow.com/questions/786 ... s-function