* Registry.cs: Fixed copy/paste bug.
[mono-project.git] / support / time.c
blob71bbae9d0375a4d1e6d1f83640560d4209c56bbb
1 /*
2 * <time.h> wrapper functions.
4 * Authors:
5 * Jonathan Pryor (jonpryor@vt.edu)
7 * Copyright (C) 2004 Jonathan Pryor
8 */
10 #define _SVID_SOURCE
11 #include <time.h>
12 #include <errno.h>
14 #include "mph.h"
15 #include <glib/gtypes.h>
17 G_BEGIN_DECLS
19 #ifdef HAVE_STIME
20 gint32
21 Mono_Posix_Syscall_stime (mph_time_t *t)
23 time_t _t;
24 if (t == NULL) {
25 errno = EFAULT;
26 return -1;
28 mph_return_if_time_t_overflow (*t);
29 _t = (time_t) *t;
30 return stime (&_t);
32 #endif /* ndef HAVE_STIME */
34 mph_time_t
35 Mono_Posix_Syscall_time (mph_time_t *t)
37 time_t _t, r;
38 if (t == NULL) {
39 errno = EFAULT;
40 return -1;
43 mph_return_if_time_t_overflow (*t);
45 _t = (time_t) *t;
46 r = time (&_t);
47 *t = _t;
49 return r;
52 G_END_DECLS
55 * vim: noexpandtab