summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-09-18 11:51:27 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-09-18 11:51:27 +0000
commit5ae8f87cd03318a02cdd5d0ab2e51e015122e299 (patch)
treea8bf0e68e84b8eff6f7e30853f18f460075a2121 /usr/src/lib/libc/port
parenta2435eea0fd4937d2779dd36ee4c494704d07472 (diff)
parent24571f7b017865fbad5f588fb0694b558c94e14d (diff)
downloadillumos-joyent-5ae8f87cd03318a02cdd5d0ab2e51e015122e299.tar.gz
[illumos-gate merge]
commit 24571f7b017865fbad5f588fb0694b558c94e14d 13075 No console messages after early boot on non-VGA graphics commit 3d21c6bf2078598ab053d382b8a9af3b70b8e995 11064 md_clear is misspelt commit 73439c833efecf3010718112f4fce6bb183a6803 13080 Add support for cxgbe temp/volt sensor commit b7a7784945b3504d0b69ea02a08e1cddb5578907 13111 Want futimes(), lutimes() and timespec/timeval conversion macros
Diffstat (limited to 'usr/src/lib/libc/port')
-rw-r--r--usr/src/lib/libc/port/mapfile-vers6
-rw-r--r--usr/src/lib/libc/port/sys/utimesys.c28
2 files changed, 31 insertions, 3 deletions
diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers
index 29af604724..cd5543d872 100644
--- a/usr/src/lib/libc/port/mapfile-vers
+++ b/usr/src/lib/libc/port/mapfile-vers
@@ -78,6 +78,12 @@ $if _x86 && _ELF64
$add amd64
$endif
+SYMBOL_VERSION ILLUMOS_0.34 {
+ protected:
+ futimes;
+ lutimes;
+} ILLUMOS_0.33;
+
SYMBOL_VERSION ILLUMOS_0.33 {
protected:
c16rtomb;
diff --git a/usr/src/lib/libc/port/sys/utimesys.c b/usr/src/lib/libc/port/sys/utimesys.c
index dc917f27ae..55e53dbb53 100644
--- a/usr/src/lib/libc/port/sys/utimesys.c
+++ b/usr/src/lib/libc/port/sys/utimesys.c
@@ -24,6 +24,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#include "lint.h"
#include <string.h>
#include <utime.h>
@@ -67,8 +71,8 @@ utime(const char *path, const struct utimbuf *times)
return (utimensat(AT_FDCWD, path, tsp, 0));
}
-int
-utimes(const char *path, const struct timeval times[2])
+static int
+utimes_impl(const char *path, const struct timeval times[2], int flag)
{
struct timeval ltimes[2];
timespec_t ts[2];
@@ -86,7 +90,19 @@ utimes(const char *path, const struct timeval times[2])
ts[1].tv_nsec = ltimes[1].tv_usec * 1000;
tsp = ts;
}
- return (utimensat(AT_FDCWD, path, tsp, 0));
+ return (utimensat(AT_FDCWD, path, tsp, flag));
+}
+
+int
+utimes(const char *path, const struct timeval times[2])
+{
+ return (utimes_impl(path, times, 0));
+}
+
+int
+lutimes(const char *path, const struct timeval times[2])
+{
+ return (utimes_impl(path, times, AT_SYMLINK_NOFOLLOW));
}
#pragma weak _futimesat = futimesat
@@ -115,3 +131,9 @@ futimesat(int fd, const char *path, const struct timeval times[2])
return (utimensat(fd, path, tsp, 0));
}
+
+int
+futimes(int fd, const struct timeval times[2])
+{
+ return (futimesat(fd, NULL, times));
+}