/* * Create a shared memory segment of 512 bytes * New File Mar 22,1989 * Author Jerry LeVan * */ #include #include #include #include #define SIZE 512 /* shared memory buffer size */ #define PERM 0666 /* all can read write */ #define KEY 'JHL ' /* our key */ main() { int id; id = shmget(KEY,SIZE,IPC_CREAT|IPC_EXCL|PERM); printf("status of create = %d\n",id); if(id == -1) perror("Bad Create"); }