diff --git a/libmaxsi/decl/clock_t.h b/libmaxsi/decl/clock_t.h
new file mode 100644
index 00000000..86f0607a
--- /dev/null
+++ b/libmaxsi/decl/clock_t.h
@@ -0,0 +1,4 @@
+#ifndef _CLOCK_T_DECL
+#define _CLOCK_T_DECL
+typedef __clock_t clock_t;
+#endif
diff --git a/libmaxsi/include/sys/types.h b/libmaxsi/include/sys/types.h
index 3c9d888b..7576982c 100644
--- a/libmaxsi/include/sys/types.h
+++ b/libmaxsi/include/sys/types.h
@@ -33,6 +33,7 @@ __BEGIN_DECLS
@include(useconds_t.h)
@include(pid_t.h)
+@include(clock_t.h)
__END_DECLS
diff --git a/libmaxsi/include/time.h b/libmaxsi/include/time.h
new file mode 100644
index 00000000..0f563e79
--- /dev/null
+++ b/libmaxsi/include/time.h
@@ -0,0 +1,38 @@
+/******************************************************************************
+
+ COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011.
+
+ This file is part of LibMaxsi.
+
+ LibMaxsi is free software: you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or (at your option)
+ any later version.
+
+ LibMaxsi is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with LibMaxsi. If not, see .
+
+ time.h
+ Time declarations.
+
+******************************************************************************/
+
+#ifndef _TIME_H
+#define _TIME_H 1
+
+#include
+
+__BEGIN_DECLS
+
+@include(clock_t.h)
+
+clock_t clock(void);
+
+__END_DECLS
+
+#endif
diff --git a/libmaxsi/time.cpp b/libmaxsi/time.cpp
index 35d3e98e..fd2e7b4e 100644
--- a/libmaxsi/time.cpp
+++ b/libmaxsi/time.cpp
@@ -26,6 +26,8 @@
#include
#include
#include
+#include
+#include
namespace Maxsi
{
@@ -37,5 +39,11 @@ namespace Maxsi
{
return SysUptime(usecssinceboot);
}
+
+ extern "C" clock_t clock(void)
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
}
}
diff --git a/sortix/x64/bits.h b/sortix/x64/bits.h
index e67c94ec..6ad8705c 100644
--- a/sortix/x64/bits.h
+++ b/sortix/x64/bits.h
@@ -130,6 +130,7 @@ typedef __off_t __blkcnt_t;
typedef unsigned int __nlink_t;
typedef __uintmax_t __ino_t;
typedef __uintptr_t __dev_t;
+typedef __intmax_t __clock_t;
#endif
diff --git a/sortix/x86/bits.h b/sortix/x86/bits.h
index c8c41033..504d4a24 100644
--- a/sortix/x86/bits.h
+++ b/sortix/x86/bits.h
@@ -130,6 +130,7 @@ typedef __off_t __blkcnt_t;
typedef unsigned int __nlink_t;
typedef __uintmax_t __ino_t;
typedef __uintptr_t __dev_t;
+typedef __intmax_t __clock_t;
#endif