Questions tagged [ipcs]

IPCS is a Linux/Unix command-line utility that provides the status of IPC (Inter-process Communication) facilities.

28 questions
24
votes
2 answers

Deleting shared memory with ipcrm in Linux

I am working with a shared memory application, and to delete the segments I use the following command: ipcrm -M 0x0000162e (this is the key) But I do not know if I'm doing the right things, because when I run ipcs I see the same segment but with…
Eduardo
  • 19,928
  • 23
  • 65
  • 73
9
votes
1 answer

sem_release(): failed to release key 0xc: Invalid argument

I'm using semaphore to synchronize some parts in my application. On releasing of the semaphore (sem_release) I'm getting this warning: sem_release(): failed to release key 0xc: Invalid argument First I don't know whether the semaphore released,…
dritan
  • 882
  • 2
  • 8
  • 22
5
votes
3 answers

ipcs doesn't show my shared memory and semaphores

I open shared memory and semaphores with the appropriate flags: sem = sem_open("/some_name", O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO, 1); shm = shm_open("/other_name", O_RDWR | O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); The calls don't…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
3
votes
1 answer

Semaphores unix c wait for zero

I am trying to understand how to do a wait for zero operation in unix. I have this code, but it stops waiting always with the same value as given. int main(void){ int sem; struct sembuf sops[2]; if((sem = semget(IPC_PRIVATE, 1, …
3
votes
3 answers

mq_open giving "too many open files"

I created a message queue with following code. First few times it works properly. int main() { mqd_t mqdes; char mq_name[10] = "/mq"; int oflag = O_CREAT | O_RDWR, ret; struct mq_attr attr; attr.mq_maxmsg = 1024; …
gangadhars
  • 2,584
  • 7
  • 41
  • 68
3
votes
1 answer

Alternatives to ipcs

I've got an application that makes use of System V shared memory segments. Normally it manages these internally and no one needs to touch them. But for emergencies we've got a utility that manually clears the shared memory segments. The problem is…
asc99c
  • 3,815
  • 3
  • 31
  • 54
2
votes
2 answers

why are some posix shared memory segments and posix semaphores not visible to ipcs

I built a client server application using posix shared memory and posix unnamed semaphores with pshared=1. The semaphores are placed inside the shared memory. The program runs fine, but when I type ipcs -m or ipcs -s, I do not see any shared memory…
Anonymous
  • 4,133
  • 10
  • 31
  • 38
2
votes
0 answers

why does ipcs command shows many undetached shared memory with key 0x0000000?

I discover many undetached shared memory with key 0x0000000 with ipcs like these: 0x00000000 585728074 nobody 777 48 0 0x00000000 585760843 nobody 777 48 0 …
Eric Zheng
  • 1,084
  • 1
  • 11
  • 23
2
votes
1 answer

Need to initiate seperate background processes using .NET Remoting for Interprocess Communication

I have an abstract factory which will initiate separate processes (.NET EXE's) on demand. The abstract factory needs to initiate processes at any time and let the newly created processes be able to communicate with processes in which the abstract…
Usman
  • 2,742
  • 4
  • 44
  • 82
1
vote
4 answers

Delete unix shared memory segments using a C++ program

I am trying to write a C++ program to delete the shared memory segments. I know it can be done from cmd prompt using ipcs -m | awk '{ print $2 }' | xargs ipcrm -m But I am trying to do it using C++ so that I create a shared memory garbage…
venuktan
  • 1,649
  • 2
  • 14
  • 29
1
vote
1 answer

Shared Memory Segv

I have tried to use Boost and had a segv after 3000 allocations of objects of size 24, now i started to use sys/ipc.h and sys/shm.h , i allocate 25 mio bytes (if i understand this properly) it seems also to work properly on my linux box ipcs -m…
Oliver
  • 928
  • 9
  • 25
1
vote
0 answers

Adding a field to msgbuf

I got an assignment to create a message queue in Linux. I need to use msgnd() and msgrcv() functions. Everything works if my message structure has two fields mtype and mtext[] but I need to add one more field an int mpid. But when I read the value…
1
vote
0 answers

process related to semaphore not found

Recently we are facing some issue in which we are running out of semaphores every now and then so for debugging i have used following commands to identify acquired semaphore is related to which process ipcs -s|grep Above command will…
PapaDiHatti
  • 1,841
  • 19
  • 26
1
vote
1 answer

C - Get IPC shared memory information

I've created a program that shows shared memory segment info by shmid (shared memory id) passed as an argument. Comparing the data with those returned by the command ipcs, it is clear that my program shows some wrong information about shared memory…
0
votes
1 answer

Trying to delete all shared memory and semaphore arrays in ipcs but get permission denied?

Can't find this anywhere online but when trying to delete semaphore arrays and shared memory using ipcrm -m id. I get this error permission denied for id (). Any reason why?
1
2