pid_t fork(void) { pid_t return_code; return_code = (pid_t) syscall_0(SYS_fork); return return_code; }
pid_t getppid( void) { pid_t ppid; ppid = (pid_t) syscall_0(SYS_getppid); return ppid; }
pid_t getpid( void) { pid_t pid; pid = (pid_t) syscall_0(SYS_getpid); // uint64_t no =39; return pid; }
void yield(){ int ret; ret = (int)syscall_0(SYS_yield); if (ret < 0) errno = ESRCH; }
void shutdown(){ int ret; ret = (int)syscall_0(SYS_shutdown); if (ret < 0) errno = ESRCH; }
pid_t fork(void) { int ret= (pid_t) syscall_0(SYS_fork); if(ret < 0){ errno=-ret; return -1; } else{ return ret; } }
pid_t fork(void) { pid_t ret; ret = (pid_t)syscall_0(SYS_fork); if(ret<0) { errno = (-1) * ret; return -1; } return ret; }
int ps() { int result = 0; result = (int) syscall_0(SYS_ps); if(result < 0) { errno = (-1) * result; return -1; } return result; }
pid_t fork() { int retvalue; retvalue = syscall_0(SYS_fork); if(retvalue >=0){ return retvalue; } return -1; }
/** * Abort current process, producing an abnormal program termination. * The function raises the SIGABRT signal. */ void __attr_noreturn___ __attr_used___ abort (void) { syscall_1 (__NR_close, (long int) stdin); syscall_1 (__NR_close, (long int) stdout); syscall_1 (__NR_close, (long int) stderr); syscall_2 (__NR_kill, syscall_0 (__NR_getpid), SIGABRT); while (true) { /* unreachable */ } } /* abort */
void ps(){ syscall_0(SYS_ps); }
void yield(){ syscall_0(SYS_yield); }
void exit(int arg1) { syscall_0(SYS_exit); }
pid_t getppid(void) { return (pid_t) syscall_0(SYS_getppid); }
pid_t getppid(void) { pid_t ret; ret =syscall_0(SYS_getppid); return ret; }
int main(int argc, char* argv[], char* envp[]) { syscall_0(SYS_ps); }
/** * Send a signal to the current process. */ int __attr_used___ raise (int sig) { return (int) syscall_2 (SYSCALL_NO (kill), syscall_0 (SYSCALL_NO (getpid)), sig); } /* raise */
#include <embox/test.h> #include <kernel/syscall_caller.h> EMBOX_TEST_SUITE("syscall test"); SYSCALL0(0,int,syscall_0); SYSCALL1(1,int,syscall_1,int,arg1); SYSCALL2(2,int,syscall_2,int,arg1,int,arg2); SYSCALL3(3,int,syscall_3,int,arg1,int,arg2,int,arg3); SYSCALL4(4,int,syscall_4,int,arg1,int,arg2,int,arg3,int,arg4); SYSCALL5(5,int,syscall_5,int,arg1,int,arg2,int,arg3,int,arg4,int,arg5); TEST_CASE("calling syscall without arguments") { test_assert_equal(syscall_0(), 0); } TEST_CASE("calling syscall with one argument") { test_assert_equal(syscall_1(1), 1); } TEST_CASE("calling syscall with two arguments") { test_assert_equal(syscall_2(1,2), 2); } TEST_CASE("calling syscall with three arguments") { test_assert_equal(syscall_3(1,2,3), 3); } TEST_CASE("calling syscall with four arguments") {