summaryrefslogtreecommitdiff
path: root/sys/kern/kern_cred.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_cred.c')
-rw-r--r--sys/kern/kern_cred.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/kern/kern_cred.c b/sys/kern/kern_cred.c
index e1202fc..017b22a 100644
--- a/sys/kern/kern_cred.c
+++ b/sys/kern/kern_cred.c
@@ -56,6 +56,19 @@ setuid(uid_t new)
return 0;
}
+uid_t
+getuid(void)
+{
+ struct proc *td;
+
+ td = this_td();
+ if (td == NULL) {
+ return -1;
+ }
+
+ return td->cred.ruid;
+}
+
/*
* setuid() syscall
*
@@ -66,3 +79,9 @@ sys_setuid(struct syscall_args *scargs)
{
return setuid(scargs->arg0);
}
+
+scret_t
+sys_getuid(struct syscall_args *scargs)
+{
+ return getuid();
+}