Browse Source

check if fdatasync is available and return ENOSYS if not

pull/334/head
Antonio SJ Musumeci 8 years ago
parent
commit
6d6fb45a3b
  1. 5
      src/fs_base_fsync.hpp

5
src/fs_base_fsync.hpp

@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <errno.h>
#include <unistd.h>
namespace fs
@ -33,6 +34,10 @@ namespace fs
int
fdatasync(const int fd)
{
#if _POSIX_SYNCHRONIZED_IO > 0
return ::fdatasync(fd);
#else
return (errno=ENOSYS,-1);
#endif
}
}
Loading…
Cancel
Save