| version 1.6, 2001/12/04 21:16:21 |
version 1.7, 2001/12/13 11:22:01 |
|
|
| /* |
/* |
| * $Log$ |
* $Log$ |
| |
* Revision 1.7 2001/12/13 11:22:01 jombik9 |
| |
* fcntl() added |
| |
* |
| * Revision 1.6 2001/12/04 21:16:21 jombik9 |
* Revision 1.6 2001/12/04 21:16:21 jombik9 |
| * Some changes -- try to make support for stream oriented applications. |
* Some changes -- try to make support for stream oriented applications. |
| * |
* |
|
|
| * |
* |
| * Revision 1.2 2001/09/21 19:44:51 host8 |
* Revision 1.2 2001/09/21 19:44:51 host8 |
| * Added $Log$ |
* Added $Log$ |
| |
* Added Revision 1.7 2001/12/13 11:22:01 jombik9 |
| |
* Added fcntl() added |
| |
* Added |
| * Added Revision 1.6 2001/12/04 21:16:21 jombik9 |
* Added Revision 1.6 2001/12/04 21:16:21 jombik9 |
| * Added Some changes -- try to make support for stream oriented applications. |
* Added Some changes -- try to make support for stream oriented applications. |
| * Added |
* Added |
|
|
| # include <sys/wait.h> |
# include <sys/wait.h> |
| #endif |
#endif |
| |
|
| |
#include <fcntl.h> |
| |
|
| #include <cfg/str/strdyn.h> |
#include <cfg/str/strdyn.h> |
| |
|
| #include "proctable.h" |
#include "proctable.h" |
| Line 427 proctable_exec(ptbl) |
|
| Line 435 proctable_exec(ptbl) |
|
| dup2(ptbl[i]->fd[k].pipe[k ? 1 : 0], k); |
dup2(ptbl[i]->fd[k].pipe[k ? 1 : 0], k); |
| #endif |
#endif |
| /* See the '1 ||' below. |
/* See the '1 ||' below. |
| close(ptbl[i]->fd[k].pipe[0]); |
close(ptbl[i]->fd[k].pipe[0]); |
| close(ptbl[i]->fd[k].pipe[1]); |
close(ptbl[i]->fd[k].pipe[1]); |
| */ |
*/ |
| } |
} |
| else { |
else { |
| #if DEBUG |
#if DEBUG |
| Line 445 proctable_exec(ptbl) |
|
| Line 453 proctable_exec(ptbl) |
|
| close(ptbl[j]->fd[k].pipe[1]); |
close(ptbl[j]->fd[k].pipe[1]); |
| } |
} |
| } |
} |
| /* |
/* |
| for (k = 0; k < N_FD; k++) |
for (k = 0; k < N_FD; k++) |
| if (ptbl[i]->fd[k].n_link == 0) |
if (ptbl[i]->fd[k].n_link == 0) |
| close(k); |
close(k); |
| */ |
*/ |
| /* setvbuf(stdout, NULL, _IONBF, 0); */ |
/* setvbuf(stdout, NULL, _IONBF, 0); */ |
| /* setbuf(stdout, NULL); */ |
/* setbuf(stdout, NULL); */ |
| |
|
| |
for (k = 0; k < N_FD; k++) { |
| |
/* fcntl(k, F_SETFL, O_NONBLOCK|O_NDELAY); */ |
| |
if (k == 1) { |
| |
fcntl(k, F_SETFL, O_NDELAY); |
| |
msg_print("Running fcntl()\n"); |
| |
} |
| |
/* fcntl(k, F_SETFL, O_NONBLOCK); */ |
| |
} |
| execvp(ptbl[i]->argv[0], ptbl[i]->argv); |
execvp(ptbl[i]->argv[0], ptbl[i]->argv); |
| /* |
/* |
| * RETURN VALUES |
* RETURN VALUES |