diff --git a/src/kernel/libroot/posix/time/stime.c b/src/kernel/libroot/posix/time/stime.c index 022e06ad97..334365e3eb 100644 --- a/src/kernel/libroot/posix/time/stime.c +++ b/src/kernel/libroot/posix/time/stime.c @@ -5,13 +5,21 @@ #include #include +#include +// ToDo: replace zero by a ROOT_UID when usergroup.c is implemented int stime(const time_t *tp) { - if (tp == NULL) - return B_ERROR; + if (tp == NULL) { + errno = EINVAL; + return -1; + } + if (geteuid() != 0) { + errno = EPERM; + return -1; + } set_real_time_clock(*tp); return B_OK; }