root/include/linux/binfmts.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_BINFMTS_H
   2 #define _LINUX_BINFMTS_H
   3 
   4 #include <linux/ptrace.h>
   5 
   6 /*
   7  * MAX_ARG_PAGES defines the number of pages allocated for arguments
   8  * and envelope for the new program. 32 should suffice, this gives
   9  * a maximum env+arg of 128kB w/4KB pages!
  10  */
  11 #define MAX_ARG_PAGES 32
  12 
  13 /*
  14  * This structure is used to hold the arguments that are used when loading binaries.
  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;        /* Name of binary */
  25         unsigned long loader, exec;
  26         int dont_iput;          /* binfmt handler has put inode */
  27 };
  28 
  29 /*
  30  * This structure defines the functions that are used to load the binary formats that
  31  * linux accepts.
  32  */
  33 struct linux_binfmt {
  34         struct linux_binfmt * next;
  35         long *use_count;
  36         int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
  37         int (*load_shlib)(int fd);
  38         int (*core_dump)(long signr, struct pt_regs * regs);
  39 };
  40 
  41 extern int register_binfmt(struct linux_binfmt *);
  42 extern int unregister_binfmt(struct linux_binfmt *);
  43 
  44 extern int read_exec(struct inode *inode, unsigned long offset,
  45         char * addr, unsigned long count, int to_kmem);
  46 
  47 extern int open_inode(struct inode * inode, int mode);
  48 
  49 extern int init_elf_binfmt(void);
  50 extern int init_aout_binfmt(void);
  51 extern int init_script_binfmt(void);
  52 
  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 void flush_old_exec(struct linux_binprm * bprm);
  57 extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);
  58 extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
  59                 unsigned long p, int from_kmem);
  60 
  61 /* this eventually goes away */
  62 #define change_ldt(a,b) setup_arg_pages(a,b)
  63 
  64 #endif

/* [previous][next][first][last][top][bottom][index][help] */