Reactos
1#include "reactos_support_code.h"
2
3void
4isohybrid_error(int eval, const char* fmt, ...)
5{
6 va_list ap;
7 va_start(ap, fmt);
8 fprintf(stderr, "isohybrid: ");
9 vfprintf(stderr, fmt, ap);
10 va_end(ap);
11 exit(eval);
12}
13
14void
15isohybrid_warning(const char *fmt, ...)
16{
17 va_list ap;
18 va_start(ap, fmt);
19 fprintf(stderr, "isohybrid: ");
20 vfprintf(stderr, fmt, ap);
21 va_end(ap);
22}
23
24#ifdef _WIN32
25int
26fsync(int fd)
27{
28 HANDLE hFile = (HANDLE)_get_osfhandle(fd);
29 if (hFile == INVALID_HANDLE_VALUE)
30 return 1;
31
32 return !FlushFileBuffers(hFile);
33}
34
35int
36getppid(void)
37{
38 // Just return any nonzero value under Windows to enable isohybrid's usage
39 // as a part of srand initialization.
40 return 1;
41}
42#endif