Skip to content

Instantly share code, notes, and snippets.

@yeonwooz
Created November 29, 2022 16:58
Show Gist options
  • Save yeonwooz/d74149c24e59bf543416175becdf8efe to your computer and use it in GitHub Desktop.
Save yeonwooz/d74149c24e59bf543416175becdf8efe to your computer and use it in GitHub Desktop.
file descriptor table
struct thread {
...
struct file *fdt[128];
}
for (int i = 2; i < 128; ++i ){
t->fdt[i] = NULL;
}
t->fdt[0] = 0; // stdin
t->fdt[1] = 1; // stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment