return(ret_val);
}
+
+int process_setuid(process_t *proc, uid_t uid)
+{
+ process_t *cproc;
+ int ret_val;
+
+ ret_val = -EINVAL;
+ cproc = process_get_current();
+
+ if(cproc) {
+ /* check if caller is allowed to do that */
+ ret_val = -EACCES;
+ }
+
+ return(ret_val);
+}
+
+int process_setgid(process_t *proc, gid_t gid)
+{
+ return(-ENOSYS);
+}
+
+int process_set_pagedir(process_t *proc, pg_dir_t *pd)
+{
+ int ret_val;
+
+ ret_val = -EINVAL;
+
+ if(proc && pd) {
+ /* FIXME: make sure none of the tasks are running */
+ proc->p_pgdir = pd;
+
+ /* FIXME: Set t_pgdir in all tasks */
+ proc->p_tasks->t_pgdir = (u32_t)pg_dir_get_pdbr(pd);
+
+ /*
+ * TODO: The old page directory may still be referenced
+ * by the tasks' return stacks. Should we handle that here?
+ */
+ ret_val = 0;
+ }
+
+ return(ret_val);
+}
+
+int process_get_pagedir(process_t *proc, pg_dir_t **pd)
+{
+ int ret_val;
+
+ ret_val = -EINVAL;
+
+ if(proc && pd) {
+ *pd = proc->p_pgdir;
+ ret_val = 0;
+ }
+
+ return(ret_val);
+}
#include <corax/types.h>
#include <corax/ipc.h>
+#include <arch.h>
#define PROC_ENTRY_FORK ((void*)0)
#define PROC_ENTRY_VFORK ((void*)1)
int process_fork(int);
int process_detach(process_t*);
int process_suspend(process_t*);
+int process_setuid(process_t*, uid_t);
+int process_setgid(process_t*, gid_t);
+
+int process_set_pagedir(process_t*, pg_dir_t*);
+int process_get_pagedir(process_t*, pg_dir_t**);
#endif /* __PROCESS_H */