Solved

Using sigqueue() to pass information

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
not able to insert into temp table 68 150
Prevent this page from creating additional dialogs. 3 259
if loop in java 3 114
Hibernate methods 2 58
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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

19 Experts available now in Live!

Get 1:1 Help Now