/*  Using Linux system call directly */

#include <syscall.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
int main(){
long id1,id2;
int fp=0;
char a='e';
//Get process id using direct and normal syscall.
id1=syscall(SYS_getpid);
printf("syscall(SYS_getpid)=%ld\n",id1);

id2=getpid();
printf("getpid()=%ld",id2);

//open a file and write into it and close it
fp=syscall(SYS_open,"giis.txt",1);
syscall(SYS_write,fp,&a,1);
syscall(SYS_close);

return 0;

}
