void check_mm_shm_swap(void) { int pid = syscall0(__NR_fork); if (pid < 0) { /* error */ panic("fork error.\n"); } else if (pid == 0) { /* child */ check_mm_shm_swap_child(); } int status; syscall3(__NR_waitpid, -1, (long)&status, 0); }
void check_mm_swap(void) { /* fork a new process to make the other tests. */ int pid = syscall0(__NR_fork); if (pid < 0) { /* error */ panic("fork error.\n"); } else if (pid == 0) { /* child */ check_mm_swap_child(); } int status; syscall3(__NR_waitpid, -1, (long)&status, 0); }
int main(void) { become_deterministic(); if (0 == dput(0, 1, 0, 0, 0)) { int a, b, c; a = syscall3(__NR_write, 1, (long)"hello\n", 6); //b = syscall0(57 /* fork */); b = syscall0(12 /* brk */); iprintf("In child %d %d\n", a, b); c = dret(); iprintf("SDF %d\n\n\n",c); } else { iprintf("In parent.\n"); } dput(0, 0, 0, 0, 0); iprintf("Done\n"); exit(0); return 0; }
uid_t getuid( void ) { return syscall0( SYS_getuid ); }
int uthread_joinall() { return syscall0(SYS_UTHREAD_JOINALL); }
int getpid() { syscall0(SYS_GETPID); }
pid_t fork(void) { return syscall0(LINUX_SYS_fork); }
long get_ticks() { syscall0(SYS_TICKS); }
int fork() { syscall0(SYS_FORK); }
uid_t getuid(void) { return syscall0(LINUX_SYS_getuid); }
int apiGetCurX() { return syscall0(API_GET_CUR_X); }
ipc_port_id create_ipc_port( void ) { return syscall0( SYS_create_ipc_port ); }
int apiHasKey(void) { return syscall0(API_HAS_KEY); }
long dret(void) { return syscall0(__NR_dret); }
int fork () { return (pid_t) syscall0 (SYS_FORK); }
int apiGetCurY() { return syscall0(API_GET_CUR_Y); }
int uthread_gettid() { return syscall0 (SYS_UTHREAD_GETTID); }
int apiReleaseKeyboard(void) { return syscall0(API_RELEASE_KEYBOARD); }
void plist (void) { syscall0(SYS_PLIST); }
int apiGetKey(void) { return syscall0(API_GET_KEY); }
void halt (void) { syscall0 (SYS_HALT); NOT_REACHED (); }
int apiInitKeyboard(void) { return syscall0(API_INIT_KEYBOARD); }