extern int write_all(int fd, const void *buf, size_t count);