On OS X 10.8... checking for fdatasync... yes update-mime-database.c:960:6: warning: implicit declaration of function 'fdatasync' is invalid in C99 [-Wimplicit-function-declaration] if (fdatasync(fd) == -1) And then linking succeeds with no unresolved symbols. Our libSystem (analogous to linux glibc), that function exists, but it's not declared in any standard header and has no manpage. And the feature does not appear to be implemented: unistd.h defines _POSIX_SYNCHRONIZED_IO as -1, whereas 0 would mean supported. Google says that other OS X recent versions have the same situation (undeclared but present but unsupported) as well. My kernel sys/proto.h does have a declaration of fdatasync, but its prototype might indicate what libSystem does have isn't even what shared-mime-info wants (or at least would need an alternative parameter list): int fdatasync(struct proc *, struct fdatasync_args *, int *); 3 arguments! Until someone figures out what this function is and how/if it should be used (if it even works), probably better to have autoconf do a more thorough test than just AC_CHECK_FUNCS. Look for it being declared? Look for _POSIX_SYNCHRONIZED_IO being 0 (if it's defined)?
Still broken as of shared-mime-info-1.3
Generally waiting for a patch for this.
I can fix the code, but don't know the larger picture. Easy enough to test for the implementation as well as the header/symbol being present. Googling around, some other programs fall back to fsync() if fdatasync() isn't supported rather than not syncing at all. See for example, http://bugs.extatic.org/view.php?id=174 But it's a more expensive call IIRC...no idea how valuable doing some sort of sync is.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/7.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.