#include<sys/ipc.h>
#include<sys/shm.h>
#include<sys/types.h>
int *shared(int x,int *shmid)
{
*shmid=shmget(IPC_PRIVATE,x,0666|IPC_CREAT);
return(shmat(*shmid,0,0));
}
/*void free_shm(int id)
{
struct shmid_ds *buf;
if(shmctl(id,IPC_RMID,buf)!=0)
error_exit("free_shm","shmctl");
}*/