diff options
author | Darren Tucker <dtucker@dtucker.net> | 2019-01-18 12:11:42 +1300 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2019-01-18 10:16:11 +1100 |
commit | 091093d25802b87d3b2b09f2c88d9f33e1ae5562 (patch) | |
tree | 16a433e3317c60c7a245b70818726d0a85203b19 /openbsd-compat/bsd-misc.h | |
parent | 609644027dde1f82213699cb6599e584c7efcb75 (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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 52ec5285..584c2b5e 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -64,6 +64,14 @@ struct timeval { int utimes(char *, struct timeval *); #endif /* HAVE_UTIMES */ +#ifndef HAVE_UTIMENSAT +/* start with the high bits and work down to minimise risk of overlap */ +# ifndef AT_SYMLINK_NOFOLLOW +# define AT_SYMLINK_NOFOLLOW 0x80000000 +# endif +int utimensat(int, const char *, const struct timespec[2], int); +#endif + #ifndef HAVE_TRUNCATE int truncate (const char *, off_t); #endif /* HAVE_TRUNCATE */ |