Solved

Using sigqueue() to pass information

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 149
either24  challenge 19 107
haveThree challenge 22 126
how to split multiple lines delimiter : 8 129
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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

740 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