This implements the new method added in D26148 in the sftp/smb slaves.
Tested sftp locally with truncate. Seems to work.
Haven't tested locally with smb though.
I do wonder if maybe more granular return value handling of the smb truncate would be in order, but then I suppose the most relevant error is EACCES and that'd be handled at opening ¯\_(ツ)_/¯
I'd just get rid of the assignment TBH. The line below is the last place errorCode is used anyway, so the ternary could just move there.