blob: 7eb46e522573f81271924abf0b671389dd07fa17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
*/
#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__ */
|