# HG changeset patch # User diego # Date 1223590836 0 # Node ID 0ac6f0d242bc293bde4b579dc3cd96cfa950b208 # Parent bba82ef5d75a69aa3414c57dcbe3a451da671977 OS/2 support by KO Myung-Hun, komh chollian net diff -r bba82ef5d75a -r 0ac6f0d242bc vm/vm.c --- a/vm/vm.c Thu Oct 09 22:20:01 2008 +0000 +++ b/vm/vm.c Thu Oct 09 22:20:36 2008 +0000 @@ -52,6 +52,11 @@ #include /* read() */ #endif /* _MSC_VER */ +#ifdef __OS2__ +#define INCL_DOS +#include +#endif + /* #define STRICT */ @@ -131,6 +136,27 @@ } #endif +#ifdef __OS2__ +#define open os2_open + +static int os2_open(const char *name, int oflag) +{ + HFILE hfile; + ULONG ulAction; + ULONG rc; + + rc = DosOpen( name, &hfile, &ulAction, 0, FILE_NORMAL, + OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW, + OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD, + NULL ); + + if( rc ) + return -1; + + return ( int )hfile; +} +#endif + static void dvd_read_name(char *name, const char *device) { /* Because we are compiling with _FILE_OFFSET_BITS=64 * all off_t are 64bit.