. Advertisement .
..3..
. Advertisement .
..4..
I get warning: implicit declaration of function ‘wait’ when I run my program.
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
void test (char* program, char** arg_list)
{
pid_t chldPid;
int status;
if((chldPid = fork()) < 0){
exit(1);
}
else{
while(wait(&status) != chldPid)
printf("...\n");
}
}
How to fix it?
To use wait(2) you need to add librarys
One more solution for your reference and share your answer if you have better answer
it ‘s helpful 🙂 thanks