begin simple child process interface

This commit is contained in:
Emile Clark-Boman 2025-09-10 01:25:08 +10:00
parent 8991d8ec04
commit 2e10e88504
3 changed files with 82 additions and 14 deletions

View file

@ -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;
}