Files
Nim/lib/pure
c-blake da2ba43dca Fix non-exported memfiles.setFileSize to be able to shrink files on posix via memfiles.resize (#23717)
Fix non-exported `setFileSize` to take optional `oldSize` to (on posix)
shrink differently than it grows (`ftruncate` not `posix_fallocate`)
since it makes sense to assume the higher address space has already been
allocated there and include the old file size in the `proc resize` call.
Also, do not even try `setFileSize` in the first place unless the `open`
itself works by moving the call into the `if newFileSize != -1` branch.

Just cosmetics, also improve some old 2011 comments, note a logic diff
for callers using both `mappedSize` & `newFileSize` from windows branch
in case someone wants to fix that & simplify code formatting a little.

(cherry picked from commit 8037bbe327)
2024-09-13 10:55:55 +02:00
..
2023-05-29 21:31:53 +02:00
2023-06-06 21:22:07 +02:00
2015-10-01 12:05:45 -07:00
2024-05-23 13:55:23 +02:00
2021-01-09 00:24:41 +01:00
2023-10-24 08:57:38 +02:00
2023-06-08 08:02:11 +02:00
2022-12-26 13:20:05 +01:00
2022-12-16 08:01:15 +01:00
2022-02-02 17:10:11 +01:00
2022-02-02 17:10:11 +01:00
2022-12-03 21:25:49 +08:00
2023-05-29 21:31:53 +02:00
2024-08-31 12:47:25 +02:00
2023-06-26 15:07:42 +02:00
2023-03-20 18:51:58 +01:00
2021-02-08 09:46:07 +01:00
2022-02-02 17:10:11 +01:00