binfmts.h

Go to the documentation of this file.
00001 #ifndef _LINUX_BINFMTS_H
00002 #define _LINUX_BINFMTS_H
00003 
00004 #include <linux/ptrace.h>
00005 
00006 /**
00007 *
00008 
00009  * MAX_ARG_PAGES defines the number of pages allocated for arguments
00010  * and envelope for the new program. 32 should suffice, this gives
00011  * a maximum env+arg of 128kB !
00012 
00013 
00014 */
00015 #define MAX_ARG_PAGES 32
00016 
00017 /**
00018 *
00019 
00020  * This structure is used to hold the arguments that are used when loading binaries.
00021 
00022 
00023 */
00024 struct linux_binprm{
00025   char buf[128];
00026   unsigned long page[MAX_ARG_PAGES];
00027   unsigned long p;
00028   int sh_bang;
00029   struct inode * inode;
00030   int e_uid, e_gid;
00031   int argc, envc;
00032   char * filename;         ///< Name of binary 
00033 };
00034 
00035 /**
00036 *
00037  This structure defines the functions that are used to load the binary formats that
00038 
00039 
00040 */
00041 
00042 struct linux_binfmt{
00043   int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
00044   int (*load_shlib)(int fd);
00045 };
00046 
00047 extern struct linux_binfmt formats[];
00048 
00049 extern int read_exec(struct inode *inode, unsigned long offset,
00050         char * addr, unsigned long count);
00051 
00052 extern int open_inode(struct inode * inode, int mode);
00053 
00054 extern void flush_old_exec(struct linux_binprm * bprm);
00055 extern unsigned long change_ldt(unsigned long text_size,unsigned long * page);
00056 extern unsigned long * create_tables(char * p,int argc,int envc,int ibcs);
00057 extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
00058                 unsigned long p, int from_kmem);
00059 
00060 #endif

Generated on Mon May 1 21:46:59 2006 for KernelAPI by  doxygen 1.4.6-5