diff -cpr head/src/include/port.h win32_o_direct/src/include/port.h *** head/src/include/port.h Thu Jan 11 14:25:43 2007 --- win32_o_direct/src/include/port.h Fri Jan 12 10:28:00 2007 *************** extern bool rmtree(char *path, bool rmto *** 273,278 **** --- 273,279 ---- /* open() and fopen() replacements to allow deletion of open files and * passing of other special options. */ + #define O_DIRECT 0x80000000 extern int pgwin32_open(const char *, int,...); extern FILE *pgwin32_fopen(const char *, const char *); diff -cpr head/src/port/open.c win32_o_direct/src/port/open.c *** head/src/port/open.c Thu Jan 11 14:25:43 2007 --- win32_o_direct/src/port/open.c Fri Jan 12 10:28:00 2007 *************** openFlagsToCreateFileFlags(int openFlags *** 50,56 **** /* * - file attribute setting, based on fileMode? - * - handle other flags? (eg FILE_FLAG_NO_BUFFERING/FILE_FLAG_WRITE_THROUGH) */ int pgwin32_open(const char *fileName, int fileFlags,...) --- 50,55 ---- *************** pgwin32_open(const char *fileName, int f *** 62,68 **** /* Check that we can handle the request */ assert((fileFlags & ((O_RDONLY | O_WRONLY | O_RDWR) | O_APPEND | (O_RANDOM | O_SEQUENTIAL | O_TEMPORARY) | ! _O_SHORT_LIVED | O_DSYNC | (O_CREAT | O_TRUNC | O_EXCL) | (O_TEXT | O_BINARY))) == fileFlags); sa.nLength = sizeof(sa); --- 61,67 ---- /* Check that we can handle the request */ assert((fileFlags & ((O_RDONLY | O_WRONLY | O_RDWR) | O_APPEND | (O_RANDOM | O_SEQUENTIAL | O_TEMPORARY) | ! _O_SHORT_LIVED | O_DSYNC | O_DIRECT | (O_CREAT | O_TRUNC | O_EXCL) | (O_TEXT | O_BINARY))) == fileFlags); sa.nLength = sizeof(sa); *************** pgwin32_open(const char *fileName, int f *** 82,88 **** ((fileFlags & O_SEQUENTIAL) ? FILE_FLAG_SEQUENTIAL_SCAN : 0) | ((fileFlags & _O_SHORT_LIVED) ? FILE_ATTRIBUTE_TEMPORARY : 0) | ((fileFlags & O_TEMPORARY) ? FILE_FLAG_DELETE_ON_CLOSE : 0) | ! ((fileFlags & O_DSYNC) ? FILE_FLAG_WRITE_THROUGH : 0), NULL)) == INVALID_HANDLE_VALUE) { switch (GetLastError()) --- 81,88 ---- ((fileFlags & O_SEQUENTIAL) ? FILE_FLAG_SEQUENTIAL_SCAN : 0) | ((fileFlags & _O_SHORT_LIVED) ? FILE_ATTRIBUTE_TEMPORARY : 0) | ((fileFlags & O_TEMPORARY) ? FILE_FLAG_DELETE_ON_CLOSE : 0) | ! ((fileFlags & O_DIRECT) ? FILE_FLAG_NO_BUFFERING : 0) | ! ((fileFlags & O_DSYNC) ? FILE_FLAG_WRITE_THROUGH : 0), NULL)) == INVALID_HANDLE_VALUE) { switch (GetLastError())