[bug #58656] Cannot handle over 2GB file on Windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #58656] Cannot handle over 2GB file on Windows

David Boyce-5
URL:
  <https://savannah.gnu.org/bugs/?58656>

                 Summary: Cannot handle over 2GB file on Windows
                 Project: make
            Submitted by: mkato
            Submitted on: Fri 26 Jun 2020 06:05:07 PM JST
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: SCM
        Operating System: MS Windows
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

Actually, windows version uses stat when checking mtime. But stat
returns -1 when file size is over 2GB. So we should use _stati64 instead.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 26 Jun 2020 06:05:07 PM JST  Name:
0001-make-cannot-handle-over-2GB-file-on-Windows.patch  Size: 1KiB   By: mkato
fix
<http://savannah.gnu.org/bugs/download.php?file_id=49375>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58656>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply | Threaded
Open this post in threaded view
|

[bug #58656] Cannot handle over 2GB file on Windows

David Boyce-5
Update of bug #58656 (project make):

              Item Group:                     Bug => Enhancement            
             Assigned to:                    None => eliz                  
           Triage Status:                    None => Small Effort          

    _______________________________________________________

Follow-up Comment #1:

Thanks.

However, this change cannot be unconditional even on MS-Windows, because
_stati64 and 'struct _stat64' are not available on all versions of Windows.

Also, AFAIK _stati64 accepts an argument of type 'struct stati64', not 'struct
_stat64', see

 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=vs-2019

Would you like to modify the patch to fix the above 2 issues?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58656>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply | Threaded
Open this post in threaded view
|

[bug #58656] Cannot handle over 2GB file on Windows

David Boyce-5
Additional Item Attachment, bug #58656 (project make):

File name: 0001-make-cannot-handle-over-2GB-file-on-Windows.patch Size:1 KB
   
<https://savannah.gnu.org/file/0001-make-cannot-handle-over-2GB-file-on-Windows.patch?file_id=49438>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58656>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply | Threaded
Open this post in threaded view
|

[bug #58656] Cannot handle over 2GB file on Windows

David Boyce-5
Follow-up Comment #2, bug #58656 (project make):

[comment #1 comment #1:]
> Thanks.
>
> However, this change cannot be unconditional even on MS-Windows, because
_stati64 and 'struct _stat64' are not available on all versions of Windows.
>
> Also, AFAIK _stati64 accepts an argument of type 'struct stati64', not
'struct _stat64', see
>
>  
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=vs-2019
>
> Would you like to modify the patch to fix the above 2 issues?

Updated fix with VC version check and using _stat64. Do you have any comment?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58656>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/