Use truncate(2) where appropriate.

Thomas Munro <tmunro@postgresql.org>

Commit: 57faaf376e1961fa48866c6e5d6926463c6671b1
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2020-12-01T02:42:22Z
Releases: 14.0
Use truncate(2) where appropriate.

When truncating files by name, use truncate(2).  Windows hasn't got it,
so keep our previous coding based on ftruncate(2) as a fallback.

Discussion: https://postgr.es/m/16663-fe97ccf9932fc800%40postgresql.org

Files

PathChange+/−
src/backend/storage/file/fd.c modified +27 −0
src/backend/storage/smgr/md.c modified +1 −12
src/include/storage/fd.h modified +1 −0

Discussion