1 #include "reactos_support_code.h"
2
3 void
isohybrid_error(int eval,const char * fmt,...)4 isohybrid_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
14 void
isohybrid_warning(const char * fmt,...)15 isohybrid_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
25 int
fsync(int fd)26 fsync(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
35 int
getppid(void)36 getppid(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
43