What stops me from reading/writing further than the size of a shared memory? (System V IPC)
问题 What I'm doing is: shmget(shm_key, shm_size, 0666 | IPC_CREAT); (and of course attach to it) and I've already set the size to exactly 12 Bytes but when i try something like: sprintf(shm_ptr, "Imagine about 200-300 characters here\n"); it seems to work normally with zero problems or warnings, and to check that , I tried to read it from a completely different process (i fork and exec the first one) and sure enough printf("%s", shm_ptr); prints the message that was in that segment, which is