Added a kind-of-working openpty()

This commit is contained in:
Mark
2020-01-03 22:13:38 +02:00
parent ce81c6fa9e
commit dd8564a134
9 changed files with 238 additions and 4 deletions
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include "sys/fs/node.h"
#include "sys/ring.h"
#include "sys/chr.h"
struct pty {
int number;
vnode_t *master;
vnode_t *slave;
// TODO: winsize/termios
struct chrdev dev_master;
struct chrdev dev_slave;
// Slave reads
// Master writes
struct ring ring_input;
// Slave writes
// Master reads
struct ring ring_output;
int owner_pid;
};
struct pty *pty_create(void);
+2
View File
@@ -18,4 +18,6 @@
#define SYSCALL_NR_EXIT 60
#define SYSCALL_NR_KILL 62
#define SYSCALL_NR_GETTIMEOFDAY 96
#define SYSCALL_NRX_OPENPTY 118
#define SYSCALL_NRX_SIGRET 119