In the following code, I get a warning that there is an implicit declaration of function getpgid. I know its only a warning, but its for a class and the professor wants us to treat warnings as errors. So, help please.
I have included the appropriate header file as well so I have no idea whats wrong:
#include <unistd.h>
pid_t pid, pgid;
if ((pgid = getpgid(pid)) < 0) {
app_error("Failure to get process group ID");
}
From the man page:
Feature Test Macro Requirements for glibc (see
feature_test_macros(7)
):getpgid(): _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With