Solved

Using sigqueue() to pass information

Posted on 1997-06-13
1
246 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 62
Expand macro to ask for filename column 8 37
zeroFront challenge 7 80
EvenOdd challenge 10 90
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now