Hello Members,

The wait() system call is illustrated to be used as follows:

int status, pid;
   /*fork a child process*/
   

   /*parent is waiting for the child to terminate*/
   pid = wait(*status)

What exactly does the pointer to the "status" variable do when "status" has not even been assigned a value anywhere?

Thank you!

You have the wrong idea about that parameter. It's supposed to be a pointer to an integer that you declare in your program. Read the man page for more information pid = wait(&status)

Hello Dragon,

Makes sense! It's clear now.

Thank you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.