[PATCH 054/114] Add <time.h> header for Phoenix.

Jakub Sejdak jakub.sejdak@phoesys.com
Mon Apr 11 10:24:00 GMT 2016


From: Kuba Sejdak <jakub.sejdak@phoesys.com>

---
 newlib/libc/sys/phoenix/include/time.h | 78 ++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 newlib/libc/sys/phoenix/include/time.h

diff --git a/newlib/libc/sys/phoenix/include/time.h b/newlib/libc/sys/phoenix/include/time.h
new file mode 100644
index 0000000..f378070
--- /dev/null
+++ b/newlib/libc/sys/phoenix/include/time.h
@@ -0,0 +1,78 @@
+/* Copyright (C) 2012-2016 Phoenix Systems (http://www.phoesys.com/).
+   This file is part of the GNU C Library.
+
+   The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library 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 the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef TIME_H
+#define TIME_H 
+
+#include <_ansi.h>
+#include <phoenix/time.h>
+#include <sys/reent.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+extern int _daylight;
+extern long _timezone;
+extern char *_tzname[2];
+
+/* POSIX defines the external tzname being defined in time.h */
+#ifndef tzname
+#define tzname	_tzname
+#endif
+
+typedef struct __tzrule_struct {
+	char ch;
+	int m;
+	int n;
+	int d;
+	int s;
+	time_t change;
+	long offset;
+} __tzrule_type;
+
+typedef struct __tzinfo_struct {
+	int __tznorth;
+	int __tzyear;
+	__tzrule_type __tzrule[2];
+} __tzinfo_type;
+
+__tzinfo_type *__gettzinfo();
+
+clock_t clock();
+int clock_gettime(clockid_t clock_id, struct timespec *tp);
+int clock_settime(clockid_t clock_id, const struct timespec *tp);
+int clock_getres(clockid_t clock_id, struct timespec *res);
+
+double difftime(time_t time1, time_t time0);
+time_t mktime(struct tm *tm);
+time_t time(time_t *t);
+
+char *asctime(const struct tm *tm);
+char *ctime(const time_t *timep);
+struct tm *gmtime(const time_t *timep);
+struct tm *localtime(const time_t *timep);
+
+char *asctime_r(const struct tm *tm, char *buf);
+char *ctime_r(const time_t *timep, char *buf);
+struct tm *gmtime_r(const time_t *timep, struct tm *result);
+struct tm *localtime_r(const time_t *timep, struct tm *result);
+
+size_t strftime(char *s, size_t max, const char *format, const struct tm *tm);
+
+int nanosleep(const struct timespec *req, struct timespec *rem);
+
+#endif
-- 
2.5.0



More information about the Newlib mailing list