In gnupg/agent/findkey.c we use ftruncate in non-portable way.
IIUC, for portability, es_fflush is required before calling ftruncate.
I encountered an error of gpg-agent (with EFBIG) creating private keys, when a peculiar situation (of using Wine to test gpg-agent.exe on GNU/Linux).
I wonder if Solaris works well.
https://www.man7.org/linux/man-pages/man3/ftruncate.3p.html
https://docs.oracle.com/cd/E19683-01/817-0692/6mgfnkuf8/index.html