1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Get rid of Vnode concept.

We already have an abstraction between Process and Inode/CharacterDevice/FIFO
and it's called FileDescriptor. :^)
This commit is contained in:
Andreas Kling 2019-01-16 12:57:07 +01:00
parent 310a5f4199
commit b46ae2bf09
15 changed files with 204 additions and 376 deletions

View file

@ -59,13 +59,23 @@ static int max(int a, int b)
return a > b ? a : b;
}
static int open_ptm()
{
char buf[32];
for (unsigned i = 0; i < 4; ++i) {
sprintf(buf, "/dev/ptm%u", i);
int fd = open(buf, O_RDWR);
if (fd)
return fd;
}
dbgprintf("No master PTY available :(\n");
exit(1);
return -1;
}
int main(int, char**)
{
int ptm_fd = open("/dev/ptm0", O_RDWR);
if (ptm_fd < 0) {
perror("open");
return 1;
}
int ptm_fd = open_ptm();
make_shell(ptm_fd);