From 8edc4bb4c8f3b39fff9627b2433bffe131b75687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 23 Sep 2002 02:33:02 +0000 Subject: [PATCH] Added a very preliminary time.h Removed the bzero()/bcopy() prototypes, and replaced them with macros - we should decide what to do with them. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1119 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/string.h | 6 ++++-- headers/posix/sys/types.h | 1 + headers/posix/time.h | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 headers/posix/time.h diff --git a/headers/posix/string.h b/headers/posix/string.h index dc13a9cb34..85ceb6d5b1 100644 --- a/headers/posix/string.h +++ b/headers/posix/string.h @@ -46,8 +46,10 @@ extern const char *strerror(int error); // ToDo: remove bzero(), bcopy() from here - we don't need those // implementations anyway, since BeOS defines them as macros // Of course, we could also just keep them (and bcmp() is missing) -extern void *bcopy(void const *source, void *dest, size_t length); -extern void bzero(void *buffer, size_t length); +//extern void *bcopy(void const *source, void *dest, size_t length); +//extern void bzero(void *buffer, size_t length); +#define bcopy(source, dest, length) memcpy(dest, source, length) +#define bzero(buffer, length) memset(buffer, 0, length) /* non-standard string functions */ extern int strcasecmp(const char *string1, const char *string2); diff --git a/headers/posix/sys/types.h b/headers/posix/sys/types.h index 92992b197f..9a1efbeff7 100644 --- a/headers/posix/sys/types.h +++ b/headers/posix/sys/types.h @@ -1,2 +1,3 @@ // ToDo: fix me! #include +#include diff --git a/headers/posix/time.h b/headers/posix/time.h new file mode 100644 index 0000000000..486b4fa8d1 --- /dev/null +++ b/headers/posix/time.h @@ -0,0 +1,20 @@ +#ifndef _TIME_H_ +#define _TIME_H_ + +typedef long clock_t; +typedef long time_t; + +#define CLOCKS_PER_SEC 1000 +#define CLK_TCK CLOCKS_PER_SEC + +#ifdef __cplusplus +extern "C" { +#endif + +// ToDo: add function prototypes... + +#ifdef __cplusplus +} +#endif + +#endif /* _TIME_H_ */