Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I can not get the below program to run using linix. I keep getting an error message fatal error: Types.h: no such file or

I can not get the below program to run using linix. I keep getting an error message " fatal error: Types.h: no such file or directory #include compilation terminated"

Can you please tell me what I need to do to get the program to compile. I know the answer to the question what is out put at line c and line p but I have to be able to get the code to run.

#include #include #include int value = 0; void *runner(void *param); /* the thread */ int main(int argc, char *argv[]) {pid t pid; pthread t tid; pthread attr t attr; pid = fork(); if (pid == 0) { /* child process */ pthread attr init(&attr); pthread create(&tid,&attr,runner,NULL); pthread join(tid,NULL); printf("CHILD: value = %d",value); /* LINE C */ }else if (pid > 0) { /* parent process */ wait(NULL); printf("PARENT: value = %d",value); /* LINE P */ } } void *runner(void *param) { value = 5; pthread exit(0); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

Contrast a primary and a secondary immune response.

Answered: 1 week ago

Question

What do you understand to be meant by LMS?

Answered: 1 week ago