mirror of
https://github.com/drasko/codezero.git
synced 2026-02-17 20:33:14 +01:00
Added posix code
This commit is contained in:
36
conts/posix/test0/src/test_exec/test_exec.c
Normal file
36
conts/posix/test0/src/test_exec/test_exec.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Some tests for posix syscalls.
|
||||
*
|
||||
* Copyright (C) 2007 Bahadir Balban
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/kip.h>
|
||||
#include <l4lib/utcb.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
#include <tests.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
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_SYNC);
|
||||
// printf("Pager synced with us.\n");
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
wait_pager(0);
|
||||
if (getpid() == 2) {
|
||||
printf("EXECVE TEST -- PASSED --\n");
|
||||
printf("\nThread (%d): Continues to sync with the pager...\n\n", getpid());
|
||||
while (1)
|
||||
wait_pager(0);
|
||||
}
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user