#include <stdio.h> #include <unistd.h> #include <stdlib.h> int main(int argc,char *argv[]) { pid_t pid; //進(jìn)程標(biāo)識(shí)符 printf("**This is a test for exec series fun**\n"); //打印提示符 if(fork()==0) //創(chuàng)建一個(gè)子進(jìn)程 { execl("/bin/date","/bin/date",(char*)0); //使用execl函數(shù)調(diào)用date命令 exit(0); //退出 } else { sleep(1); //主進(jìn)程休眠 execl("/bin/time","/bin/time",(char*)0); } exit(0); }
本文標(biāo)題:[Linux進(jìn)程]使用execl函數(shù)調(diào)用date命令
URL分享:http://chinadenli.net/article6/ihehig.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、移動(dòng)網(wǎng)站建設(shè)、自適應(yīng)網(wǎng)站、App開發(fā)、網(wǎng)站內(nèi)鏈、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
移動(dòng)網(wǎng)站建設(shè)知識(shí)