Update to upstream util-linux 2.20.1
[framework/base/util-linux-ng.git] / fsck / fsck.h
1 /*
2  * fsck.h
3  */
4
5 #include <time.h>
6
7 #ifdef __STDC__
8 #define NOARGS void
9 #else
10 #define NOARGS
11 #endif
12
13 #ifdef __GNUC__
14 #define FSCK_ATTR(x) __attribute__(x)
15 #else
16 #define FSCK_ATTR(x)
17 #endif
18
19
20 #ifndef DEFAULT_FSTYPE
21 #define DEFAULT_FSTYPE  "ext2"
22 #endif
23
24 #define MAX_DEVICES 32
25 #define MAX_ARGS 32
26
27 #define EXIT_OK          0
28 #define EXIT_NONDESTRUCT 1
29 #define EXIT_DESTRUCT    2
30 #define EXIT_UNCORRECTED 4
31 #define EXIT_ERROR       8
32 #define EXIT_USAGE       16
33 #define EXIT_LIBRARY     128
34
35 /*
36  * Internal structure for mount tabel entries.
37  */
38
39 struct fs_info {
40         char  *device;
41         char  *mountpt;
42         char  *type;
43         char  *opts;
44         int   freq;
45         int   passno;
46         int   flags;
47         dev_t disk;
48         int   stacked;
49         struct fs_info *next;
50 };
51
52 #define FLAG_DONE 1
53 #define FLAG_PROGRESS 2
54
55 /*
56  * Structure to allow exit codes to be stored
57  */
58 struct fsck_instance {
59         int     pid;
60         int     flags;
61         int     lock;           /* flock()ed whole disk file descriptor or -1 */
62         int     exit_status;
63         time_t  start_time;
64         char *  prog;
65         char *  type;
66         struct fs_info *fs;
67         struct fsck_instance *next;
68 };
69
70 extern char *base_device(const char *device);
71 extern const char *identify_fs(const char *fs_name, const char *fs_types);
72
73 /* ismounted.h */
74 extern int is_mounted(const char *file);