20int main(
int argc,
char** argv)
23 printf(
"remove : shmname \n");
26 string pathname = string(
"/tmp/") + string(getenv(
"USER"))
27 + string(
"_SHM_") + string(argv[1]);
28 FILE* fd = fopen(pathname.c_str(),
"r");
30 printf(
"[removeshm] No such RingBuffer : %s\n", argv[1]);
34 fscanf(fd,
"%d", &shmid);
37 printf(
"Removing shmid = %d\n", shmid);
38 shmctl(shmid, IPC_RMID, (
struct shmid_ds*) 0);
39 printf(
"Removing pathfile = %s\n", pathname.c_str());
40 unlink(pathname.c_str());
44 sprintf(fname,
"/tmp/SHM%d-SEM0-SHM_%s", shmid, argv[1]);