binfmts.h 头文件分析 \linux-1.0\linux\include\linux\binfmts.h

《binfmts.h》是Linux内核中用于处理不同二进制格式的头文件,定义了最大参数页数及Linux_binprm结构体,包含程序加载所需的参数和功能。此外,还介绍了用于加载二进制格式的函数结构体linux_binfmt及其相关操作函数,如read_exec、open_inode等。
摘要由CSDN通过智能技术生成
#ifndef _LINUX_BINFMTS_H
#define _LINUX_BINFMTS_H

#include <linux/ptrace.h>

/*
 * MAX_ARG_PAGES defines the number of pages allocated for arguments
 * and envelope for the new program. 32 should suffice, this gives
 * a maximum env+arg of 128kB !
 */
#define MAX_ARG_PAGES 32             //最大参数页

/*
 * This structure is used to hold the arguments that are used when loading binaries.
 */
//linux二进制程序的参数结构体
struct linux_binprm{
  char buf[128];                        //128位的缓存
  unsigned long page[MAX_ARG_PAGES];    //页数组
  unsigned long p;                      //             
  int sh_bang;                          //sh 
  struct inode * inode;                 //程序点机构体指针
  int e_uid, e_gid;                     //程序的uid,gid
  int argc, envc;                       //程序的输入参数数和环境参数数
  char * filename;	   /* Name of binary */
};

/* This structure defines the functions that are used to load the binary formats that
 * linux accepts. */

//能够获取二进制格式函数
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值