Contents of /trunk/mkinitrd-magellan/klibc/usr/kinit/kinit.h
Parent Directory | Revision Log
Revision 1122 -
(show annotations)
(download)
Wed Aug 18 21:11:40 2010 UTC (14 years, 1 month ago) by niro
File MIME type: text/plain
File size: 1425 byte(s)
Wed Aug 18 21:11:40 2010 UTC (14 years, 1 month ago) by niro
File MIME type: text/plain
File size: 1425 byte(s)
-updated to klibc-1.5.19
1 | /* |
2 | * kinit/kinit.h |
3 | */ |
4 | |
5 | #ifndef KINIT_H |
6 | #define KINIT_H |
7 | |
8 | #include <stddef.h> |
9 | #include <stdio.h> |
10 | #include <sys/types.h> |
11 | |
12 | int do_mounts(int argc, char *argv[]); |
13 | int mount_nfs_root(int argc, char *argv[], int flags); |
14 | int ramdisk_load(int argc, char *argv[]); |
15 | void md_run(int argc, char *argv[]); |
16 | const char *bdevname(dev_t dev); |
17 | |
18 | extern int mnt_procfs; |
19 | extern int mnt_sysfs; |
20 | |
21 | extern int init_argc; |
22 | extern char **init_argv; |
23 | extern const char *progname; |
24 | |
25 | char *get_arg(int argc, char *argv[], const char *name); |
26 | int get_flag(int argc, char *argv[], const char *name); |
27 | |
28 | int getintfile(const char *path, long *val); |
29 | |
30 | ssize_t readfile(const char *path, char **pptr); |
31 | ssize_t freadfile(FILE *f, char **pptr); |
32 | |
33 | /* |
34 | * min()/max() macros that also do |
35 | * strict type-checking.. See the |
36 | * "unnecessary" pointer comparison. |
37 | * From the Linux kernel. |
38 | */ |
39 | #define min(x,y) ({ \ |
40 | typeof(x) _x = (x); \ |
41 | typeof(y) _y = (y); \ |
42 | (void) (&_x == &_y); \ |
43 | _x < _y ? _x : _y; }) |
44 | |
45 | #define max(x,y) ({ \ |
46 | typeof(x) _x = (x); \ |
47 | typeof(y) _y = (y); \ |
48 | (void) (&_x == &_y); \ |
49 | _x > _y ? _x : _y; }) |
50 | |
51 | |
52 | #ifdef DEBUG |
53 | # define dprintf printf |
54 | #else |
55 | # define dprintf(...) ((void)0) |
56 | #endif |
57 | |
58 | #ifdef DEBUG |
59 | void dump_args(int argc, char *argv[]); |
60 | #else |
61 | static inline void dump_args(int argc, char *argv[]) |
62 | { |
63 | (void)argc; |
64 | (void)argv; |
65 | } |
66 | #endif |
67 | |
68 | #endif /* KINIT_H */ |