diff options
author | Steve Huston <shuston@riverace.com> | 2007-02-07 22:27:46 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2007-02-07 22:27:46 +0000 |
commit | 446738d91beab5bfd1f9c503ac89c7da71ba56fb (patch) | |
tree | 80a937f11128d5d8066275c346bf997d980349f3 /ACE/ace/OS_NS_unistd.cpp | |
parent | af4fca013034e60fb485d3a8cff829e769dd067d (diff) | |
download | ATCD-446738d91beab5bfd1f9c503ac89c7da71ba56fb.tar.gz |
ChangeLogTag:Wed Feb 7 21:01:39 UTC 2007 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/OS_NS_unistd.cpp')
-rw-r--r-- | ACE/ace/OS_NS_unistd.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ACE/ace/OS_NS_unistd.cpp b/ACE/ace/OS_NS_unistd.cpp index 81b2c9e3aa9..26008066a76 100644 --- a/ACE/ace/OS_NS_unistd.cpp +++ b/ACE/ace/OS_NS_unistd.cpp @@ -594,8 +594,23 @@ ACE_OS::pwrite (ACE_HANDLE handle, # else /* ACE_HAS_WIN32_OVERLAPPED_IO */ - // Go to the correct position - if (! ::SetFilePointerEx (handle, loffset, 0, FILE_BEGIN)) + // Go to the correct position; if this is a Windows variant without + // overlapped I/O, it probably doesn't have SetFilePointerEx either, + // so manage this with SetFilePointer, changing calls based on the use + // of 64 bit offsets. + DWORD newpos; +# if defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 + newpos = ::SetFilePointer (handle, + loffset.LowPart, + &loffset.HighPart, + FILE_BEGIN); +# else + newpos = ::SetFilePointer (handle, + loffset.LowPart, + 0, + FILE_BEGIN); +# endif /* 64-bit file offsets */ + if (newpos == 0xFFFFFFFF && ::GetLastError () != NO_ERROR) { ACE_OS::set_errno_to_last_error (); return -1; |