146 if((
m_pid = ::fork()) == 0)
157 struct dsc$descriptor_s image,prcnam,input,output,error,*inputptr,*outputptr,*errorptr;
160 image.dsc$b_dtype = DSC$K_DTYPE_T;
161 image.dsc$b_class = DSC$K_CLASS_S;
165 prcnam.dsc$b_dtype = DSC$K_DTYPE_T;
166 prcnam.dsc$b_class = DSC$K_CLASS_S;
170 input.dsc$b_dtype = DSC$K_DTYPE_T;
171 input.dsc$b_class = DSC$K_CLASS_S;
175 output.dsc$b_dtype = DSC$K_DTYPE_T;
176 output.dsc$b_class = DSC$K_CLASS_S;
180 error.dsc$b_dtype = DSC$K_DTYPE_T;
181 error.dsc$b_class = DSC$K_CLASS_S;
184 inputptr = outputptr = errorptr = 0;
185 if( input.dsc$w_length > 0) inputptr = &input;
186 if(output.dsc$w_length > 0) outputptr = &output;
187 if( error.dsc$w_length > 0) errorptr = &error;
189 if( inputptr != 0 && inputptr->dsc$a_pointer == NULL) inputptr = 0;
190 if(outputptr != 0 && outputptr->dsc$a_pointer == NULL) outputptr = 0;
191 if( errorptr != 0 && errorptr->dsc$a_pointer == NULL) errorptr = 0;
203 ret = sys$creprc(&
m_pid,&image,inputptr,outputptr,errorptr,0,0,&prcnam,
prio,0,0,0,0,0);
204 if(ret != SS$_NORMAL)
return -1;
211 PROCESS_INFORMATION pi;
212 DWORD dwCreationFlags;
215 dwCreationFlags = CREATE_NO_WINDOW;
216 if (
prio == 0) dwCreationFlags |= IDLE_PRIORITY_CLASS;
217 else if(
prio == 1) dwCreationFlags |= NORMAL_PRIORITY_CLASS;
218 else if(
prio == 2) dwCreationFlags |= HIGH_PRIORITY_CLASS;
219 else if(
prio == 3) dwCreationFlags |= REALTIME_PRIORITY_CLASS;
222 , FALSE, dwCreationFlags
225 m_pid = (int) pi.hProcess;
227 CloseHandle(pi.hThread);
int rlexec(const char *command)
int rlstrlen(const char *str)