Luna/apps/app.c

29 lines
413 B
C
Raw Normal View History

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
2023-01-06 23:21:08 +00:00
#include <time.h>
#include <unistd.h>
void bye()
{
2023-01-07 00:49:26 +00:00
printf("byeee!\n");
}
int main()
{
atexit(bye);
printf("Welcome to %s from userspace!\n", "Luna");
int fd = open("/etc/motd", 0);
if (fd < 0)
{
perror("open");
return 1;
}
close(fd);
time_t now = time(NULL);
printf("date: %s", ctime(&now));
}