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.
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.
# 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