mirror of
https://github.com/drasko/codezero.git
synced 2026-02-27 17:23:13 +01:00
Added new routines that map and check the validity of user buffers.
mmap uses this mechanism to get arguments. It needs to be tested.
This commit is contained in:
@@ -22,9 +22,10 @@ void wait_pager(l4id_t partner)
|
||||
// printf("Pager synced with us.\n");
|
||||
}
|
||||
|
||||
pid_t pid;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
printf("\n%s: Started with tid %d.\n", __TASKNAME__, self_tid());
|
||||
/* Sync with pager */
|
||||
@@ -32,12 +33,16 @@ void main(void)
|
||||
|
||||
dirtest();
|
||||
|
||||
/* Check mmap/munmap */
|
||||
mmaptest();
|
||||
|
||||
printf("Forking...\n");
|
||||
|
||||
if ((pid = fork()) < 0)
|
||||
printf("Error forking...\n");
|
||||
|
||||
if (pid == 0) {
|
||||
pid = getpid();
|
||||
printf("Child: file IO test 1.\n");
|
||||
if (fileio() == 0)
|
||||
printf("-- PASSED --\n");
|
||||
@@ -56,12 +61,10 @@ void main(void)
|
||||
else
|
||||
printf("-- FAILED --\n");
|
||||
}
|
||||
|
||||
while (1)
|
||||
wait_pager(0);
|
||||
#if 0
|
||||
/* Check mmap/munmap */
|
||||
mmaptest();
|
||||
|
||||
/* Check shmget/shmat/shmdt */
|
||||
shmtest();
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <tests.h>
|
||||
|
||||
int global = 0;
|
||||
extern pid_t pid;
|
||||
|
||||
int forktest(void)
|
||||
{
|
||||
@@ -18,6 +19,7 @@ int forktest(void)
|
||||
fork();
|
||||
|
||||
myid = getpid();
|
||||
pid = myid;
|
||||
if (global != 0) {
|
||||
printf("-- FAILED --\n");
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user