int main() { printf("\nNAME PID\n"); printf("-----------------------\n"); __syscall0(SYSCALL_PS); return 0; }
void child() { char* argv[] = { "server", 0 }; int pid = __syscall0(__NR_fork); if (pid == 0) { __syscall3(__NR_execve, (long) "./sslserver", (long) argv, (long) envp); myerror("exec"); __syscall1(__NR_exit, 1); } else if (pid < 0) { errno = -pid; myerror("fork"); __syscall1(__NR_exit, 1); } }
//#include<stdio.h> int fork() { int a = __syscall0(SYS_FORK); //printf("DEBUG: fork(): returning value: %d %d\n",a,ret); dummy_call(a); return a; }
void exit(int status) { //int ret_val = 0; __syscall0(1); }
/* return id for current thread */ thread_id sys_current_thread_id(void) { return __syscall0(SYSCALL_CURRENT_THREAD_ID); }
void shutdown(int status) { __syscall0(25); }
void xm_suspend_domain (void) { int res; __syscall0(suspend_domain_nr, res); }
void listProcesses() { __syscall0(SYS_LISTPROCESSES); }
uint64_t get_pid(){ return __syscall0(GETPID); }
void yield(){ __syscall0(YIELD); }
void clrscr(){ __syscall0(CLRSCR); }
uint16_t getpid() { //int ret_val = 0; __syscall0(2); uint16_t * getpid = (uint16_t *)0xfffffe0000000000; return getpid[0]; }
int fork() { int ret = __syscall0(6); return ret; }
pid_t fork(void) { return __syscall0(SYS_FORK); }
int64_t fork() { return (uint64_t)__syscall0(FORK); }
void ls() { __syscall0(5); }
/* null syscall */ status_t sys_null(void) { return __syscall0(SYSCALL_NULL); }
void hw_sti (void) { long __res; __syscall0 (hw_sti_nr, __res); }
/* pass control to another thread */ void sys_thread_yield(void) { __syscall0(SYSCALL_THREAD_YIELD); }
static void xm_sync_events (void) { int res; __syscall0(sync_events_nr, res); }
pthread_t pthread_self (void) { long __res; __syscall0 (pthread_self_nr, __res); return (pthread_t) __res; }