2012-09-13 09:10:10 +04:00
|
|
|
#include <stdlib.h>
|
2012-09-13 11:09:17 +04:00
|
|
|
#include <stdio.h>
|
2012-09-13 09:10:10 +04:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <syscall.h>
|
|
|
|
|
|
|
|
int main(int argc, char * argv[]) {
|
|
|
|
/* Starts a graphical session and then spins waiting for a kill (logout) signal */
|
|
|
|
|
2012-09-13 11:09:17 +04:00
|
|
|
int _wallpaper_pid = fork();
|
|
|
|
if (!_wallpaper_pid) {
|
2012-09-13 09:10:10 +04:00
|
|
|
char * args[] = {"/bin/wallpaper", NULL};
|
|
|
|
execve(args[0], args, NULL);
|
|
|
|
}
|
2012-09-13 11:09:17 +04:00
|
|
|
int _panel_pid = fork();
|
|
|
|
if (!_panel_pid) {
|
2012-09-13 09:10:10 +04:00
|
|
|
char * args[] = {"/bin/panel", NULL};
|
|
|
|
execve(args[0], args, NULL);
|
|
|
|
}
|
2012-09-13 11:09:17 +04:00
|
|
|
int _terminal_pid = fork();
|
|
|
|
if (!_terminal_pid) {
|
2012-09-13 11:29:29 +04:00
|
|
|
char * args[] = {"/bin/terminal", "--kerne", NULL};
|
2012-09-13 09:10:10 +04:00
|
|
|
execve(args[0], args, NULL);
|
|
|
|
}
|
|
|
|
|
2012-09-13 11:09:17 +04:00
|
|
|
syscall_wait(_terminal_pid);
|
2012-09-13 09:10:10 +04:00
|
|
|
|
2012-09-13 11:29:29 +04:00
|
|
|
printf("Terminal has exited. Sending INT signals to %d and %d.\n", _wallpaper_pid, _panel_pid);
|
2012-09-13 11:09:17 +04:00
|
|
|
|
|
|
|
syscall_send_signal(_wallpaper_pid, 2);
|
|
|
|
syscall_send_signal(_panel_pid, 2);
|
|
|
|
|
|
|
|
printf("Waiting on wallpaper.\n");
|
|
|
|
syscall_wait(_wallpaper_pid);
|
|
|
|
|
|
|
|
printf("Waiting on panel.\n");
|
|
|
|
syscall_wait(_panel_pid);
|
2012-09-13 09:10:10 +04:00
|
|
|
|
|
|
|
}
|