Link to home
Start Free TrialLog in
Avatar of mfaa
mfaa

asked on

library and thread general question

What are in <unistd.h> and <stdlib.h> ?  

To compile a thread on linux, we type

$cc -D_REENTRANT threadprog.c -o threadprog -lpthread

what does -D_REENTRANT do?  

Thanks

MD
Avatar of shivsa
shivsa
Flag of United States of America image

When compiling code that uses threads we have to define the  _REENTRANT macro so that the thread-safe system functions are used instead.
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mfaa
mfaa

ASKER

Thanks for the reply...your help was greatly appreciated!

MD