打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
execl()

execl()

execl has 5 other related functions - see man pages.

execl stands for execute and leave which means that a process will get executed and then terminated by execl.

It is defined by:

execl(char *path, char *arg0,...,char *argn, 0);

The last parameter must always be 0. It is a NULL terminator. Since the argument list is variable we must have some way of telling C when it is to end. The NULL terminator does this job.

where path points to the name of a file holding a command that is to be executed, argo points to a string that is the same as path (or at least its last component.

arg1 ... argn are pointers to arguments for the command and 0 simply marks the end of the (variable) list of arguments.

So our above example could look like this also:

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Variable Length Arguments
exec函数族 - Linux操作系统学习 - 老汉梦想家园
Shell编程入门:Linux解释器原理-源码天堂-华夏名网资讯中心 虚拟主机,域名注册,...
linux解释器原理
mbstowcs (CRT)
貌似相同的两个函数 _snprintf 与snprintf
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服