View Issue Details

IDProjectCategoryView StatusLast Update
0038419FPCRTLpublic2021-02-07 18:17
ReporterHartmut Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntu 
Product Version3.2.0 
Fixed in Version3.3.1 
Summary0038419: baseunix. fpUtime() can't set 64-bit timestamps in 32-bit programs (y2038 problem)
DescriptionWhen you call baseunix.fpUtime() in a 32-bit program it uses a record, where the 2 timestamps are only in 32-bit variables. Currently it is not possible to set 64-bit timestamps in a 32-bit program, which causes the y2038 problem.
PascalDragon asked me to create this report in the forum in https://forum.lazarus.freepascal.org/index.php/board,32.0.html (reply 0000003) so that this issue won't be forgotten.
TagsNo tags attached.
Fixed in Revision48470
FPCOldBugId
FPCTarget-
Attached Files

Activities

Florian

2021-01-31 17:27

administrator   ~0128710

linux.fputimensat function added.

Hartmut

2021-02-07 16:04

reporter   ~0128806

Thank you very much for fixing so soon.
I tried new function linux.utimensat() with FPC 3.3.1 trunk rev 48497 on my Ubuntu 18.04 (kernel 4.15), but - as expected - it returned ESysENOSYS = "Function not implemented" because it needs a kernel >= 5.1 as I had heared before. So I can't use it in the next future (which of cause is not your fault ;-)

In the sources of this revision I saw 1 line which maybe has a small copy-paste bug:
In file fpcsrc/rtl/linux/linux.pp at the end of the interface part line 559 shows:
   Function utimensat(dfd: cint; path:pchar;const times:tkernel_timespecs;flags:cint):cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'statx'; {$ENDIF}
Should the 'statx' at the end be replaced by 'utimensat'?

Florian

2021-02-07 18:17

administrator   ~0128807

Thanks for noticing, this was already fixed in r48504.

Issue History

Date Modified Username Field Change
2021-01-29 09:30 Hartmut New Issue
2021-01-31 17:27 Florian Assigned To => Florian
2021-01-31 17:27 Florian Status new => resolved
2021-01-31 17:27 Florian Resolution open => fixed
2021-01-31 17:27 Florian Fixed in Version => 3.3.1
2021-01-31 17:27 Florian Fixed in Revision => 48470
2021-01-31 17:27 Florian FPCTarget => -
2021-01-31 17:27 Florian Note Added: 0128710
2021-02-07 16:04 Hartmut Note Added: 0128806
2021-02-07 18:17 Florian Note Added: 0128807