mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
syscalls: make a bunch of system calls use the new user memory operations
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <kernel/fd.h>
|
||||
#include <kernel/sched.h>
|
||||
#include <string.h>
|
||||
#include <kernel/ustring.h>
|
||||
|
||||
|
||||
static int gettarget(fd_t** targ, dirnode_t** targnode, int ifd, proc_t* proc){
|
||||
@@ -44,14 +45,29 @@ syscallret syscall_linkat(int srcdirfd, const char* srcpath, int tgtdirfd, const
|
||||
return retv;
|
||||
}
|
||||
|
||||
size_t srclen = strlen(srcpath);
|
||||
size_t tgtlen = strlen(tgtpath);
|
||||
size_t srclen;
|
||||
size_t tgtlen;
|
||||
|
||||
retv.errno = u_strlen(srcpath, &srclen);
|
||||
if(retv.errno)
|
||||
return retv;
|
||||
|
||||
retv.errno = u_strlen(tgtpath, &tgtlen);
|
||||
if(retv.errno)
|
||||
return retv;
|
||||
|
||||
char srcbuff[srclen+1];
|
||||
char tgtbuff[tgtlen+1];
|
||||
|
||||
strcpy(srcbuff, srcpath);
|
||||
strcpy(tgtbuff, tgtpath);
|
||||
|
||||
|
||||
retv.errno = u_strcpy(srcbuff, srcpath);
|
||||
if(retv.errno)
|
||||
return retv;
|
||||
|
||||
retv.errno = u_strcpy(tgtbuff, tgtpath);
|
||||
if(retv.errno)
|
||||
return retv;
|
||||
|
||||
proc_t* proc = arch_getcls()->thread->proc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user