Lines Matching refs:descriptors

465 	struct php_proc_open_descriptor_item descriptors[PHP_PROC_OPEN_MAX_DESCRIPTORS];  in PHP_FUNCTION()  local
530 memset(descriptors, 0, sizeof(descriptors)); in PHP_FUNCTION()
555 descriptors[ndesc].index = nindex; in PHP_FUNCTION()
569 descriptors[ndesc].childend = dup_fd_as_handle(fd); in PHP_FUNCTION()
570 if (descriptors[ndesc].childend == NULL) { in PHP_FUNCTION()
575 descriptors[ndesc].childend = dup(fd); in PHP_FUNCTION()
576 if (descriptors[ndesc].childend < 0) { in PHP_FUNCTION()
581 descriptors[ndesc].mode = DESC_FILE; in PHP_FUNCTION()
606 descriptors[ndesc].mode = DESC_PIPE; in PHP_FUNCTION()
614 descriptors[ndesc].parentend = newpipe[1]; in PHP_FUNCTION()
615 descriptors[ndesc].childend = newpipe[0]; in PHP_FUNCTION()
616 descriptors[ndesc].mode |= DESC_PARENT_MODE_WRITE; in PHP_FUNCTION()
618 descriptors[ndesc].parentend = newpipe[0]; in PHP_FUNCTION()
619 descriptors[ndesc].childend = newpipe[1]; in PHP_FUNCTION()
623 descriptors[ndesc].parentend = dup_handle(descriptors[ndesc].parentend, FALSE, TRUE); in PHP_FUNCTION()
625descriptors[ndesc].mode_flags = descriptors[ndesc].mode & DESC_PARENT_MODE_WRITE ? O_WRONLY : O_RD… in PHP_FUNCTION()
628 descriptors[ndesc].mode_flags |= O_BINARY; in PHP_FUNCTION()
636 descriptors[ndesc].mode = DESC_FILE; in PHP_FUNCTION()
664 descriptors[ndesc].childend = dup_fd_as_handle(fd); in PHP_FUNCTION()
670 SetFilePointer(descriptors[ndesc].childend, 0, NULL, FILE_END); in PHP_FUNCTION()
673 descriptors[ndesc].childend = fd; in PHP_FUNCTION()
693 descriptors[ndesc].mode = DESC_PIPE; in PHP_FUNCTION()
694 descriptors[ndesc].childend = dup(slave_pty); in PHP_FUNCTION()
695 descriptors[ndesc].parentend = dup(dev_ptmx); in PHP_FUNCTION()
696 descriptors[ndesc].mode_flags = O_RDWR; in PHP_FUNCTION()
733 switch(descriptors[i].index) { in PHP_FUNCTION()
735 si.hStdInput = descriptors[i].childend; in PHP_FUNCTION()
738 si.hStdOutput = descriptors[i].childend; in PHP_FUNCTION()
741 si.hStdError = descriptors[i].childend; in PHP_FUNCTION()
777 CloseHandle(descriptors[i].childend); in PHP_FUNCTION()
778 if (descriptors[i].parentend) { in PHP_FUNCTION()
779 CloseHandle(descriptors[i].parentend); in PHP_FUNCTION()
795 channel.infd = descriptors[0].childend; in PHP_FUNCTION()
796 channel.outfd = descriptors[1].childend; in PHP_FUNCTION()
827 close(descriptors[i].childend); in PHP_FUNCTION()
828 if (descriptors[i].parentend) in PHP_FUNCTION()
829 close(descriptors[i].parentend); in PHP_FUNCTION()
861 switch (descriptors[i].mode & ~DESC_PARENT_MODE_WRITE) { in PHP_FUNCTION()
863 close(descriptors[i].parentend); in PHP_FUNCTION()
866 if (dup2(descriptors[i].childend, descriptors[i].index) < 0) in PHP_FUNCTION()
868 if (descriptors[i].childend != descriptors[i].index) in PHP_FUNCTION()
869 close(descriptors[i].childend); in PHP_FUNCTION()
895 close(descriptors[i].childend); in PHP_FUNCTION()
896 if (descriptors[i].parentend) in PHP_FUNCTION()
897 close(descriptors[i].parentend); in PHP_FUNCTION()
938 close_descriptor(descriptors[i].childend); in PHP_FUNCTION()
940 switch (descriptors[i].mode & ~DESC_PARENT_MODE_WRITE) { in PHP_FUNCTION()
942 switch(descriptors[i].mode_flags) { in PHP_FUNCTION()
962 stream = php_stream_fopen_from_fd(_open_osfhandle((zend_intptr_t)descriptors[i].parentend, in PHP_FUNCTION()
963 descriptors[i].mode_flags), mode_string, NULL); in PHP_FUNCTION()
965 stream = php_stream_fopen_from_fd(descriptors[i].parentend, mode_string, NULL); in PHP_FUNCTION()
968 fcntl(descriptors[i].parentend, F_SETFD, FD_CLOEXEC); in PHP_FUNCTION()
979 add_index_zval(pipes, descriptors[i].index, retfp); in PHP_FUNCTION()