#include #include #include #include #include #include void bye() { printf("byeee!\n"); } int main() { atexit(bye); printf("Welcome to %s from userspace (pid %d)!\n", "Luna", getpid()); FILE* f = fopen("/etc/motd", "r"); if (!f) { perror("fopen"); return 1; } char buffer[512]; size_t nread = fread(buffer, 1, sizeof(buffer), f); buffer[nread] = 0; printf("/etc/motd says: %s", buffer); fclose(f); time_t now = time(NULL); printf("date: %s", ctime(&now)); }