shmget() and shmat() problem
shmget() and shmat() problem
- Subject: shmget() and shmat() problem
- From: "Ritesh Nadhani" <email@hidden>
- Date: Tue, 29 May 2007 11:09:04 -0500
Hello
I hope this is the correct list for my question. If not please let me
know which one would be more appropriate for me.
I am trying to compile http://www.dbmail.org/ on my MacBook. I have
successfuly compiled it on FreeBSD and Ubuntu so it should work on Mac
OS X too.
One of the file has the following code:
void scoreboard_new(serverConfig_t * conf)
{
int serr;
if ((shmid = shmget(IPC_PRIVATE,
(sizeof(child_state_t) * HARD_MAX_CHILDREN),
0644 | IPC_CREAT)) == -1) {
serr = errno;
TRACE(TRACE_FATAL, "shmget failed [%s]",
strerror(serr));
}
scoreboard = shmat(shmid, (void *) 0, 0);
serr=errno;
if (scoreboard == (Scoreboard_t *) (-1)) {
TRACE(TRACE_FATAL, "scoreboard init failed [%s]",
strerror(serr));
scoreboard_delete();
}
scoreboard_lock_new();
scoreboard->conf = conf;
scoreboard_setup();
scoreboard_conf_check();
/* Make sure that we clean up our shared memory segments when we exit
* normally (i.e. not by kill -9, if you do that, you get to clean this
* up yourself!)
* */
atexit(scoreboard_delete); }
The code compiles correctly but shmget() and shmat() fails with error:
shmget failed [No space left on device]
scoreboard init failed [Permission denied]
I tried to follow the steps given at
http://www.spy-hill.net/help/apple/SharedMemory.html to solve the
shmget() issue but without success. For the second issue, I found:
http://developer.apple.com/technotes/tn2002/tn2053.html
A problem where shmat would fail with a permission denied error when
it was attempted by root has been corrected. (r. 2910913).
but apparently it still fails on my Mac OS X Tiger even though I am
running the app as *sudo*.
Any ideas?
--
Ritesh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden