3 #include <lunaix/lunaix.h>
8 main(int argc, const char** argv)
12 if ((err = open("/dev/tty", 0)) < 0) {
13 syslog(2, "fail to open tty (%d)\n", errno);
17 if ((err = dup(err)) < 0) {
18 syslog(2, "fail to setup tty i/o (%d)\n", errno);
22 if ((err = symlink("/usr", "/mnt/lunaix-os/usr"))) {
23 syslog(2, "symlink /usr:/mnt/lunaix-os/usr (%d)\n", errno);
28 if (!(pid = fork())) {
29 err = execve("/usr/bin/sh", NULL, NULL);
30 printf("fail to execute (%d)\n", errno);
34 waitpid(pid, &err, 0);
36 if (WEXITSTATUS(err)) {
37 printf("shell exit abnormally (%d)", err);