예제 #1
0
pid_t fork(void)
{
  pid_t return_code;
	return_code = (pid_t) syscall_0(SYS_fork);

	return return_code;	
}
예제 #2
0
pid_t
getppid(
	void)
{
	pid_t ppid;
	
	ppid = (pid_t) syscall_0(SYS_getppid);

	return ppid;
}
예제 #3
0
pid_t
getpid(
	void)
{
	pid_t pid;
	pid = (pid_t) syscall_0(SYS_getpid);
       // uint64_t no =39;

	return pid;
}
예제 #4
0
void yield(){

        int ret;
        ret = (int)syscall_0(SYS_yield);
        if (ret < 0)
                errno = ESRCH;



}
예제 #5
0
void shutdown(){

        int ret;
        ret = (int)syscall_0(SYS_shutdown);
        if (ret < 0)
                errno = ESRCH;



}
예제 #6
0
파일: processes.c 프로젝트: karthikbox/os
pid_t fork(void) {
	int ret= (pid_t) syscall_0(SYS_fork);
	if(ret < 0){
		errno=-ret;
		return -1;
	}
	else{
		return ret;
	}
}
예제 #7
0
pid_t fork(void)
{
	pid_t ret;
	ret = (pid_t)syscall_0(SYS_fork);
	if(ret<0)
	{
		errno = (-1) * ret;
                return -1;
	}
	return ret;
}
예제 #8
0
int ps()
{
        int result = 0;

        result = (int) syscall_0(SYS_ps);
        if(result < 0)
        {
                errno = (-1) * result;
                return -1;
        }
        return result;
}
예제 #9
0
파일: fork.c 프로젝트: sghosh1991/OS_X86_64
pid_t fork()
{
	int retvalue;

	retvalue = syscall_0(SYS_fork);

	if(retvalue >=0){
		return retvalue;
	}
	return -1;

}
예제 #10
0
/**
 * 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 */
예제 #11
0
파일: processes.c 프로젝트: karthikbox/os
void ps(){
	syscall_0(SYS_ps);
}
예제 #12
0
파일: processes.c 프로젝트: karthikbox/os
void yield(){
	syscall_0(SYS_yield);
}
예제 #13
0
파일: exit.c 프로젝트: GehlotGarima/SBUnix
void exit(int arg1)
{
	syscall_0(SYS_exit);
}
예제 #14
0
파일: processes.c 프로젝트: karthikbox/os
pid_t getppid(void) {
	return  (pid_t) syscall_0(SYS_getppid);
}
예제 #15
0
파일: getppid.c 프로젝트: amnaut/SBUNiX_X86
pid_t getppid(void)
{
        pid_t ret;
        ret =syscall_0(SYS_getppid);
        return ret;
}
예제 #16
0
int main(int argc, char* argv[], char* envp[]) {
	syscall_0(SYS_ps);
}
예제 #17
0
/**
 * 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 */
예제 #18
0
#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") {