return value of syswrite may be less than length of given string.