freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計算機14實驗報告模板-在線瀏覽

2025-07-01 03:22本頁面
  

【正文】 CHOICE case $CHOICE in 1) ls l|awk 39。 。 3) uers 。 Q|q) exit 0 。 esac echo e n \n\n\tHit the return key to continue read DUMMYdone實 驗 報 告組別姓名高宇同組實驗者實驗項目名稱實驗三文件操作實驗日期第13周周四3,4節(jié)教師評語實驗成績指導(dǎo)教師實驗?zāi)康模?) 學(xué)習(xí)并掌握Linux的文件操作。實驗內(nèi)容和步驟(1)使用Vi將程序清單31和32的程序輸入,并在當(dāng)前目錄下創(chuàng)建文件“”和文件“”,盡可能的使文件“”大一些。Gcc –o list3_1 Gcc –o list3_2 (3)仔細(xì)觀察這兩個程序,比較標(biāo)準(zhǔn)C的文件操作和Linux的系統(tǒng)調(diào)用open、read、write等的使用區(qū)別。(4)按照說明重新修改程序32,并使用time命令察看程序執(zhí)行的時間效率上有何區(qū)別。 char name[10]。/*0為女生,1為男生*/ char mobile_phone[12]。實驗結(jié)論學(xué)習(xí)了在linux環(huán)境下進行簡單的C語言程序設(shè)計。程序清單//程序清單 31include include int main(void){char c。if((in = fopen(,r))==NULL){ perror(file open error!)。}out = fopen(,w)。}//程序清單 32include include sys/include int main(){// char block[1024]。 int in, out。 in = open(, O_RDONLY)。//將注釋打開,并將兩條語句的后一句注釋掉,重新編譯執(zhí)行。c,sizeof(c))) 0)// write(out,block,nread)。c,nread)。char buf2[] = ABCDEFGHIJ。 exit(1)。 if((fp = fopen(,w)) == NULL) err_exit(file open fail!)。 if(fseek(fp,40,SEEK_SET)==1) err_exit(fseek error!)。 fclose(fp)。char buf2[] = ABCDEFGHIJ。 exit(1)。 if((fd = open(,O_WRONLY|O_CREAT/*|O_APPEND,0644*/)) == 1) err_exit(file open fail!)。 if(lseek(fd,40,SEEK_SET)==1) err_exit(lseek error!)。}實 驗 報 告組別姓名高宇同組實驗者實驗項目名稱實驗四進程控制實驗日期第ong14周周四3,4節(jié)教師評語實驗成績指導(dǎo)教師實驗?zāi)康模?) 利用Linux中的管道實現(xiàn)父子進程間的同步。(2)使用Vi將程序清單443和44的程序輸入、利用gcc分別編譯這三個程序,寫出編譯命令和編譯結(jié)果,如果不成功,嘗試?yán)胓db調(diào)試。::7: error: `l39。\12939。\13239??梢怨?jié)省勞動時間,讓三個程序同時編譯,簡化了操作。 4-2的 運行結(jié)果::43:2: warning: no newline at end of file[rootlocalhost ~] ./4_2Parent is using pipe write. child, child.4-3的 運行結(jié)果 :[rootlocalhost ~] ./fatherParent is using pipe write.4-4的運行結(jié)果是:________[rootlocalhost ~] ./childhello child!hello child! child, child.(5)屏幕上顯示出的執(zhí)行結(jié)果是哪一個進程執(zhí)行的結(jié)果?(6)父進程中的printf有向屏幕輸出嗎?為什么?沒有,因為父進程的標(biāo)準(zhǔn)輸出已經(jīng)被重定向。要求啟用兩個進程,子進程完成對文件的實際操作。程序清單//程序清單 41include include include int global = 5。 char *string = these are values before fork:。 printf(before fork * * *\n\n)。 if(pid == 0){ string = I am child.。 global++。 printf(\nMy pid is %d,%s\n pid = %d\n global = %d\n local = %d\n, getpid(),string,pid,global,local)。 } printf(%s\n Now,global = %d,local = %d\n,string,global,local)。}//清單42 管道程序 define STD_INPUT 0 // 定義標(biāo)準(zhǔn)輸入設(shè)備描述符 define STD_OUTPUT 1 // 定義標(biāo)準(zhǔn)輸出設(shè)備描述符int fd[2]。 pipe(fd)。 // 調(diào)用自定義函數(shù)pipeline() exit(1)。 if ((i=fork())==1) // 創(chuàng)建進程,失敗退出 { perror(“process fork error!”)。 // 關(guān)閉管道輸入描述符 close(STD_OUTPUT)。 // 指定標(biāo)準(zhǔn)輸出描述符1為管道寫指針
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1