?
Solved

Using sigqueue() to pass information

Posted on 1997-06-13
1
Medium Priority
?
258 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 300 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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. …
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

765 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