System Call Program in C Programming YASH PAL, 18 May 202618 May 2026 In this post, we are going to write a system call program in C programming. We are going to use the SYS_getpid function to write a program. This function is used to get the process identification.#include <syscall.h> #include <unistd.h> #include <stdio.h> #include <sys/types.h> int main(void){ long ID1, ID2; ID1 = syscall(SYS_getpid); printf("syscall (SYS_getpid) = %ld\n",ID1); ID2 = getpid(); printf("getpid() = %ld\n",ID2); return(0); }#include <syscall.h> #include <unistd.h> #include <stdio.h> #include <sys/types.h> int main(void){ long ID1, ID2; ID1 = syscall(SYS_getpid); printf("syscall (SYS_getpid) = %ld\n",ID1); ID2 = getpid(); printf("getpid() = %ld\n",ID2); return(0); }Outputsyscall (SYS_getpid) = 3 getpid() = 3 c Programming Tutorials C Program