Skip to content

Commit 332e27e

Browse files
committed
ch6
1 parent b252474 commit 332e27e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

os/syscall.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,21 @@ uint64 sys_close(int fd)
165165
return 0;
166166
}
167167

168+
int sys_fstat(int fd,uint64 stat){
169+
//TODO: your job is to complete the syscall
170+
return -1;
171+
}
172+
173+
int sys_linkat(int olddirfd, uint64 oldpath, int newdirfd, uint64 newpath, uint64 flags){
174+
//TODO: your job is to complete the syscall
175+
return -1;
176+
}
177+
178+
int sys_unlinkat(int dirfd, uint64 name, uint64 flags){
179+
//TODO: your job is to complete the syscall
180+
return -1;
181+
}
182+
168183
extern char trap_page[];
169184

170185
void syscall()
@@ -212,6 +227,15 @@ void syscall()
212227
case SYS_wait4:
213228
ret = sys_wait(args[0], args[1]);
214229
break;
230+
case SYS_fstat:
231+
ret = sys_fstat(args[0],args[1]);
232+
break;
233+
case SYS_linkat:
234+
ret = sys_linkat(args[0],args[1],args[2],args[3],args[4]);
235+
break;
236+
case SYS_unlinkat:
237+
ret = sys_unlinkat(args[0],args[1],args[2]);
238+
break;
215239
default:
216240
ret = -1;
217241
errorf("unknown syscall %d", id);

0 commit comments

Comments
 (0)