From 29539c9aca1c76925291a3966595be4349149777 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Mon, 30 Nov 2020 00:46:05 +0100 Subject: Remove use of copy_stat() from sys_fstat and sys_lstat (#228) --- pk/syscall.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pk') diff --git a/pk/syscall.c b/pk/syscall.c index 422b16c..a5e12f2 100644 --- a/pk/syscall.c +++ b/pk/syscall.c @@ -132,7 +132,9 @@ int sys_fstat(int fd, void* st) if (f) { - r = file_stat(f, st); + struct frontend_stat buf; + r = frontend_syscall(SYS_fstat, f->kfd, va2pa(&buf), 0, 0, 0, 0, 0); + memcpy(st, &buf, sizeof(buf)); file_decref(f); } @@ -215,7 +217,7 @@ long sys_lstat(const char* name, void* st) struct frontend_stat buf; size_t name_size = strlen(name)+1; long ret = frontend_syscall(SYS_lstat, va2pa(name), name_size, va2pa(&buf), 0, 0, 0, 0); - copy_stat(st, &buf); + memcpy(st, &buf, sizeof(buf)); return ret; } -- cgit v1.1