339{
341 if (cpus<1)
342 {
343
345 }
346#if 0
348 {
349 int cp_std[2];
350 int cp_hstd[2];
351 int err1=pipe(cp_std);
352 int err2=pipe(cp_hstd);
353 if (err1||err2)
354 {
355 Werror(
"pipe failed with %d\n",errno);
356 si_close(cp_std[0]);
357 si_close(cp_std[1]);
358 si_close(cp_hstd[0]);
359 si_close(cp_hstd[1]);
361 }
362 pid_t pid_std=fork();
363 if (pid_std==0)
364 {
366 si_close(cp_std[0]);
367 si_close(cp_hstd[0]);
368 si_close(cp_hstd[1]);
370 memset(&d,0,sizeof(d));
371 d.
f_write=fdopen(cp_std[1],
"w");
378 _exit(0);
379 }
380 pid_t pid_hstd=fork();
381 if (pid_hstd==0)
382 {
384 si_close(cp_hstd[0]);
385 si_close(cp_std[0]);
386 si_close(cp_std[1]);
388 memset(&d,0,sizeof(d));
389 d.
f_write=fdopen(cp_hstd[1],
"w");
392
396 {
398 }
400 _exit(0);
401 }
402
403 si_close(cp_std[1]);
404 si_close(cp_hstd[1]);
405 #ifdef HAVE_POLL
406 pollfd pfd[2];
407 pfd[0].fd=cp_std[0];
408 pfd[0].events=POLLIN;
409 pfd[1].fd=cp_hstd[0];
410 pfd[1].events=POLLIN;
411 int s=si_poll(pfd,2,-1);
414 memset(&d,0,sizeof(d));
417 {
421 si_close(cp_hstd[0]);
423 si_close(cp_std[0]);
424 kill(pid_hstd,SIGTERM);
425 si_waitpid(pid_std,
NULL,0);
426 si_waitpid(pid_hstd,
NULL,0);
427 }
429 {
433 si_close(cp_std[0]);
435 si_close(cp_hstd[0]);
436 kill(pid_std,SIGTERM);
437 si_waitpid(pid_hstd,
NULL,0);
438 si_waitpid(pid_std,
NULL,0);
439 }
441 #endif
442 }
443#endif
445}
si_hdl_typ si_set_signal(int sig, si_hdl_typ signal_handler)
meta function for binding a signal to an handler
void sig_term_hdl_child(int)
const CanonicalForm int s
static void * feOptValue(feOptIndex opt)
ideal kTryHilbstd(ideal F, ideal Q)
void Werror(const char *fmt,...)
ideal ssiReadIdeal(ssiInfo *d)
void ssiWriteIdeal(const ssiInfo *d, int typ, const ideal I)