diff options
Diffstat (limited to 'include/binfmt.h')
-rw-r--r-- | include/binfmt.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/binfmt.h b/include/binfmt.h new file mode 100644 index 0000000000..46b627e36d --- /dev/null +++ b/include/binfmt.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> + * + * GPL v2 + */ + +#ifndef __BFMT_H__ +#define __BFMT_H__ + +#include <filetype.h> +#include <linux/list.h> + +struct binfmt_hook { + enum filetype type; + int (*hook)(struct binfmt_hook *b, char *file, int argc, char **argv); + char *exec; + + struct list_head list; +}; + +#ifdef CONFIG_BINFMT +int binfmt_register(struct binfmt_hook *b); +void binfmt_unregister(struct binfmt_hook *b); + +int execute_binfmt(int argc, char **argv); +#else +static inline int binfmt_register(struct binfmt_hook *b) +{ + return -EINVAL; +} +static inline void binfmt_unregister(struct binfmt_hook *b) {} + +static inline int execute_binfmt(int argc, char **argv) +{ + return 1; +} +#endif + +#endif /* __BFMT_H__ */ |