Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
script3r
GitHub Repository: script3r/os161
Path: blob/master/kern/syscall/close.c
2093 views
1
#include <types.h>
2
#include <lib.h>
3
#include <kern/errno.h>
4
#include <syscall.h>
5
#include <file.h>
6
#include <copyinout.h>
7
#include <current.h>
8
9
/**
10
* close() system call
11
*/
12
int
13
sys_close( int fd ) {
14
struct proc *p = NULL;
15
16
KASSERT( curthread != NULL );
17
KASSERT( curthread->td_proc != NULL );
18
19
p = curthread->td_proc;
20
return file_close_descriptor( p, fd );
21
}
22
23