#include #include #include #include #include #include #include extern "C" { int puts(const char* s) { long nwritten = fwrite(s, strlen(s), 1, stdout); if (nwritten < 0) return -1; nwritten += fwrite("\n", 1, 1, stdout); return (int)nwritten; } void perror(const char* s) // FIXME: Print to stderr, whenever we have an stderr. { int savederr = errno; // This was necessary before, but even more now since we clear errno on successful syscalls now. if (s && *s) { printf("%s: ", s); } printf("%s\n", strerror(savederr)); } }