Solved

Using sigqueue() to pass information

Posted on 1997-06-13
1
255 Views
Last Modified: 2013-12-26
I currently have a number of processes communicating via sigqueue(), passing a single integer in the sival_int field of the sigval union.

Now I'd like to expand on this, so I've tried the sigqueue() pointer-passing functionality by instead using the sival_ptr field in the sigval union.

The pointer gets passed okay, but it turns out to be an address relative to the signaler, not an absolute address.

Thus, when the signaled process gets it, and tries to access the structure that it points to, he just accesses that address in his _own_ address space, not actually where the structure exists in the signaler.

How do I get this to work in the manner in which the available documentation (Sun man pages, "Posix.4: Programming For The Real World", etc) seems to indicate it should?
0
Comment
Question by:rewd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
dhm earned 100 total points
ID: 1293437
I think the man page is wrong, or maybe you're misreading it.  The only way to get a pointer that's valid in two processes is to have it point to a shared memory segment that's mapped by both of the processes.  You can do what you want by creating/attaching to a shared segment (shmget, shmctl, etc) and then passing pointers to memory in the segment.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question