Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fstat larger than 4G while st_size is 64bit on Windows #1074

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ACE/ace/OS_NS_sys_stat.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_fcntl.h"
#include "ace/OS_NS_errno.h"
#include "ace/OS_NS_time.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving ACE_MAKE_QWORD so this include isn't needed.

#include "ace/OS_NS_macros.h"

#ifdef ACE_MQX
Expand Down Expand Up @@ -42,14 +43,16 @@ namespace ACE_OS
ACE_OS::set_errno_to_last_error ();
return -1;
}
# if !defined(ACE_WIN64) && (!defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64)
else if (fdata.nFileSizeHigh != 0)
{
errno = EINVAL;
return -1;
}
# endif /* !defined(ACE_WIN64) && (!defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64)*/
else
{
stp->st_size = fdata.nFileSizeLow;
stp->st_size = ACE_MAKE_QWORD(fdata.nFileSizeLow, fdata.nFileSizeHigh);
Copy link
Member

@jwillemsen jwillemsen Jun 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be ACE_COMBINE_PARTS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the ACE_OS::stat functions, do they have the same problem?

stp->st_atime = ACE_Time_Value (fdata.ftLastAccessTime).sec ();
stp->st_mtime = ACE_Time_Value (fdata.ftLastWriteTime).sec ();
stp->st_ctime = ACE_Time_Value (fdata.ftCreationTime).sec ();
Expand Down