Use truncate(2) where appropriate.
authorThomas Munro <tmunro@postgresql.org>
Tue, 1 Dec 2020 02:34:57 +0000 (15:34 +1300)
committerThomas Munro <tmunro@postgresql.org>
Tue, 1 Dec 2020 02:42:22 +0000 (15:42 +1300)
commit57faaf376e1961fa48866c6e5d6926463c6671b1
treeb7df65cb3a351507d0c4ea1ba2099c214f4fa37a
parent9f35f943732eaf9121a107f54ea043925e9a5d7b
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
src/backend/storage/file/fd.c
src/backend/storage/smgr/md.c
src/include/storage/fd.h