Simple Process program problems? -- Linux general technology-Linux programming and kernel information. The following is a detailed description. # Include
# Include
# Include
# Include
# Include
# Include
Int main ()
{
Int shmid;
Char * shmptr;
If (shmid = shmget (IPC_PRIVATE, 1000,0) <0)
{
Printf ("Here is the server: error, get share memeroy failed! \ N ");
Exit (1 );
}
If (shmptr = (void *) shmat (shmid, 0, 0) = (void *)-1)
{
Printf ("Here is the server: error, to make the shmat \ n ");
Exit (1 );
}
Shmptr = "Hello World ";
If (system ("./receiver") <0)
{
Printf ("Here is the server: System error ");
}
Sleep (320 );
Return 0;
}
When running this program, an error is reported:
Here is the server: error, to make the shmat
I don't know why. hope you can give me some advice...
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service