Question: In C , no file pointers Skeleton of code: #include #include #include / * Problem 1 * / / * Global vairables that represent if

In C, no file pointers
Skeleton of code:
#include
#include
#include
/* Problem 1*/
/* Global vairables that represent if a child's handshake
has arrived. These globals also represent whether a
guess is less than (sgn1) or greater than (sgn2) the
referee's value */
static int sgn1;
static int sgn2;
int checkError(int val, const char *msg)
{
if (val ==-1)
{
if (errno == EINTR) return val;
perror(msg);
exit(EXIT_FAILURE);
}
return val;
}
void rentHandler(int sig)
{
/* Problem 2*/
}
void childHandler(int sig)
{
/* Problem 3*/
}
int rngRand(int first, int last)
{
int rng =(last - first)+1;
double perc =((double) rand())/(((double) RAND_MAX)+1);
int offst = rng * perc;
return first + offst;
}
int child1(pid_t rent)
{
/* Problem 4*/
}
int child2(pid_t rent)
{
/* Problem 5*/
}
void rentPause(int x)
{
while (1)
{
if (sgn1 && sgn2) break;
//if (sgn1) break;
pause();
}
sgn1= sgn2=0;
}
int parent(pid_t *child)
{
/* Problem 6*/
}
int main (int argc, char *argv[])
{
/* Problem 7*/
}
 In C, no file pointers Skeleton of code: #include #include #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!