Print this page
13111 Want futimes() and lutimes() functions
Change-ID: I3be82d4242255a4100f8c35db373eb9140402fc4

@@ -13,10 +13,12 @@
  *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ *
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  */
 
 /*
  * Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  */

@@ -397,10 +399,11 @@
 #if !defined(_KERNEL) && !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
         defined(__EXTENSIONS__)
 
 int getitimer(int, struct itimerval *);
 int utimes(const char *, const struct timeval *);
+
 #if defined(_XPG4_2)
 int setitimer(int, const struct itimerval *_RESTRICT_KYWD,
         struct itimerval *_RESTRICT_KYWD);
 #else
 int setitimer(int, struct itimerval *_RESTRICT_KYWD,

@@ -407,10 +410,26 @@
         struct itimerval *_RESTRICT_KYWD);
 #endif /* defined(_XPG2_2) */
 
 #endif /* !defined(_KERNEL) ... defined(_XPG4_2) */
 
+#if !defined(_KERNEL) && !defined(_STRICT_SYMBOLS)
+int futimes(int, const struct timeval *);
+int lutimes(const char *, const struct timeval *);
+
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+        (tv)->tv_sec = (ts)->tv_sec; \
+        (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
+
+#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+        (ts)->tv_sec = (tv)->tv_sec; \
+        (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+
+#endif /* !defined(_KERNEL) && !defined(_STRICT_SYMBOLS) */
+
 /*
  * gettimeofday() and settimeofday() were included in SVr4 due to their
  * common use in BSD based applications.  They were to be included exactly
  * as in BSD, with two parameters.  However, AT&T/USL noted that the second
  * parameter was unused and deleted it, thereby making a routine included