some BUFSIZ and sizeof() replacements