libfstools: fix build with glibc
[project/fstools.git] / libfstools / common.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #define _FILE_OFFSET_BITS 64
4
5 #include <sys/types.h>
6 #include <sys/stat.h>
7 #include <sys/ioctl.h>
8 #include <sys/mount.h>
9 #include <glob.h>
10 #include <stdbool.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #ifndef __GLIBC__
15 #include <stropts.h>
16 #endif
17 #include <dirent.h>
18 #include <fcntl.h>
19 #include <unistd.h>
20 #include <libgen.h>
21
22 #include "libfstools.h"
23 #include "volume.h"
24
25 #define F2FS_MINSIZE (100ULL * 1024ULL * 1024ULL)
26
27 int read_uint_from_file(char *dirname, char *filename, unsigned int *i);
28 char *read_string_from_file(const char *dirname, const char *filename, char *buf, size_t bufsz);
29 int block_file_identify(FILE *f, uint64_t offset);
30 int block_volume_format(struct volume *v, uint64_t offset, const char *bdev);