Interesting, I want to test this on 64bit system,
After I compile this source code , where do I put binary file or do I provide a path to it in .cfg? Once I get it done, I am going to try to install t4 & w5 on this box and see how it does.. Tabi --- kjlee <[EMAIL PROTECTED]> wrote: > Hi Phil > > Because this source included in Korean Lanuge, I > send again to English. > > When the T4 Witango web Application Server for > Solaris installed, > 64 bit computing system (for example, Sun Enterprise > 3500, 4500, 5500, 6500). > > Witango is not supporting 64 bit architechure enough > when installed first (Occured Install error) , > This program is converting program from 32bit to > 64bit in shared memory for Solaris > > Enjoy yourself > > KJLee > ********************** > http://www.witango.co.kr > Tel: 82-2-585-9290 > Mobile:82-17-786-1141 > Webmail: [EMAIL PROTECTED] > email: [EMAIL PROTECTED] > ********************** > ---------------------- > > > #include <stdio.h> > #include <sys/types.h> > #include <sys/ipc.h> > #include <sys/msg.h> > #include <sys/sem.h> > #include <sys/shm.h> > #include <errno.h> > #include <unistd.h> > #include <time.h> > > > #include <netinet/in.h> > > #include <arpa/inet.h> > > > #define TRUE 1 > #define FALSE 0 > > > typedef struct > { > int pid; > char INFname[200]; > > } PROC_STATE; > > typedef int BOOL; > > static key_t gSHM_CS_Key; > static int gSHM_CS_ID; > PROC_STATE* parent; > > > int GetSharedMemory(key_t , char **, int , BOOL ); > int DelSharedMemory(key_t ); > int FreeSharedMemory(int ); > void SHMError(void); > > int main(int argc, char *argv[]) > { > > gSHM_CS_Key = 3837247118; > > printf("Hello, world\n"); > > if((gSHM_CS_ID = GetSharedMemory(gSHM_CS_Key, > (char**)&parent, sizeof(PROC_STATE), TRUE))== -1) > { > printf("Shredmemory Already Exist\n"); > > } > > > return 0; > } > > > int GetSharedMemory(key_t key, char **data, int > size, BOOL Flag) > { > int shmid; > > /*If TRUE, Create Shared Memory*/ > if (Flag) /*Flag = TRUE*/ > { > if ((shmid = shmget(key, size, > 0666|IPC_CREAT|IPC_EXCL)) < 0) > { > if (errno == EEXIST) > { > return -1; > > /* if ((shmid = shmget(key, size, > 0666)) < 0) > { > if (DelSharedMemory(key) == -1) > return -1; > > if ((shmid = shmget(key, size, > 0666|IPC_CREAT|IPC_EXCL)) < 0) return -1; > } > */ > } > } > } > else /*Flag = FALSE*/ > { > if ((shmid = shmget(key, size, 0666)) < 0) > return -1; > /*return GetSharedMemory(key, data, > size, TRUE);/*If there is no existing one, Create it > again*/ > } > > if ((*data = (char *)shmat(shmid, 0, 0)) == > (char *)-1) > { > shmctl(shmid, IPC_RMID, 0); > close(shmid); > return -1; > } > > if (Flag) > memset(*data, '\0', size); > > return shmid; > } > > /*============================================================================= > int DelSharedMemory( > key_t key : Shared memory key > ) > ------------------------------------------------------------------------------- > Delete shared memory by using shared memory key. > > Return Values > -------------- > int : success TRUE,fail : -1 > Remarks > -------- > ==============================================================================*/ > > int DelSharedMemory(key_t key) > { > int shmid; > > if ((shmid = shmget(key, 1, 0666)) < 0){ > /*SHMError();*/ > printf("DelSharedMemory Error"); > return -1; > } > > shmctl(shmid, IPC_RMID, 0); > close(shmid); > > return TRUE; > } > > > /*============================================================================= > int FreeSharedMemory( > int shmid : shared memory ID > ) > ------------------------------------------------------------------------------- > Delete shared memory by using shared memory ID. > > Return Values > -------------- > int : success TRUE,fail : -1 > Remarks > -------- > ==============================================================================*/ > > int FreeSharedMemory(int shmid) > { > shmctl(shmid, IPC_RMID, 0); > close(shmid); > > return TRUE; > } > > > > > void SHMError() > { > > switch(errno) > { > case EACCES: > printf("A shared memory identifier exists for key > but operation permission as specified by the > low-order === message truncated === > ATTACHMENT part 2 application/octet-stream name=iipc.c __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
