Compare commits
1 Commits
Task_2_-_U
...
rox-check-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
987a71ec40 |
@@ -8,6 +8,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "userprog/gdt.h"
|
#include "userprog/gdt.h"
|
||||||
#include "userprog/pagedir.h"
|
#include "userprog/pagedir.h"
|
||||||
|
#include "userprog/syscall.h"
|
||||||
#include "userprog/tss.h"
|
#include "userprog/tss.h"
|
||||||
#include "filesys/directory.h"
|
#include "filesys/directory.h"
|
||||||
#include "filesys/file.h"
|
#include "filesys/file.h"
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <syscall-nr.h>
|
#include <syscall-nr.h>
|
||||||
|
|
||||||
static struct lock filesys_lock;
|
|
||||||
static unsigned fd_counter = MIN_USER_FD;
|
static unsigned fd_counter = MIN_USER_FD;
|
||||||
|
|
||||||
struct open_file
|
struct open_file
|
||||||
@@ -143,9 +142,7 @@ syscall_exec (const char *cmd_line)
|
|||||||
{
|
{
|
||||||
validate_user_pointer (cmd_line, 1);
|
validate_user_pointer (cmd_line, 1);
|
||||||
|
|
||||||
lock_acquire (&filesys_lock);
|
|
||||||
pid_t pid = process_execute(cmd_line);
|
pid_t pid = process_execute(cmd_line);
|
||||||
lock_release (&filesys_lock);
|
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,14 @@
|
|||||||
#define USERPROG_SYSCALL_H
|
#define USERPROG_SYSCALL_H
|
||||||
|
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
|
#include "threads/synch.h"
|
||||||
|
|
||||||
#define MIN_USER_FD 2
|
#define MIN_USER_FD 2
|
||||||
|
|
||||||
typedef int pid_t;
|
typedef int pid_t;
|
||||||
|
|
||||||
|
struct lock filesys_lock;
|
||||||
|
|
||||||
void syscall_init (void);
|
void syscall_init (void);
|
||||||
|
|
||||||
unsigned fd_hash (const struct hash_elem *element, void *aux);
|
unsigned fd_hash (const struct hash_elem *element, void *aux);
|
||||||
|
|||||||
Reference in New Issue
Block a user