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 };
26
27
28
29
30 struct linux_binfmt{
31 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
32 int (*load_shlib)(int fd);
33 };
34
35 extern struct linux_binfmt formats[];
36
37 extern int read_exec(struct inode *inode, unsigned long offset,
38 char * addr, unsigned long count);
39
40 extern int open_inode(struct inode * inode, int mode);
41
42 extern void flush_old_exec(struct linux_binprm * bprm);
43 extern unsigned long change_ldt(unsigned long text_size,unsigned long * page);
44 extern unsigned long * create_tables(char * p,int argc,int envc);
45 extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
46 unsigned long p, int from_kmem);
47
48 #endif