begin simple child process interface
This commit is contained in:
parent
8991d8ec04
commit
2e10e88504
3 changed files with 82 additions and 14 deletions
19
cli/main.c
19
cli/main.c
|
|
@ -1,7 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "mkpty.h"
|
||||
#include "child.h"
|
||||
|
||||
// struct d_window {
|
||||
// int ptmx; // fd
|
||||
|
|
@ -14,17 +15,7 @@
|
|||
// }
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
pid_t pid;
|
||||
switch (pid = forkmkpty()) {
|
||||
case -1:
|
||||
perror("forkmkpty");
|
||||
break;
|
||||
case 0:
|
||||
printf("fork: children\n");
|
||||
break;
|
||||
default:
|
||||
printf("fork: parent\n");
|
||||
break;
|
||||
}
|
||||
struct d_child child;
|
||||
spawnchild(&child);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue