07-14-07 06:26 AM
Say I have a program that calls this function every 2 seconds
static int
tel(char *user, char *tty, const char *what)
{
pid_t cpid, wpid;
int stats;
cpid = fork();
if (cpid < 0) {
err("fork failed:", cpid);
}
if((execlp("tel", "tel", user, tty, what, (char *)0)) < 0)
perror("execlp tel failed\n");
_exit(EXIT_FAILURE);
}
while ((wpid= wait(&stats)) != cpid && wpid != -1)
;
return (WIFEXITED(stats) ? WEXITSTATUS(stats) : -2);
}
would calling wait() every 2 seconds, would I be 'polling'?
Chad
[ Post a follow-up to this message ]
|