Fixing syscalls to new seterrno and setretval.
[akaros.git] / kern / src / resource.c
index f6d42a6..266f80c 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <resource.h>
 #include <process.h>
 
 #include <resource.h>
 #include <process.h>
+#include <smp.h>
 #include <stdio.h>
 #include <assert.h>
 #include <schedule.h>
 #include <stdio.h>
 #include <assert.h>
 #include <schedule.h>
@@ -50,7 +51,7 @@ ssize_t core_request(struct proc *p)
                // save the context, to be restarted in _S mode
                p->env_tf = *current_tf;
                env_push_ancillary_state(p); // TODO: (HSS)
                // save the context, to be restarted in _S mode
                p->env_tf = *current_tf;
                env_push_ancillary_state(p); // TODO: (HSS)
-               proc_set_syscall_retval(&p->env_tf, ESUCCESS);
+               set_retval(ESUCCESS);
                /* sending death, since it's not our job to save contexts or anything in
                 * this case.  also, if this returns true, we will not return down
                 * below, and need to eat the reference to p */
                /* sending death, since it's not our job to save contexts or anything in
                 * this case.  also, if this returns true, we will not return down
                 * below, and need to eat the reference to p */
@@ -192,7 +193,7 @@ error_t resource_req(struct proc *p, int type, size_t amt_wanted,
                        retval = core_request(p);
                        // i don't like this retval hackery
                        if (retval < 0) {
                        retval = core_request(p);
                        // i don't like this retval hackery
                        if (retval < 0) {
-                               set_errno(current_tf, -retval);
+                               set_errno(-retval);
                                return -1;
                        }
                        else
                                return -1;
                        }
                        else