1 #ifndef _LINUX_BINFMTS_H
2 #define _LINUX_BINFMTS_H
3
4 #include <linux/ptrace.h>
5
6
7
8
9
10
11 #define MAX_ARG_PAGES 32
12
13
14
15
16 struct linux_binprm{
17 char buf[128];
18 unsigned long page[MAX_ARG_PAGES];
19 unsigned long p;
20 int sh_bang;
21 struct inode * inode;
22 int e_uid, e_gid;
23 int argc, envc;
24 char * filename;
25 unsigned long loader, exec;
26 };
27
28
29
30
31
32 struct linux_binfmt {
33 struct linux_binfmt * next;
34 int *use_count;
35 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
36 int (*load_shlib)(int fd);
37 int (*core_dump)(long signr, struct pt_regs * regs);
38 };
39
40 extern int register_binfmt(struct linux_binfmt *);
41 extern int unregister_binfmt(struct linux_binfmt *);
42
43 extern int read_exec(struct inode *inode, unsigned long offset,
44 char * addr, unsigned long count, int to_kmem);
45
46 extern int open_inode(struct inode * inode, int mode);
47
48 extern int init_elf_binfmt(void);
49 extern int init_aout_binfmt(void);
50
51 extern void flush_old_exec(struct linux_binprm * bprm);
52 extern unsigned long setup_arg_pages(unsigned long text_size,unsigned long * page);
53 extern unsigned long * create_tables(char * p,struct linux_binprm * bprm,int ibcs);
54 extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
55 unsigned long p, int from_kmem);
56
57
58 #define change_ldt(a,b) setup_arg_pages(a,b)
59
60 #endif