Category Archives: Operating System Lab Practicals Using C C++

Create Linux ls command C Program

Create Linux ls command C Program – Write a C program under Windows Operating System to create or simulate linux ls command.   Program code #include<stdio.h> #include<dirent.h> int main(int argc, char **argv) { DIR *dp; struct dirent *link; dp=opendir(argv[1]); printf(“\n contents of the directory %s are \n”, argv[1]); while((link=readdir(dp))!=0) printf(“%s\n”,link->d_name); closedir(dp); } Output contents of… Read More »

Loading

Using Linux System Calls Program Operating Systems Lab

Using Linux System Calls Program Operating Systems Lab – Write a C program Using Linux System Calls Program to create a child process using fork() system call. Display suitable message about parent process ID, child process or Error message if child process could not be created. Program Code using fork() getpid() and exit() #include<stdio.h> #include<unistd.h>… Read More »

Loading