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

正文內(nèi)容

計算機14實驗報告模板(編輯修改稿)

2025-06-10 03:22 本頁面
 

【文章內(nèi)容簡介】 write(out,amp。c,nread)。}//程序清單 33include include include include sys/include sys/char buf1[] = abcdefghij。char buf2[] = ABCDEFGHIJ。void err_exit(char *err_s){ perror(err_s)。 exit(1)。}int main(void){FILE *fp。 if((fp = fopen(,w)) == NULL) err_exit(file open fail!)。 if(fwrite(buf1,sizeof(buf1),1,fp)!=1) err_exit(file write buf1 error!)。 if(fseek(fp,40,SEEK_SET)==1) err_exit(fseek error!)。 if(fwrite(buf2,strlen(buf2),1,fp)!=1) err_exit(file write buf2 error!)。 fclose(fp)。}//程序清單 34include include include include sys/include sys/char buf1[] = abcdefghij。char buf2[] = ABCDEFGHIJ。void err_exit(char *err_s){ perror(err_s)。 exit(1)。}int main(void){int fd。 if((fd = open(,O_WRONLY|O_CREAT/*|O_APPEND,0644*/)) == 1) err_exit(file open fail!)。 if(write(fd,buf1,10)!=10) err_exit(file write buf1 error!)。 if(lseek(fd,40,SEEK_SET)==1) err_exit(lseek error!)。 if(write(fd,buf2,10)!=10) err_exit(file write buf2 error!)。}實 驗 報 告組別姓名高宇同組實驗者實驗項目名稱實驗四進程控制實驗日期第ong14周周四3,4節(jié)教師評語實驗成績指導教師實驗目的(1) 學習和掌握fork等系統(tǒng)調(diào)用的基本使用方法。(2) 利用Linux中的管道實現(xiàn)父子進程間的同步。實驗內(nèi)容與步驟(1)使用Vi將程序清單41的程序輸入、編譯并運行,學習和掌握fork的基本調(diào)用方法。(2)使用Vi將程序清單443和44的程序輸入、利用gcc分別編譯這三個程序,寫出編譯命令和編譯結(jié)果,如果不成功,嘗試利用gdb調(diào)試。[root@localhost ~] gcc o 4_2 :43:2: warning: no newline at end of file[root@localhost ~] ./4_2child failed.43 [root@localhost ~] gcc o father : In function `main39。::7: error: `l39。 undeclared (first use in this function):7: error: (Each undeclared identifier is reported only once:7: error: for each function it appears in.):8: error: stray 39。\12939。 in program:8: error: syntax error before numeric constant:8: error: stray 39。\13239。 in program:10:2: warning: no newline at end of file [root@localhost ~] gcc o child :7:2: warning: no newline at end of file[root@localhost ~] ./childhellohello child, child.(3)寫出編譯這三個程序的makefile,然后利用make進行編譯,談談這么做的好處??梢怨?jié)省勞動時間,讓三個程序同時編譯,簡化了操作。(4)運行這三個程序,寫出運行結(jié)果。 4-2的 運行結(jié)果::43:2: warning: no newline at end of file[root@localhost ~] ./4_2Parent is using pipe write. child, child.4-3的 運行結(jié)果 :[root@localhost ~] ./fatherParent is using pipe write.4-4的運行結(jié)果是:________[root@localhost ~] ./childhello child!hello child! child, child.(5)屏幕上顯示出的執(zhí)行結(jié)果是哪一個進程執(zhí)行的結(jié)果?(6)父進程中的printf有向屏幕輸出嗎?為什么?沒有,因為父進程的標準輸出已經(jīng)被重定向。(7)利用父子進程間的管道通信方式,改寫實驗3步驟6要求的程序。要求啟用兩個進程,子進程完成對文件的實際操作。實驗結(jié)論對進程有所了解,學習了linux下進程的操作方法,了解了dup的工作原理。程序清單//程序清單 41include include include int global = 5。int main(void){ pid_t pid。 char *string = th
點擊復制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1