Есть вот такой код
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <iostream>
using namespace std;
int main ( int argc, char ** argv) {
FILE *textfp, *passfp;
int maxthreads = 0, threads = 0;
char textItem[256];
cout << "test mode" << std::endl;
textfp = fopen("/home/text-list", "r");
if(textfp == NULL) {
printf("Text list not found\n");
exit(-1);
}
maxthreads = 10;
while(!feof(textfp)) {
if(!fgets(textItem, sizeof(textItem) - 1, textfp))
continue;
*strchr(textItem, '\n') = '\0';
while(threads > maxthreads) {
wait(NULL);
threads--;
}
threads++;
usleep(500000);
if(fork()) {
//text processing
}
}
while(wait(NULL) >= 0);
cout << "test test" << std::endl;
}
error: no matching function for call to ‘wait::wait(NULL)’
while(wait(NULL) >= 0);