There are two libraries zconf.h and unistd.h which are used to at least to get pid of the process. I generally test my code on Mac OSX and Ubuntu 18.04 in which they use zconf.h preferably(compiler offers zconf.h in lieu of unistd.h) if I forget to add, then if the code works, it's ok. However, in some prior day I needed to test the code in another machine AFAIR it has Ubuntu 10 or 12. Its compiler complained that there is no zconf.h. I wonder whether there is a way to check a machine has zconf.h, if not, use unistd.h. Can it be done using preprocessors like,
#ifdef ITS_IF_CONDITION
#include <zconf.h>
#else
#include <unistd.h>
zconf.hI know is part of zlib. If you want to usegetpid(), you should just#include <unistd.h>, which will work on all unix systems.definedtakes an identifier. Afterdefined(__has_includethe only possible valid token is), not(<zconf.zconf.hyou're talking about. If you're talking about zlib, that's for compression, not PIDs.configurescript when you build/install zlib (this is what cyco130 was referring to by "autoconf").