More cleaning ...
[linux-2.6/linux-mips.git] / include / linux / binfmts.h
blob753cef720f66541b0cb7b4db908858a1657d5ded
1 #ifndef _LINUX_BINFMTS_H
2 #define _LINUX_BINFMTS_H
4 #include <linux/capability.h>
6 struct pt_regs;
8 /*
9 * MAX_ARG_PAGES defines the number of pages allocated for arguments
10 * and envelope for the new program. 32 should suffice, this gives
11 * a maximum env+arg of 128kB w/4KB pages!
13 #define MAX_ARG_PAGES 32
15 /* sizeof(linux_binprm->buf) */
16 #define BINPRM_BUF_SIZE 128
18 #ifdef __KERNEL__
21 * This structure is used to hold the arguments that are used when loading binaries.
23 struct linux_binprm{
24 char buf[BINPRM_BUF_SIZE];
25 struct page *page[MAX_ARG_PAGES];
26 struct mm_struct *mm;
27 unsigned long p; /* current top of mem */
28 int sh_bang;
29 struct file * file;
30 int e_uid, e_gid;
31 kernel_cap_t cap_inheritable, cap_permitted, cap_effective;
32 void *security;
33 int argc, envc;
34 char * filename; /* Name of binary */
35 unsigned long loader, exec;
39 * This structure defines the functions that are used to load the binary formats that
40 * linux accepts.
42 struct linux_binfmt {
43 struct linux_binfmt * next;
44 struct module *module;
45 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
46 int (*load_shlib)(struct file *);
47 int (*core_dump)(long signr, struct pt_regs * regs, struct file * file);
48 unsigned long min_coredump; /* minimal dump size */
51 extern int register_binfmt(struct linux_binfmt *);
52 extern int unregister_binfmt(struct linux_binfmt *);
54 extern int prepare_binprm(struct linux_binprm *);
55 extern void remove_arg_zero(struct linux_binprm *);
56 extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
57 extern int flush_old_exec(struct linux_binprm * bprm);
58 extern int setup_arg_pages(struct linux_binprm * bprm);
59 extern int copy_strings(int argc,char __user * __user * argv,struct linux_binprm *bprm);
60 extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
61 extern void compute_creds(struct linux_binprm *binprm);
62 extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
63 extern int set_binfmt(struct linux_binfmt *new);
65 #endif /* __KERNEL__ */
66 #endif /* _LINUX_BINFMTS_H */