Lines Matching defs:pv

888 int	sh_pipe(register int pv[])
892 if(pipe(fd)<0 || (pv[0]=fd[0])<0 || (pv[1]=fd[1])<0)
894 pv[0] = sh_iomovefd(pv[0]);
895 pv[1] = sh_iomovefd(pv[1]);
896 shp->fdstatus[pv[0]] = IONOSEEK|IOREAD;
897 shp->fdstatus[pv[1]] = IONOSEEK|IOWRITE;
898 sh_subsavefd(pv[0]);
899 sh_subsavefd(pv[1]);
904 int sh_rpipe(register int pv[])
906 return sh_pipe(pv);
911 int sh_rpipe(register int pv[])
915 if(pipe(fd)<0 || (pv[0]=fd[0])<0 || (pv[1]=fd[1])<0)
917 pv[0] = sh_iomovefd(pv[0]);
918 pv[1] = sh_iomovefd(pv[1]);
919 shp->fdstatus[pv[0]] = IONOSEEK|IOREAD;
920 shp->fdstatus[pv[1]] = IONOSEEK|IOWRITE;
921 sh_subsavefd(pv[0]);
922 sh_subsavefd(pv[1]);
928 int sh_coaccept(Shell_t *shp,int *pv,int out)
930 int fd = accept(pv[0],(struct sockaddr*)0,(socklen_t*)0);
931 sh_close(pv[0]);
932 pv[0] = -1;
935 if((pv[out]=sh_fcntl(fd,F_DUPFD,10)) >=10)
938 pv[out] = sh_iomovefd(fd);
939 if(fcntl(pv[out],F_SETFD,FD_CLOEXEC) >=0)
940 shp->fdstatus[pv[out]] |= IOCLEX;
941 shp->fdstatus[pv[out]] = (out?IOWRITE:IOREAD);
942 shp->fdstatus[pv[out]] |= IONOSEEK;
943 sh_subsavefd(pv[out]);
945 shutdown(pv[out],out?SHUT_RD:SHUT_WR);
950 int sh_copipe(Shell_t *shp, int *pv, int out)
955 if ((pv[out] = socket (AF_INET, SOCK_STREAM, 0)) < 0)
964 while ((r=bind (pv[out], (struct sockaddr *) &sin, slen)) == -1 && errno==EADDRINUSE);
965 if(r<0 || listen(pv[out],5) <0)
967 close(pv[out]);
970 fcntl(pv[out],F_SETFD,FD_CLOEXEC);
971 shp->fdstatus[pv[out]] |= IOCLEX;
972 pv[1-out] = -1;
973 pv[2] = port;
1063 void sh_pclose(register int pv[])
1065 if(pv[0]>=2)
1066 sh_close(pv[0]);
1067 if(pv[1]>=2)
1068 sh_close(pv[1]);
1069 pv[0] = pv[1] = -1;