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

正文內(nèi)容

操作系統(tǒng)課程設(shè)計(jì)模板(編輯修改稿)

2025-08-31 10:18 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 extern _dir( )。 extern mkdir( )。 extern chdir( )。 extern unsigned short open( )。 extern creat( )。 extern unsigned int read( )。 extern unsigned int write( )。 extern int login( )。 extern logout( )。 extern install( )。 extern format( )。 extern close( )。 extern halt( )。 主程序main( ) (文件名 ) ,其主要功能描述如程序設(shè)計(jì)中的第4部分。 include include struct hinode hinode[NHINO]。 struct dir dir。 struct file sys_ofile[SYSOPENFILE]。 struct filsys filsys。 struct pwd pwd[PWDNUM]。 struct user user[USERNUM]。 FILE *fd。 struct inode *cur_path_inode。 int user_id。 int iHave_formated。 int iCur_free_block_index。 main( ) { unsigned short ab_fd1,ab_fd2,ab_fd3,ab_fd4,ab_fd5。 char *buf。 char file_content_buf[BLOCKSIZ]。 char c。 printf(begin:\n)。 printf(\nDo you want to format the disk?\n)。 if(getchar( )==39。y39。) printf(\nFormat will erase context on the disk \n Are you sure?\n)。 getchar()。 if((c=getchar( ))==39。y39。) { printf(format starts\n)。 format( )。 iHave_formated = 1。 printf(format ended\n)。 } else printf(received char :%c from stdin\n,c)。 printf(step 1 ended\n)。 install( )。 printf(step 2 ended\n)。 _dir( )。 printf(step 3 ended\n)。 login(2118,abcd)。 user_id=0。 printf(step 4 ended\n)。 mkdir(a2118)。 _dir()。 printf(step 51 ended\n)。 chdir(a2118)。 _dir()。 printf(step 52 ended\n)。 ab_fd1=creat(2118,01777)。 _dir()。 printf(step 6 ended\n)。 buf=(char *)malloc(BLOCKSIZ*6+5)。 printf(step 7 ended\n)。 write(2118,ab_fd1,buf,BLOCKSIZ*6+5)。 printf(step 8 ended\n)。 close(2118,ab_fd1)。 printf(step 9 ended\n)。 free(buf)。 mkdir(subdir)。 printf(step 101 ended\n)。 chdir(subdir)。 printf(step 102 ended\n)。 ab_fd2=creat(2118,01777)。 printf(step 11 ended\n)。 buf=(char *)malloc(BLOCKSIZ*4+20)。 printf(step 12 ended\n)。 write(2118,ab_fd2,buf,BLOCKSIZ*4+20)。 printf(step 13 ended\n)。 close(2118,ab_fd2)。 free(buf)。 printf(step 14 ended\n)。 chdir(..)。 printf(step 15 ended\n)。 ab_fd3=creat(2118,01777)。 buf=(char *)malloc(BLOCKSIZ*10+255)。 write(2118,ab_fd3,buf,BLOCKSIZ*3+255)。 close(2118,ab_fd3)。 free(buf)。 delete()。 printf(step 16 ended\n)。 ab_fd4=creat(2118,01777)。 buf=(char *)malloc(BLOCKSIZ*8+300)。 printf(step 17 ended\n)。 write(2118,ab_fd4,buf,BLOCKSIZ*8+300)。 printf(step 18 ended\n)。 close(2118,ab_fd4)。 free(buf)。 printf(step 19 ended\n)。 ab_fd3=open(2118,FAPPEND)。 printf(step 20 ended\n)。 buf=(char *)malloc(BLOCKSIZ*3+100)。 write(2118,ab_fd3,buf,BLOCKSIZ*3+100)。 printf(step 21 ended,ab_fd3 = %d\n,ab_fd3)。 close(2118,ab_fd3)。 ab_fd5=creat(2118,文件5,01777)。 write(2118,ab_fd5,\nFly me to the moon\nAnd let me play among the stars\nLet me see what Spring is like\nOn Jupiter and Mars\n帶我飛向月球,讓我在群星中嬉戲,讓我看看木星和火星上的春天\n,BLOCKSIZ)。 close(2118,ab_fd5)。 ab_fd5=open(2118,文件5,FREAD)。 read(2118,ab_fd5,file_content_buf,BLOCKSIZ)。 printf(讀出文件5的內(nèi)容: %s\n,file_content_buf)。 close(2118,ab_fd5)。 printf(step 22 ended\n)。 free(buf)。 _dir( )。 chdir(..)。 printf(\nstep 23 ended\n)。 logout(2118)。 printf(step 24 ended\n)。 halt( )。 } 初始化磁盤(pán)格式程序format( ) ()include include format( ) { struct inode *inode。 struct direct dir_buf[BLOCKSIZ/(DIRSIZ+2)]。 struct pwd passwd[BLOCKSIZ/(PWDSIZ+4)]。 /* { {2116,03,dddd}, {2117,03,bbbb}, {2118,04,abcd}, {2119,04,cccc}, {2220,05,eeee}, }。 */ //struct filsys。 unsigned int block_buf[BLOCKSIZ/sizeof(int)]。 char *buf。 int i,j。 /* creat the file system file */ memset(dir_buf,0,(BLOCKSIZ/(DIRSIZ+2))*sizeof(struct direct))。 fd=fopen(filesystem,w+b)。 buf=(char *)malloc((DINODEBLK+FILEBLK+2)*BLOCKSIZ*sizeof(char))。 if (buf==NULL) exit(0)。 printf(\nIn format(),file system file is created ,fd = %x\n,fd)。 fseek(fd,0,SEEK_SET)。 fwrite(buf,1,(DINODEBLK+FILEBLK+2)*BLOCKSIZ*sizeof(char),fd)。 /* the passwd*/ passwd[0].p_uid=2116。passwd[0].p_gid=03。 strcpy(passwd[0].password,dddd)。 passwd[1].p_uid=2117。passwd[1].p_gid=03。 strcpy(passwd[1].password,bbbb)。 passwd[2].p_uid=2118。passwd[2].p_gid=04。 strcpy(passwd[2].password,abcd)。 passwd[3].p_uid=2119。passwd[3].p_gid=04。 strcpy(passwd[3].password,cccc)。 passwd[4].p_uid=2220。passwd[4].p_gid=05。 strcpy(passwd[4].password,eeee)。 /*給main()中的密碼表pwd[PWDNUM]填入內(nèi)容*/ pwd[0].p_uid=2116。pwd[0].p_gid=03。 strcpy(pwd[0].password,dddd)。 pwd[1].p_uid=2117。pwd[1].p_gid=03。 strcpy(pwd[1].password,bbbb)。 pwd[2].p_uid=2118。pwd[2].p_gid=04。 strcpy(pwd[2].password,abcd)。 pwd[3].p_uid=2119。pwd[3].p_gid=04。 strcpy(pwd[3].password,cccc)。 pwd[4].p_uid=2220。pwd[4].p_gid=05。 strcpy(pwd[4].password,eeee)。 /* the main directory and its sub dir etc and the file password*/ inode=iget(0)。 /*0 empty dinode id */ inodedi_mode=DIEMPTY。 iput(inode)。
點(diǎn)擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1