How do I pass virtual address to shmat() function in a guaranteed way
问题 I am using shmat() by using a virtual address. the first process calls a shmat with shmaddr as null and when it gets the virtual address of the data block it stores in another shared memeory place. the second process calls the shmat() with the virtaul address that was stored in shared memeory by the first process. The second process usually can attach to the same virtual address in most of the cases, but in one case I couldn't and shmat returned -1 and when I used gdb I saw that the address