va_start(v, message);
len = _vscprintf(message, v);
output = malloc(len + sizeof(char));
- vsprintf_s(output, len + sizeof(char), message, v);
+ vsprintf(output, message, v);
WriteFile(log_file, output, len, &bytes_written, NULL);
va_end(v);
- free(output);
+ free(output);
}
int kill(pid_t pid, int sig)
int posix_fallocate(int fd, off_t offset, off_t len)
{
- const int BUFFER_SIZE = 64 * 1024 * 1024;
+ const int BUFFER_SIZE = 256 * 1024;
int rc = 0;
char *buf;
unsigned int write_len;
break;
}
+ /* Don't allow Windows to cache the write: flush it to disk */
+ _commit(fd);
+
bytes_remaining -= bytes_written;
}
return 0;
}
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+ return 0;
+}
+
int posix_madvise(void *addr, size_t len, int advice)
{
log_err("%s is not implemented\n", __func__);
int i;
int rc;
- if (timeout != -1)
+ if (timeout != -1) {
to = &tv;
-
- to->tv_sec = timeout / 1000;
- to->tv_usec = (timeout % 1000) * 1000;
+ to->tv_sec = timeout / 1000;
+ to->tv_usec = (timeout % 1000) * 1000;
+ }
FD_ZERO(&readfds);
FD_ZERO(&writefds);
errno = ENOSPC;
WSACleanup();
+
return ret;
}