feat: wrapper function for bootstraping user program
[lunaix-os.git] / lunaix-os / uprog / init.c
1 #include <fcntl.h>
2 #include <sys/lunaix.h>
3 #include <unistd.h>
4
5 int
6 main(int argc, const char** argv)
7 {
8     int errno = 0;
9
10     if ((errno = open("/dev/tty", 0))) {
11         syslog(2, "fail to open tty (%d)\n", errno);
12         return 0;
13     }
14
15     if ((errno = dup(errno))) {
16         syslog(2, "fail to setup tty i/o (%d)\n", errno);
17         return 0;
18     }
19
20     syslog(0, "user space!\n");
21
22     return 0;
23 }