Index: src/vm/vm.c =================================================================== --- src/vm/vm.c (revision 1153) +++ src/vm/vm.c (working copy) @@ -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. Index: configure.ac =================================================================== --- configure.ac (revision 1153) +++ configure.ac (working copy) @@ -165,6 +165,9 @@ *cygwin*) LDFLAGS="-no-undefined $LDFLAGS" ;; + *os2*) + LDFLAGS="-no-undefined -Zbin-files $LDFLAGS" + ;; *) AC_CHECK_LIB(c, dlopen, DYNAMIC_LD_LIBS="",