我在RHEL中有两个进程A和B,其中进程A将一些加密的数据写入共享内存并关闭,然后进程B到来并读取数据,但是数据似乎与写的有所不同? >
进程A
int shmID = shmget(keyID, 1024, IPC_CREAT | IPC_EXCL | 0640);
location = (unsigned char*)shmat(shmID, 0, 0);
memset(location, 0x0, 1024);
memcpy(location, Databuffer, DatabufferSize);
流程B
int shmID = shmget(keyID, 1024, 0640);
location = (unsigned char*)shmat(shmID, 0, 0);
memcpy(Outputbuffer, location, 1024);
你们能建议是否有人修改了数据