summaryrefslogtreecommitdiffstats
path: root/src/threads/thread.h
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-02-05 15:40:28 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-02-05 15:40:28 +0100
commit62b9f1b6b3fed01652153c5259427db97fe75e2c (patch)
tree277d419da1b212a7c5316f03c8747b3a76e0f505 /src/threads/thread.h
parente6b5b05535778b4b6e9131f473b95c9f2e106c60 (diff)
downloadpintos-62b9f1b6b3fed01652153c5259427db97fe75e2c.tar.gz
add fd to struct thread
Diffstat (limited to 'src/threads/thread.h')
-rw-r--r--src/threads/thread.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/threads/thread.h b/src/threads/thread.h
index 0039560..b209036 100644
--- a/src/threads/thread.h
+++ b/src/threads/thread.h
@@ -80,6 +80,12 @@ typedef int tid_t;
only because they are mutually exclusive: only a thread in the
ready state is on the run queue, whereas only a thread in the
blocked state is on a semaphore wait list. */
+struct fd
+ {
+ bool active;
+ struct file *file;
+ };
+
struct thread
{
/* Owned by thread.c. */
@@ -95,6 +101,10 @@ struct thread
#ifdef USERPROG
/* Owned by userprog/process.c. */
uint32_t *pagedir; /* Page directory. */
+
+ int num_files;
+ int max_files;
+ struct fd *files; /* Pointer to array of file descriptors. */
#endif
/* Owned by thread.c. */