Add errno.h, remove setbuf which is deprecated