003 Linux System ProgrammingIssues, queries and suggestions related to Linux, Linux Programming, IPC, Interprocess Communication, Synchronization, Semaphore, System Programming, Linux Software Development.
The issues are resolved by using semaphores,signal handlers. Semaphores are used at the shared region so that one process at a time can used the shared region and no over written of data occurs.
Rahul check your Structure ! You have used used typedef and then giving the name 'd ' to structure ... Now this. 'd' will behave as a data type of your Structure.... Further you have assigned values just pointed by 'd' , this 'd' is a data type ....
You should give a variable name of your Structure .. For Example...
d result Now put values in this variable---
result.pid = getpid(); result.res = 100;
Then you should use this variable in your messagequeue like below :