Thread (10 messages) flat view 10 messages, 5 authors, 2016-06-15

Re: what's the current wisdom on git over NFS/CIFS?

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:47:01

Dmitry Potapov schrieb:
On Fri, Jul 03, 2009 at 08:14:46AM +0200, Johannes Sixt wrote:
quoted
(We don't yet have an implementation of fsync() :-( )
Why?
Nobody cared. ;)
It appears rather straightforward to me. Here is a patch that
implements it. Or did I miss something?
Yes, but it's not critical; see below ;)
+int fsync(int fd)
+{
+	HANDLE h = (HANDLE) _get_osfhandle(fd);
+	if (h == INVALID_HANDLE_VALUE)
+	{
+		errno = EBADF;
+		return -1;
+	}
+	if (!FlushFileBuffers(h))
+	{
+		errno = err_win_to_posix(GetLastError());
+		return -1;
+	}
Do we ever call fsync on a pipe? In this case, fsync should fail with
EINVAL, but your implementation would wait until the reader has drained
all data.
-static inline int fsync(int fd)
-{ return 0; }
+int fsync(int fd);
This declaration is now in the wrong section of mingw.h. And someone who
cares should test it first; so I won't bless this patch as is.

Thanks anyway,
-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help