backport truncate until we've upgraded.

truncate was added in upstream in
9a4e183fe9f81365f7815c391512b3d46622d8c8