*/
int qemu_fdatasync(int fd)
{
-#ifdef _POSIX_SYNCHRONIZED_IO
+#ifdef CONFIG_FDATASYNC
return fdatasync(fd);
#else
return fsync(fd);
count -= copy;
}
}
+
+#ifndef _WIN32
+/* Sets a specific flag */
+int fcntl_setfl(int fd, int flag)
+{
+ int flags;
+
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1)
+ return -errno;
+
+ if (fcntl(fd, F_SETFL, flags | flag) == -1)
+ return -errno;
+
+ return 0;
+}
+#endif
+