vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / posix / time / stime.c
blobfc8a8e17b4817b7e0809355d61f2e2af7b2be9d1
1 /*
2 ** Copyright 2004, Jérôme Duval. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
6 #include <time.h>
7 #include <errno.h>
8 #include "syscalls.h"
10 #include <errno_private.h>
13 int
14 stime(const time_t *tp)
16 status_t status;
18 if (tp == NULL) {
19 __set_errno(EINVAL);
20 return -1;
23 status = _kern_set_real_time_clock((bigtime_t)*tp * 1000000);
24 if (status < B_OK) {
25 __set_errno(status);
26 return -1;
28 return 0;