+static void launch_me(char *p)
+{
+ enum { W = 640, H = 480, B = 32 };
+ const char *filename = "/tmp/ux_con_test";
+ unsigned long offset = 0x1000;
+
+ int r;
+
+ int fd = open(filename, O_RDWR | O_CREAT);
+ assert(fd != -1);
+
+ r = unlink(filename);
+ assert(r != -1);
+
+ size_t s = (((W * H * ((B + 7) / 8)) & ~(SUPERPAGESIZE - 1))) + SUPERPAGESIZE;
+ s += offset;
+ s += INPUTMEM_SIZE;
+
+ r = lseek(fd, s, SEEK_SET);
+ assert(r != -1);
+
+ r = write(fd, ".", 1);
+ assert(r == 1);
+
+ pid_t pid = fork();
+ switch (pid)
+ {
+ case 0:
+ {
+ char s_fd[3];
+ char s_width[5];
+ char s_height[5];
+ char s_depth[3];
+ char s_fbaddr[15];
+
+ snprintf(s_fd, sizeof(s_fd), "%u", fd);
+ snprintf(s_fbaddr, sizeof(s_fbaddr), "%lu", offset);
+ snprintf(s_width, sizeof(s_width), "%u", W);
+ snprintf(s_height, sizeof(s_height), "%u", H);
+ snprintf(s_depth, sizeof(s_depth), "%u", B);
+
+ execl(p, p, "-f", s_fd, "-s", s_fbaddr,
+ "-x", s_width, "-y", s_height, "-d", s_depth, NULL);
+ perror("execl");
+ exit(1);
+ }
+ case -1:
+ perror("fork");
+ exit(1);
+ default:
+ break;
+ };
+
+ int status;
+ waitpid(pid, &status, 0);
+ fprintf(stderr, "returned %d\n", status);
+ exit(0);
+}
+