Print this page
code review feeback, close open comment
first round of POSIX 2008 stuff

@@ -1,20 +1,23 @@
 /*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
+ */
+
 #ifndef _SYS_TIMEB_H
 #define _SYS_TIMEB_H
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #ifdef  __cplusplus
 extern "C" {
 #endif
 
 #include <sys/types.h>
+#include <sys/feature_tests.h>
 
 /*
  * Copyright (c) 1991, 1993
  *      The Regents of the University of California.  All rights reserved.
  * (c) UNIX System Laboratories, Inc.

@@ -50,24 +53,34 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
 
-/* The ftime(2) system call structure */
+
+/*
+ * NOTE: This lives in sys/timeb.h due to standards requirements.
+ * The actual function is not a system call, but a libc function.  Hence
+ * this header should never be included into kernel modules.  Presumably
+ * the header shouldn't be included unless ftime() is desired, since it
+ * defines nothing else, but be pedantic.
+ */
+
+#ifndef _KERNEL
+
+#if (!defined(_STRICT_SYMBOLS)) || (defined(_XPG4_2) && !defined(_XPG7))
 struct timeb {
         time_t  time;                   /* seconds since the Epoch */
         unsigned short millitm;         /* + milliseconds since the Epoch */
         short   timezone;               /* minutes west of CUT */
         short   dstflag;                /* DST == non-zero */
 };
 
-#if defined(__STDC__)
 extern int ftime(struct timeb *);
-#else
-extern int ftime();
 #endif
 
+#endif /* _KERNEL */
+
 #ifdef  __cplusplus
 }
 #endif
 
 #endif  /* _SYS_TIMEB_H */