can truncate, and then return the number of characters that would have been written without truncation. Signed-off-by: Daira Hopwood <daira@jacaranda.org>