/* * Some tests for posix syscalls. * * Copyright (C) 2007 Bahadir Balban */ #include #include #include #include #include #include #include #include #include void wait_pager(l4id_t partner) { // printf("%s: Syncing with pager.\n", __TASKNAME__); for (int i = 0; i < 6; i++) write_mr(i, i); l4_send(partner, L4_IPC_TAG_WAIT); // printf("Pager synced with us.\n"); } void main(void) { pid_t pid; printf("\n%s: Started with tid %d.\n", __TASKNAME__, self_tid()); /* Sync with pager */ wait_pager(0); dirtest(); printf("Forking...\n"); if ((pid = fork()) < 0) printf("Error forking...\n"); if (pid == 0) { printf("File IO test 1, done by child:\n"); if (fileio() == 0) printf("-- PASSED --\n"); else printf("-- FAILED --\n"); } else { printf("File IO test 2, done by parent, with child pid %d:\n", pid); if (fileio2() == 0) printf("-- PASSED --\n"); else printf("-- FAILED --\n"); } while (1) wait_pager(0); #if 0 /* Check mmap/munmap */ mmaptest(); /* Check shmget/shmat/shmdt */ shmtest(); #endif }