Quantcast
Viewing all articles
Browse latest Browse all 3587

Re: ipcs -ma on Solaris not showing Sybase shared-memory segment

Kevin,

 

Since the requirement is to just ensure that the shared memory segment id for the dataserver is not zero(0), I tweaked the 'C' program to just create the shared memory segment, drop it, and exit immediately. This will ensuring that the dataserver will not get the shared memory segment id zero(0).

 

It now executes from the RUN file just prior to the dataserver start command.

 

I tested this in our sandbox and it works like a charm!

 

The modified code is as follows:

 

/*

* aseshm2.c

*/

 

 

#include <sys/types.h>

#include <sys/ipc.h>

#include <sys/shm.h>

#include <stdio.h>

 

 

#define SHMSZ     4

 

 

#ifndef exit

void exit(int);

#endif

 

 

int main()

{

    char c;

    int shmid;

    key_t key;

    char *shm, *s;

 

 

    /*

     * We'll name our shared memory segment

     */

    key = 10101010;

 

 

    /*

     * Create the segment.

     */

    if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0600)) < 0) {

        perror("shmget");

        exit(1);

    }

 

 

    if (shmctl(shmid, IPC_RMID, NULL) == -1) {

        perror("shmctl");

        exit(1);

    }

 

 

    exit(0);

}

 

Anil


Viewing all articles
Browse latest Browse all 3587

Trending Articles