changeset 2087:2cdf77a8a0b6

* include/sys/time.h (new): Basic implementation. * include/time.h: Removed timeval which is now in sys/time.
author asl
date Sun, 23 Oct 2005 20:45:36 +0000
parents 7a7813d1e957
children 8c1285523bee
files packages/isoinfra/current/ChangeLog packages/isoinfra/current/include/sys/time.h packages/isoinfra/current/include/time.h
diffstat 3 files changed, 94 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/packages/isoinfra/current/ChangeLog
+++ b/packages/isoinfra/current/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-20  Alexander Neundorf <neundorf@kde.org>
+	    Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* include/sys/time.h (new): Basic implementation.
+	* include/time.h: Removed timeval which is now in sys/time.h
+
 2005-07-22  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/unistd.h: Const correctness to keep the compiler happy.
new file mode 100644
--- /dev/null
+++ b/packages/isoinfra/current/include/sys/time.h
@@ -0,0 +1,88 @@
+#ifndef CYGONCE_ISO_SYS_TIME_H
+#define CYGONCE_ISO_SYS_TIME_H
+/*========================================================================
+//
+//      sys/time.h
+//
+//      struct timeval and gettimeofday()
+//
+//========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2005  eCosCentric Limited
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos 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 General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     Alexander Neundorf <neundorf@kde.org>
+// Contributors:  
+// Date:          2005-10-04
+// Purpose:       This file provides the time macros, types and functions
+//                required by ISO C and POSIX 1003.1.
+// Description:   The real contents of this file get set from the
+//                configuration (set by the implementation)
+// Usage:         #include <sys/time.h>
+//
+//####DESCRIPTIONEND####
+//
+//======================================================================
+*/
+
+/* CONFIGURATION */
+
+#include <pkgconf/isoinfra.h>          /* Configuration header */
+
+/* INCLUDES */
+
+/* This is the "standard" way to get NULL and size_t from stddef.h,
+ * which is the canonical location of the definitions.
+ */
+#define __need_NULL
+#define __need_size_t
+#include <stddef.h>
+
+#include <time.h>
+#ifdef CYGBLD_ISO_STRUCTTIMEVAL_HEADER
+# include CYGBLD_ISO_STRUCTTIMEVAL_HEADER
+#else
+
+/*
+ * Structure returned by gettimeofday(2),
+ * and used in other calls such as select(2).
+ */
+struct timeval {
+	time_t	tv_sec;		/* seconds */
+	time_t	tv_usec;	/* and microseconds */
+};
+
+#endif
+
+
+#endif /* CYGONCE_ISO_SYS_TIME_H multiple inclusion protection */
+
+/* EOF sys/time.h */
--- a/packages/isoinfra/current/include/time.h
+++ b/packages/isoinfra/current/include/time.h
@@ -34,9 +34,6 @@
 //
 // This exception does not invalidate any other reasons why a work based on
 // this file might be covered by the GNU General Public License.
-//
-// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
-// at http://sources.redhat.com/ecos/ecos-license/
 // -------------------------------------------
 //####ECOSGPLCOPYRIGHTEND####
 //========================================================================
@@ -99,24 +96,6 @@ typedef long clock_t;
 #  define __clock_t_defined
 #endif
 
-#ifdef CYGBLD_ISO_STRUCTTIMEVAL_HEADER
-# include CYGBLD_ISO_STRUCTTIMEVAL_HEADER
-#else
-# ifndef _POSIX_SOURCE
-
-/*
- * Structure returned by gettimeofday(2),
- * and used in other calls such as select(2).
- */
-struct timeval {
-	long	tv_sec;		/* seconds */
-	long	tv_usec;	/* and microseconds */
-};
-
-# endif /* _POSIX_SOURCE */
-#endif
-
-
 #ifdef CYGINT_ISO_POSIX_CLOCK_TYPES
 # include CYGBLD_ISO_POSIX_CLOCK_TYPES_HEADER
 #else