<commit_before>#include <stdio.h>
#include <sys/ioctl.h>
#include <linux/fiemap.h>
#include <linux/fs.h>
#include "tests.h"
#include "xlat.h"

#include "xlat/fiemap_flags.h"

static void
test_fiemap(void)
{
	struct fiemap args = {};
	printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64
	       ", fm_length=%" PRI__u64", fm_flags=",
	       args.fm_start, args.fm_length);
	printflags(fiemap_flags, args.fm_flags, "FIEMAP_FLAG_???");
	printf(", fm_extent_count=%u})", args.fm_extent_count);
	ioctl(-1, FS_IOC_FIEMAP, &args);
	printf(" = -1 EBADF (%m)\n");
}

/* clone and dedupe ioctls are in btrfs.c since they originated there */

int
main(int argc, char *argv[])
{
	test_fiemap();

	puts("+++ exited with 0 +++");

	return 0;
}<commit_msg>tests/file_ioctl.c: fix build on systems without <linux/fiemap.h><commit_after>#include "tests.h"

#ifdef HAVE_LINUX_FIEMAP_H

# include <stdio.h>
# include <sys/ioctl.h>
# include <linux/fiemap.h>
# include <linux/fs.h>
# include "xlat.h"
# include "xlat/fiemap_flags.h"

static void
test_fiemap(void)
{
	struct fiemap args = {};
	printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64
	       ", fm_length=%" PRI__u64", fm_flags=",
	       args.fm_start, args.fm_length);
	printflags(fiemap_flags, args.fm_flags, "FIEMAP_FLAG_???");
	printf(", fm_extent_count=%u})", args.fm_extent_count);
	ioctl(-1, FS_IOC_FIEMAP, &args);
	printf(" = -1 EBADF (%m)\n");
}

/* clone and dedupe ioctls are in btrfs.c since they originated there */

int
main(int argc, char *argv[])
{
	test_fiemap();

	puts("+++ exited with 0 +++");

	return 0;
}

#else

SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIEMAP_H")

#endif
{'fraction_non_alphanumeric': 0.1761467889908257, 'fraction_numerical': 0.011009174311926606, 'mean_word_length': 4.801418439716312, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '68224', 'n_tokens_mistral': 729, 'n_tokens_neox': 702, 'n_words': 141}