How to interpret the shared memory key

I'm facing a problem interpreting the shared memory key on an AIX machine.

(1) I go to a property file and I see the following:

shm_key = "119112066"

(2) So I now go the command prompt and do this:

ipcs -m | grep 119112066

And, I do not find it. So what I do is to run the ipcs -m command again and I now see the keys in this format:

....
Shared Memory:
m   1048576 0xffffffff D-rw-------     root   system
m  55574874 0x01051165 --rw-rw-rw-    s2sys    staff
...

When I do a ps -eaf | grep 119112066, I see a bunch of processes like (note the shmkey argument as you scroll right)

....
 devtest 8233052 8491180   0   Jan 12  pts/9  0:01 ./TcpMgrPath/RtrBloTcpServer -netid WPB -ppid 8491180 -unit 0 -type BLOTCPSERV -shmkey 119112066 -lport 29311 -lfd 3 -lqlen 257 -mgr_cfg TcpMgr.cfg 
....

So my question is, how to interpret 119112066 in this hexadecimal 0x01051165 language? What might I be missing? Because what I eventually want to do is to create my own shared memory key and make sure I don't mess up anybody else's keys.

Thanks,
-Vijay

Hexadecimal key displayed in the output of the command 'ipcs -m' is the hexadecimal value of the shm_key you have given to create the shared memory. Here I think you are pointing to the incorrect shared memory hex value.

For your reference, Here is the program, which will create shared memory. and its reference ids in ipcs -m command. Hope this will clarify your question.

/* Program to create Shared memory */
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdio.h>
#include <stdlib.h>

main()
{
key_t key; 
int shmflg; 
int shmid; 
int size; 

key = 119112067;
size =1024;

if ((shmid = shmget (key, size, IPC_CREAT)) == -1) {
   printf("shmget: shmget failed");
exit(1);
} else {
   printf("Shmid ->%d<-\n", shmid);
  
}
}

This program creates the Shared memory with the key 119112066, and returns the shmid.

# cc shm.c
[root@btovm918 utils]# ./a.out
Shmid ->400261138<-
Its success[root@btovm918 utils]# ipcs -m | grep 400261138
0x07198182 400261138  root      0          1024       0
# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
obase=16
119112066
7198182

So 0x07198182 is hex value of the key 119112066..

Thank you. That certainly did help.

-Vijay