Import 2.3.25pre1
[davej-history.git] / include / linux / binfmts.h
blob31721c101d85a13556661be0c2407c0e34238066
1 #ifndef _LINUX_BINFMTS_H
2 #define _LINUX_BINFMTS_H
4 #include <linux/ptrace.h>
5 #include <linux/capability.h>
7 /*
8 * MAX_ARG_PAGES defines the number of pages allocated for arguments
9 * and envelope for the new program. 32 should suffice, this gives
10 * a maximum env+arg of 128kB w/4KB pages!
12 #define MAX_ARG_PAGES 32
14 #ifdef __KERNEL__
17 * This structure is used to hold the arguments that are used when loading binaries.
19 struct linux_binprm{
20 char buf[128];
21 struct page *page[MAX_ARG_PAGES];
22 unsigned long p; /* current top of mem */
23 int sh_bang;
24 struct dentry * dentry;
25 int e_uid, e_gid;
26 kernel_cap_t cap_inheritable, cap_permitted, cap_effective;
27 int argc, envc;
28 char * filename; /* Name of binary */
29 unsigned long loader, exec;
33 * This structure defines the functions that are used to load the binary formats that
34 * linux accepts.
36 struct linux_binfmt {
37 struct linux_binfmt * next;
38 struct module *module;
39 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
40 int (*load_shlib)(int fd);
41 int (*core_dump)(long signr, struct pt_regs * regs, struct file * file);
42 unsigned long min_coredump; /* minimal dump size */
45 extern int register_binfmt(struct linux_binfmt *);
46 extern int unregister_binfmt(struct linux_binfmt *);
48 extern int read_exec(struct dentry *, unsigned long offset,
49 char * addr, unsigned long count, int to_kmem);
51 extern int open_dentry(struct dentry *, int mode);
53 extern int prepare_binprm(struct linux_binprm *);
54 extern void remove_arg_zero(struct linux_binprm *);
55 extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
56 extern int flush_old_exec(struct linux_binprm * bprm);
57 extern int setup_arg_pages(struct linux_binprm * bprm);
58 extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm);
59 extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
60 extern void compute_creds(struct linux_binprm *binprm);
61 extern int do_coredump(long signr, struct pt_regs * regs);
64 #if 0
65 /* this went away now */
66 #define change_ldt(a,b) setup_arg_pages(a,b)
67 #endif
69 #endif /* __KERNEL__ */
70 #endif /* _LINUX_BINFMTS_H */