diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-06-19 11:35:26 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-06-19 11:35:26 +0000 |
commit | ce881f3c5f83e208979a6b08803842df5e487c82 (patch) | |
tree | 0746204f5dfbb7a336ffd94b390df4e60b973cf2 | |
parent | a9916b603df49dbfba8768193abb493d7fb50099 (diff) | |
download | ATCD-ce881f3c5f83e208979a6b08803842df5e487c82.tar.gz |
ChangeLogTag: Mon Jun 19 10:08:17 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | ace/OS_NS_unistd.cpp | 10 | ||||
-rw-r--r-- | ace/OS_NS_unistd.h | 4 | ||||
-rw-r--r-- | ace/OS_NS_unistd.inl | 20 |
3 files changed, 20 insertions, 14 deletions
diff --git a/ace/OS_NS_unistd.cpp b/ace/OS_NS_unistd.cpp index 10ac7605d52..db26030145a 100644 --- a/ace/OS_NS_unistd.cpp +++ b/ace/OS_NS_unistd.cpp @@ -516,10 +516,12 @@ ACE_OS::pwrite (ACE_HANDLE handle, return -1; // Go to the correct position - DWORD altered_position = ::SetFilePointer (handle, - offset, - 0, - FILE_BEGIN); + LARGE_INTEGER loffset; + loffset.QuadPart = offset; + DWORD altered_position = ::SetFilePointerEx (handle, + loffset, + 0, + FILE_BEGIN); if (altered_position == 0xFFFFFFFF) return -1; diff --git a/ace/OS_NS_unistd.h b/ace/OS_NS_unistd.h index af735a2e849..650ef3c4149 100644 --- a/ace/OS_NS_unistd.h +++ b/ace/OS_NS_unistd.h @@ -139,7 +139,7 @@ namespace ACE_OS ACE_NAMESPACE_INLINE_FUNCTION int ftruncate (ACE_HANDLE, - off_t); + ACE_LOFF_T); ACE_NAMESPACE_INLINE_FUNCTION char *getcwd (char *, size_t); @@ -313,7 +313,7 @@ namespace ACE_OS long count); ACE_NAMESPACE_INLINE_FUNCTION - int truncate (const ACE_TCHAR *filename, off_t length); + int truncate (const ACE_TCHAR *filename, ACE_LOFF_T length); ACE_NAMESPACE_INLINE_FUNCTION u_long ualarm (u_long usecs, diff --git a/ace/OS_NS_unistd.inl b/ace/OS_NS_unistd.inl index 0b6190b7079..695f575b306 100644 --- a/ace/OS_NS_unistd.inl +++ b/ace/OS_NS_unistd.inl @@ -351,15 +351,16 @@ ACE_OS::fsync (ACE_HANDLE handle) } ACE_INLINE int -ACE_OS::ftruncate (ACE_HANDLE handle, off_t offset) +ACE_OS::ftruncate (ACE_HANDLE handle, ACE_LOFF_T offset) { ACE_OS_TRACE ("ACE_OS::ftruncate"); #if defined (ACE_WIN32) - if (::SetFilePointer (handle, offset, 0, FILE_BEGIN) != (unsigned) -1) + LARGE_INTEGER loff; + loff.QuadPart = offset; + if (::SetFilePointerEx (handle, loff, 0, FILE_BEGIN) != (unsigned) -1) ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::SetEndOfFile (handle), ace_result_), int, -1); else ACE_FAIL_RETURN (-1); - /* NOTREACHED */ #else ACE_OSCALL_RETURN (::ftruncate (handle, offset), int, -1); #endif /* ACE_WIN32 */ @@ -974,19 +975,22 @@ ACE_OS::sysinfo (int cmd, char *buf, long count) ACE_INLINE int ACE_OS::truncate (const ACE_TCHAR *filename, - off_t offset) + ACE_LOFF_T offset) { ACE_OS_TRACE ("ACE_OS::truncate"); #if defined (ACE_WIN32) ACE_HANDLE handle = ACE_OS::open (filename, O_WRONLY, ACE_DEFAULT_FILE_PERMS); + + LARGE_INTEGER loffset; + loffset.QuadPart = offset; if (handle == ACE_INVALID_HANDLE) ACE_FAIL_RETURN (-1); - else if (::SetFilePointer (handle, - offset, - 0, - FILE_BEGIN) != (unsigned) -1) + else if (::SetFilePointerEx (handle, + loffset, + 0, + FILE_BEGIN) != (unsigned) -1) { BOOL result = ::SetEndOfFile (handle); ::CloseHandle (handle); |