summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2019-01-18 12:11:42 +1300
committerDarren Tucker <dtucker@dtucker.net>2019-01-18 10:16:11 +1100
commit091093d25802b87d3b2b09f2c88d9f33e1ae5562 (patch)
tree16a433e3317c60c7a245b70818726d0a85203b19 /openbsd-compat/bsd-misc.h
parent609644027dde1f82213699cb6599e584c7efcb75 (diff)
Add a minimal implementation of utimensat().
Some systems (eg older OS X) do not have utimensat, so provide minimal implementation in compat layer. Fixes build on at least El Capitan.
Diffstat (limited to 'openbsd-compat/bsd-misc.h')
-rw-r--r--openbsd-compat/bsd-misc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 52ec52853..584c2b5ef 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -64,6 +64,14 @@ struct timeval {
64int utimes(char *, struct timeval *); 64int utimes(char *, struct timeval *);
65#endif /* HAVE_UTIMES */ 65#endif /* HAVE_UTIMES */
66 66
67#ifndef HAVE_UTIMENSAT
68/* start with the high bits and work down to minimise risk of overlap */
69# ifndef AT_SYMLINK_NOFOLLOW
70# define AT_SYMLINK_NOFOLLOW 0x80000000
71# endif
72int utimensat(int, const char *, const struct timespec[2], int);
73#endif
74
67#ifndef HAVE_TRUNCATE 75#ifndef HAVE_TRUNCATE
68int truncate (const char *, off_t); 76int truncate (const char *, off_t);
69#endif /* HAVE_TRUNCATE */ 77#endif /* HAVE_TRUNCATE */