exec函数的使用问题

进程中关于exec函数的使用问题

学习过程中遇到的问题:

  • 如何使用?
  • 有什么区别?
  • 作用是什么?

1.如何使用?

在Linux系统中我们可以通过man 命令来进行查看:

例如:

查看man命令的使用   		man man

MANUAL SECTIONS:

   The standard sections of the manual include:

   1      User Commands
   2      System Calls
   3      C Library Functions
   4      Devices and Special Files
   5      File Formats and Conventions
   6      Games et. Al.
   7      Miscellanea
   8      System Administration tools and Daemons

查看exec函数使用			man 3 exec

NAME:(整个exec函数家族)

   execl, execlp, execle, execv, execvp - execute a file

SYNOPSIS:

   #include <unistd.h>(头文件)

   extern char **environ;

exec函数家族具体形式:

   int execl(const char *path, const char *arg, ...);
   int execlp(const char *file, const char *arg, ...);
   int execle(const char *path, const char *arg,
					..., char * const envp[]);
   int execv(const char *path, char *const argv[]);
   int execvp(const char *file, char *const argv[]);

2.有什么区别?

  • 函数名不同(这是废话)
  • 参数不同
  • 使用方法不同

在这里,我们对比这两个函数来进行使用:(其他函数类同)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胜天半月子

打不打商的无所谓,能帮到你就好

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值