Advertisement

XShm questions

Started by May 16, 2008 06:07 AM
1 comment, last by bradbobak 16 years, 6 months ago
Hi, I have a couple XShm* questions. #1 : what is the event mask I should be watching for when XShmPutImage() posts a completion message? #2 : is there any way to detach all left-over shared memory segments from the x-server? Like say my app exits unexpectedly, I'd like to clear out X's attached shared memory segments. (I will be trapping signals to do this, but during the debug stage I keep running out of shared memory, so i'd like to be able to release every segment the X server is holding) Thanks in advance, Bradd.
ok, for #2 I found a workaround.. After the server attaches to the segment, I can use shmctl() to remove the segment in the client (after an XSync()).. since the server is still attached to it, it will remain until the program exits and the server releases it.
I also specified #2 wrong.. it was my client not removing the shm segment. I guess the XServer takes care of its end..
Advertisement
For #1, I have found a work-around.. It involves using XIfEvent() and friends to check for the event.

This topic is closed to new replies.

Advertisement