From 938fb969934c83ad28cdc8b7e7d22bcd56f1fdcd Mon Sep 17 00:00:00 2001 From: mse5gj3yn <780736178@qq.com> Date: Fri, 9 Jul 2021 01:09:56 +0800 Subject: [PATCH] Delete 'pipe2.c' --- pipe2.c | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 pipe2.c diff --git a/pipe2.c b/pipe2.c deleted file mode 100644 index 8ee1c43..0000000 --- a/pipe2.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * linux/fs/pipe.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -#include -#include /* for get_free_page */ -#include - - -int sys_pipe2(unsigned long * fildes,int flag) -{ - struct m_inode * inode; - struct file * f[2]; - int fd[2]; - int i,j; - if(flag==0){ - j=0; - for(i=0;j<2 && if_count++; - if (j==1) - f[0]->f_count=0; - if (j<2) - return -1; - j=0; - for(i=0;j<2 && ifilp[i]) { - current->filp[ fd[j]=i ] = f[j]; - j++; - } - if (j==1) - current->filp[fd[0]]=NULL; - if (j<2) { - f[0]->f_count=f[1]->f_count=0; - return -1; - } - if (!(inode=get_pipe_inode())) { - current->filp[fd[0]] = - current->filp[fd[1]] = NULL; - f[0]->f_count = f[1]->f_count = 0; - return -1; - } - f[0]->f_inode = f[1]->f_inode = inode; - f[0]->f_pos = f[1]->f_pos = 0; - f[0]->f_mode = 1; /* read */ - f[1]->f_mode = 2; /* write */ - put_fs_long(fd[0],0+fildes); - put_fs_long(fd[1],1+fildes); - } - return 0; -}