Design and Develop a program to demonstrate to indicate that the shared memory created will be available even after the process which created is exited.
AIM:
Design and Develop a program to demonstrate to indicate that the shared memory created will be available even after the process which created is exited.
Program:
#include<sys/shm.h> #include<sys/ipc.h> #include<sys/stdio.h> #include<fcntl.h> int main( ) { char *P; int i; int smid=shmget (10,getpagesize(),IPC_CREAT,0644); p=shmat(Smid,0,SHM-RND); i=0; while(P[i]!=’\0’); { write(1,P i,1); i ; } }
Output:
Student@ubuntu:~$ gcc –o shm.out shm.c
hello
-
UpdatedOct 23, 2014
-
Views2,073
Write a Shell script to find factorial of a given integer.
Write in C the following Unix commands using system calls A). cat B). ls C). mv
Write a Shell script that displays list of all the files in the current directory to which the user has read, Write and execute permissions.
Write a Shell script that accepts a filename, starting and ending line numbers as arguments and displays all the lines between the given line numbers.
Write a C program to emulate the Unix ls-l command.
Write a Shell script to list all of the directory files in a directory.