Changeset 320


Ignore:
Timestamp:
Feb 16, 2012, 3:07:55 PM (9 years ago)
Author:
dmik
Message:

Port Windows-specific b24 changes to OS/2.

Location:
trunk/openjdk/hotspot/src/os
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/hotspot/src/os/os2/vm/os_os2.cpp

    r301 r320  
    3131#include <os2wrap2.h>
    3232
    33 // do not include precompiled header file
    34 # include "incls/_os_windows.cpp.incl"
     33// no precompiled headers
     34#include "runtime/osThread.hpp"
    3535
    3636#define MIN2(x, y) (((x) < (y))? (x) : (y))
  • trunk/openjdk/hotspot/src/os/windows/vm/os_windows.cpp

    r315 r320  
    2626// Must be at least Windows 2000 or XP to use VectoredExceptions
    2727#define _WIN32_WINNT 0x500
     28#endif
     29
     30#ifdef __WIN32OS2__
     31#include <os2wrap2.h>
    2832#endif
    2933
     
    104108#include <vdmdbg.h>
    105109
     110#ifdef __EMX__
     111
    106112#ifdef __WIN32OS2__
    107113#include <mmsystem.h>
    108114#include <wincon.h>
    109115#include <basetsd.h>
     116#include <winsock.h>
    110117#define _M_IX86
     118#endif
     119
     120#define _stati64 stat
     121#define _fstati64 fstat
    111122#define _lseeki64 lseek
    112 #endif
     123
     124#endif /* EMX */
    113125
    114126// for timer info max values which include all bits
     
    40334045  #ifdef DEBUG
    40344046    jio_fprintf(stderr, "sysNativePath: %s\n", path);
    4035   #endif DEBUG
     4047  #endif
    40364048  return path;
    40374049}
     
    40414053
    40424054int os::ftruncate(int fd, jlong length) {
    4043   HANDLE h = (HANDLE)::_get_osfhandle(fd);
    4044   long high = (long)(length >> 32);
    4045   DWORD ret;
    4046 
    4047   if (h == (HANDLE)(-1)) {
    4048     return -1;
    4049   }
    4050 
    4051   ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN);
    4052   if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) {
     4055#ifdef __EMX__
     4056    return ftruncate(fd, length);
     4057#else /* __EMX__ */
     4058    HANDLE h = (HANDLE)::_get_osfhandle(fd);
     4059    long high = (long)(length >> 32);
     4060    DWORD ret;
     4061
     4062    if (h == (HANDLE)(-1)) {
    40534063      return -1;
    4054   }
    4055 
    4056   if (::SetEndOfFile(h) == FALSE) {
    4057     return -1;
    4058   }
    4059 
    4060   return 0;
     4064    }
     4065
     4066    ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN);
     4067    if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) {
     4068        return -1;
     4069    }
     4070
     4071    if (::SetEndOfFile(h) == FALSE) {
     4072      return -1;
     4073    }
     4074
     4075    return 0;
     4076#endif /* __EMX__ */
    40614077}
    40624078
     
    40674083
    40684084int os::fsync(int fd) {
     4085#ifdef __EMX__
     4086    return fsync(fd);
     4087#else /* __EMX__ */
    40694088  HANDLE handle = (HANDLE)::_get_osfhandle(fd);
    40704089
     
    40754094  }
    40764095  return 0;
     4096#endif /* __EMX__ */
    40774097}
    40784098
     
    40804100static int stdinAvailable(int, long *);
    40814101
     4102#ifndef S_ISCHR
    40824103#define S_ISCHR(mode)   (((mode) & _S_IFCHR) == _S_IFCHR)
     4104#endif
     4105#ifndef S_ISFIFO
    40834106#define S_ISFIFO(mode)  (((mode) & _S_IFIFO) == _S_IFIFO)
     4107#endif
    40844108
    40854109// This code is a copy of JDK's sysAvailable
     
    41274151    *
    41284152    */
     4153#ifdef __WIN32OS2__
     4154    os2_AVAILDATA avail = { 0, 0 };
     4155    os2_ULONG pipeState;
     4156    os2_APIRET arc = DosPeekNPipe(0, NULL, 0, NULL, &avail, &pipeState);
     4157    // note that even if ERROR_INVALID_PARAMETER, it seems to return the
     4158    // correct values in avail and state (undocumented)
     4159    if (arc != NO_ERROR && arc != ERROR_INVALID_PARAMETER) {
     4160        *pbytes = avail.cbpipe;
     4161        return TRUE;
     4162    }
     4163
     4164    return FALSE;
     4165#else
    41294166  HANDLE han;
    41304167
     
    41464183  }
    41474184  return TRUE;
     4185#endif
    41484186}
    41494187
     
    47634801
    47644802static void initSockFnTable() {
    4765   int (PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA);
     4803  int (FAR PASCAL * WSAStartupPtr)(WORD, LPWSADATA);
    47664804  WSADATA wsadata;
    47674805
     
    47824820
    47834821    /* If we loaded a DLL, then we might as well initialize it.  */
    4784     WSAStartupPtr = (int (PASCAL FAR *)(WORD, LPWSADATA))
     4822    WSAStartupPtr = (int (FAR PASCAL *)(WORD, LPWSADATA))
    47854823    ::GetProcAddress(hWinsock, "WSAStartup");
    47864824
Note: See TracChangeset for help on using the changeset viewer.