AC_CHECK_FUNCS(syslog vsyslog timegm)
AC_CHECK_FUNCS(setlocale nl_langinfo)
AC_CHECK_FUNCS(nanosleep,,[AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)])
+AC_CHECK_FUNCS(utimensat)
AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
AC_CHECK_HEADERS(sys/mman.h)
* we might be able to set sub-second timestamps.
* See what filetime set primitives we have.
*/
-#if defined(HAVE_UTIMES)
+#if defined(HAVE_UTIMENSAT)
+ *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#elif defined(HAVE_UTIMES)
/* utimes allows msec timestamps to be set. */
*p_ts_res = TIMESTAMP_SET_MSEC;
#elif defined(HAVE_UTIME)
*p_ts_res = TIMESTAMP_SET_SECONDS;
#endif
- /* TODO. Add a configure test for the Linux
- * nsec timestamp set system call, and use it
- * if available....
- */
DEBUG(10,("vfswrap_fs_capabilities: timestamp "
"resolution of %s "
"available on share %s, directory %s\n",
return 0;
}
-#if defined(HAVE_UTIMES)
+#if defined(HAVE_UTIMENSAT)
+ if (ft != NULL) {
+ struct timespec ts[2];
+ ts[0] = ft->atime;
+ ts[1] = ft->mtime;
+ result = utimensat(AT_FDCWD, smb_fname->base_name, ts, 0);
+ } else {
+ result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0);
+ }
+#elif defined(HAVE_UTIMES)
if (ft != NULL) {
struct timeval tv[2];
tv[0] = convert_timespec_to_timeval(ft->atime);